Controller for driving https://github.com/jakkra/Mars-Rover. Webpage for viewing telematics graphs on phone https://github.com/jakkra/Rover-Mission-Control.
Sets up an AP, the Rover will automatically connect if it's in range. The Rover is controlled by sending joystick and switch state over either LoRa or a websocket. If the Rover isn't connected to the AP, then data will be sent over LoRa instead. There is a switch to override this behaviour and always send data over LoRa even if the Rover is connected to the AP.
When the Rover is connected to the local AP it will send telematics data over the websocket, or over LoRa if the Rover is outside of WiFi range. The data is then in turn passed on to a phone if one is connected. When the Rover is close by telematics will arrive about 10/s over WiFi, if outide of range then telematics are transported over LoRa. As LoRa modules cannot do true duplex data transfer we need to switch between sending and receiving, meaning telematics sent by the rover while we are sending joystick data will be lost. From experimentation LoRa telematics arrive about every 500ms.
A phone can connect to the Controller AP to view the telematics from the Rover. Phone opens a websocket connection to the Controller and receives the telematic data the Rover sends. Telematics website can be found here: https://github.com/jakkra/Rover-Mission-Control.
Full Fusion 360 project is found in CAD
folder.
- ESP32 + LoRa module
- 2x Joysticks
- 1x ADS1115 (ESP32 does not have enough ADCs for all the pots)
- A few on-off-on switches
- 2 potentiometers
- 2 colored LEDs
For pinmapping see: https://github.com/jakkra/RoverController/blob/master/main/controller_input.c#L46
Follow instruction on https://github.com/espressif/esp-idf to set up the esp-idf, then just run idf.py build
or use the VSCode extension.
TBD upon request.
Run git apply esp-idf-patch/no_delay.patch
in your esp-idf folder. This decreases lag for TCP as it will flush the buffers after every write instead of LWIP buffering TCP data to send it in chunks.