#Project for remote controlling a raspberry pi car.
what you need:
- raspberry pi
- a 3 wheel car ( two engines run from some sort of battery)
- power bank for raspberry
- l298n motor control board
to setup and start the app on raspberry pi:
- connect raspberry to the charger and to the ethernet cable (or to wlan - best just connect keyboard and external monitor and choose your wifi name and type password)
- read ip address of raspberry from your router admin paner, sth like: http://192.168.0.1/dhcp.htm
- ssh pi@192.168.0.1 or pi@192.168.0.150 or something along those lines(password raspberry)
- install nodejs and npm #TODO provide a link
- ssh into raspberry pi
- download project from repo https://github.com/jedrula/remoteraspberrycar.git to remoteraspberrycar folder (TODO provide better instructions on how to get the app to the pi)
- cd remoteraspberrycar
- npm install
- npm start (TODO provide more information on how to start the program as a service on the pi)
to setup and start the web client
-
clone the repo and enter its directory
-
cd frontend/ember_cli
-
start ember app
ember serve --environment production (TODO this probably won't work as you need to modify the dynamically set host api of your pi)
- for frontend development with mirage
ember serve --environment development
Troubleshooting:
express gets requests but engine does not respond to command - maybe you are not running node app with sudo
to restart raspberry you can try this from ssh:
sudo shutdown -r now
fixing-wifi-dropout-issues
sudo iw dev wlan0 set power_save off
see here for more details
NOTES
I have been experimenting with speed, benchmarking websockets, tunneling using resin.io and connection straight to my modem
- websockets is usually a bit faster then fetch but not always
- straight modem connection is much faster then resins
- there might be room for improvement as right now there is an additional hoop - reverse proxy on NAS (issue with forwarding port 80 so i do 7002->nas->80 on pi)
- might be a good idea to let the user choose the transport type and report with the results
- right now the lowest we can get is about 70ms with ws and 80ms with fetch, both transports rarely go above 300ms mark for a roundtrip