(R)emote (S)oftware (C)ommunications (S)ystem is a lightweight Raspberry Pi Flask server for streaming video to the browser and mapping post requests to serial instructions. This system is built to interface with a remotely controlled bot armed with disinfectant pumps to be deployed in a commercial setting. This project is deployed with a custom VPN server to allow flexibility in connecting bots with remote operators from any location with an internet connection.
Bot Selection Interface: https://github.com/avesk/bot-selection-interface queries each instance of RSCS running on a private network, and populates a selection interface with hyper links to available bots
export FLASK_APP=App.py
For localhost:
flask run
For Externally Visible Server
flask run --host=0.0.0.0
For uWSGI Server:
uwsgi --ini /home/pi/RSCS/uwsgi_config.ini
If OpenCV fails to install with pip install -r requirements.txt, try:
pip install opencv-contrib-python==4.1.0.25 --no-cache-dir
- OSX: https://pimylifeup.com/backup-raspberry-pi/
- Linux: https://www.raspberrypi.org/forums/viewtopic.php?t=46911
- SSH into the VM instance
- run
sudo poweroff
Starting the VPN:
- Contact support and request Administrative access, you will have to give them your public IP address. Support will whitelist your IP and send you the
VPN URL,admin user nameand temporarypassword. - Visit the
VPN URL/adminpage and log in with your credentials. - Go to User
Management > User Permissionsand select theMore settingsbutton next to youradmin user name. Change your password to something secure, selectSave Settings. - Once the page reloads hit
Update Running Server. - Now, visit the
VPN URL, and download your user locked client config file. - Also visit the link and download the
OpenVPN Connectfor your OS.
- Follow the instructions for connecting to your VPN through
OpenVPN Connect. You will need yourVPN URL,user name, andpassword. - You now should be connected to the VPN!
- With an Admin account, log into the
VPN Admininterface. - Create a new user called
bot[n]where[n]is some unused suffix for existing bots on the VPN with the following Permissions checked/selected:No Default GroupAllow Auto Login
- Select
More Settingsand:- Give the bot a static IP address of the form:
10.0.0.10[n] - Check the
all server-side private subnetsbox - Check the
all other VPN clientsbox
- Give the bot a static IP address of the form:
- Hit
Save Settings - Once the page reloads hit
Update Running Server. - Now, visit the
VPN URL, and login with the credentials for the bot user you just created and download the autologin client config file. - rename the file to
bot-client.ovpn SCPthe config file into the Bot'shomedirectory.- Whitelist the Bot's Public IP Address in Google Cloud (Contact support if neccessary)
- Reboot the Bot
- The Bot should now be accessible in the VPN at
10.0.0.10[n]
If the bot is having trouble connecting to the VPN,
Try running: sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
This will likely be taken care of in the .bashrc file
nohup sudo openvpn --config bot-client.ovpn &- Connecting To Access Server With Linux
- Contact support and request Administrative access, you will have to give them your public IP address. Support will whitelist your IP and send you the
VPN URL,user nameand temporarypassword. - Visit the
VPN URLpage and log in with your credentials. - Once logged in, select
Change Password, and update your password. - Once the page reloads hit
Update Running Server. - Now, visit the
VPN URL, and download your user locked client config file. - Also visit the link and download the
OpenVPN Connectfor your OS. - Follow the instructions for connecting to your VPN through
OpenVPN Connect. You will need yourVPN URL,user name, andpassword. - You now should be connected to the VPN!
- Start manually:
uwsgi --ini /home/pi/RSCS/uwsgi_config.ini - viewing error logs
tail -f /var/log/nginx/access.log
more info:
- https://www.raspberrypi-spy.co.uk/2018/12/running-flask-under-nginx-raspberry-pi/
- https://iotbytes.wordpress.com/python-flask-web-application-on-raspberry-pi-with-nginx-and-uwsgi/
Problems with systemd:
This stack post helped to solve https://raspberrypi.stackexchange.com/questions/103458/cant-use-sudo-systemctl-start-myservice/113933#113933
