IDS: Code to collect the data for the wallet model
See Releases »
Research Paper
·
Test Results
·
See Global Usage
Table of Contents
This code will be used in order to detect anomalies and to inform our IDS about it.
- Install the latest version of Python 3 with
pip
(included): https://www.python.org/downloads/ - Install the latest version of PlatformIO: https://docs.platformio.org/en/latest//core/installation.html#installation-methods
pip install -U platformio
- Clone the project
git clone https://github.com/PIR-IDS/wallet-data-collector.git
- Install the dependencies by typing the following command while being in the project root:
pio pkg install
Using an IDE
If you want to use a specific IDE with this project, you can list the compatible ones by checking the --ide
line with:
pio init -h
Choose your IDE with:
pio init --ide <ide>
⚠️ DO NOT COMMIT THE NEWLY CREATED FILES AFTER THE IDE INIT COMMAND.You can add their name/location in the
.git/info/exclude
file to exclude them from the VCS without affecting the.gitignore
file. You will also have to add the build directories created by your IDE in order to keep your artifacts outside of the project repository.
Use the following command in the project root to build and upload the firmware in the default debug
mode (with the board plugged):
pio run -t upload
By adding the -e release
option you will be in release
mode.
You can also build the firmware in the default debug
mode without uploading:
pio run
Again, by adding the -e release
option you will be in release
mode.
Before running the tests on your machine, you need to follow these instructions: https://docs.platformio.org/en/latest/platforms/native.html#installation
Then, you can run the "desktop" (i.e. not necessitating the board) tests with the following command:
pio test -e native_debug -e native_release
If you want to run the tests for the board, you need to run this command with the board plugged:
pio test -e debug -e release
Before generating the documentation on your machine, you need to follow these instructions: https://doxygen.nl/manual/install.html
Then, to generate the Doxygen documentation, run the following commands:
mkdir -p build/docs
doxygen
To collect properly the data of the accelerometer without having to plug the card to a PC, we use the bluetooth connection by running the BLE Reader on a PC to retrieve the accelerometer data. After uploading the code on the arduino, unplug it, start the battery and put the arduino in the wallet you want to test. Then, record and retrieve the data by running the BLE Reader on a laptop.
For the positive samples, edit the main.cpp file to send 500 lines on each sample.
For the negative samples, there are two options. First, we can record the data of the wallet utilisation without pay card utilisation. To do that, the method is similar as the one for the positive samples. We can also record the data of the wallet during non-wallet utilisation (walking, climbing stairs, ...). To do that, edit the main.cpp file to send 2000 lines on each sample.
The data of the accelerometer is collected by the arduino between 2 transmissions. The moves done during transmission are not recorded.
TODO
Romain Monier [ GitHub ] – Co-developer
Noé Chauveau [ GitHub ] – Co-developer
Project Link : https://github.com/PIR-IDS/wallet-data-collector
Organization Link : https://github.com/PIR-IDS