The files located in this repository are setup scripts to setup a server in different test environments, the socket server files which are used for the android device to communicate with the Raspberry Pi server, and files used to process scans from sample data.
Features of the Server:
To setup the server follow the instructions for either a RPI 3/3B+ or Virtual Machine depending on your test environment. (Note: RPI 3B+ requires 5v 1.0A to power the device without errors occuring)
Follow these steps in order to install and setup a Raspberry Pi as the IRTSA server:
ping www.google.com
.wget https://raw.githubusercontent.com/IRTSA-SoftwareProject/IRTSA-Server/master/src/pi_setup.sh
chmod +x pi_setup.sh
sudo ./pi_setup.sh
This will setup the Raspberry Pi as in access point mode with the SSID of rpi-AP and password of Th3rmalHotspot and can be connected to with the IP address 10.0.0.1 either through a web browser or a ssh client (putty).
Follow these steps in order to install and setup a Virtual Machine as the IRTSA server:
wget https://raw.githubusercontent.com/IRTSA-SoftwareProject/IRTSA-Server/master/src/pi_setup_vm.sh
chmod +x pi_setup_vm.sh
sudo ./pi_setup_vm.sh
The following are Optional steps to follow which are only to be used when wanting the Android SDK Emulator to communicate with the Virtual Machine to emulate an environment with a RPI and Tablet
This will setup a Virtual Machine to act as a Raspberry Pi server which will have the IP address of 10.0.0.1 which can be accessed by the Android SDK Emulator provided networking with the Virtual Network Editor in VMware has been setup correctly.
To run the python demo script in the demo/ directory with:
Then run the script passing in an argument for the desired name of the saved file with:
The mobile app connects to the server using a websocket. If you don't have access to a RaspberryPi, you can run the code on a regular computer and get the mobile app to connect to that instead.
This is entirely optional but makes it easier to use different python versions in different projects. If you don't want to use a virtual environment, skip to "Installing packages".
You'll need to make sure you have virtualenv installed (pip install virtualenv
). Then run:
virtualenv -p $(which python3) venv
Then activate the virtualenv by running
./venv/bin/activate
There are variations of the activate
script if you use csh
or fish
instead of bash
.
pip install -r requirements.txt
This will install all of the pip packages that you need.
The server requires python3.6, if you created a virtual environment and it is
active, the python version would have been configured for you automatically. If not, you'll have to
make sure python3 --version
says 3.6. Then run this:
python -m server
This should print out a message indicating that the server is running and the address to connect to from the client.