- Create http.cpp and http.hpp
- functions for initializing a http server
- function for URL api/joystick
- receive joystick data from http post request
- parse json, define joystick position (function from joystick.hpp)
- send data to control task via queue
- control.hpp/cpp:
- add HTTP mode to handle loop
- receive joystick commands from queue, generate commands, send to
motorctl
- upgrade changeMode function with ability to run functions at switch
FROM and TO certain modes
- add code to start/stop wifi and webserver when switching to/from
HTTP mode
- change toggleModes and toggleIdle to use the changeMode function
- main.cpp:
- add several sections with code for testing new functions (commented
out)
- add http loglevel
- buzzer.cpp:
- add command (press 4 times) to toggle between HTTP and JOYSTICK mode
FIXME: moved initialization of wifi to main.cpp at startup because of an
error -> resolve this and place wifi start and stop functions into
mode-change as intended
currently works best in accesspoint mode with laptop connected using the
react-webapp
Firmware for a homemade automated electric armchair.
More details about this project: https://pfusch.zone/electric-armchair
Installation
Install esp-idf
For this project ESP-IDF v4.4.1 is required (with other versions it might not compile)
#download esp-idf
yay -S esp-idf #alternatively clone the esp-idf repository from github
#run installation script in installed folder
/opt/esp-idf/install.sh
Clone this repo
git clone git@github.com:Jonny999999/armchair_fw
Compilation
Set up environment
source /opt/esp-idf/export.sh
(run once in terminal)
Compile
idf.py build
Upload
- connect FTDI programmer to board (VCC to VCC; TX to RX; RX to TX)
- press REST and BOOT button
- release RESET button (keep pressing boot)
- run flash command:
idf.py flash
- once "connecting...' successfully, BOOT button can be released
Monitor
- connect FTDI programmer to board (VCC to VCC; TX to RX; RX to TX)
- press REST and BOOT button
- release RESET button (keep pressing boot)
- run monitor command:
idf.py monitor
- once connected release BOOT button
- press RESET button once for restart
Hardware setup
pcb
Used pcb developed in this project: https://pfusch.zone/project-work-2020
connection plan
A diagram which shows what components are connected to which terminals of the pcb exists here:
connection-plan.drawio.pdf
Planned Features
- More sensors:
- Accelerometer
- Lidar sensor
- GPS receiver
- Anti slip regulation
- Self driving algorithm
- Lights
Usage
Switch functions
previous functions - not implemented yet
| Count | Action |
|---|---|
| 1 | define joystick center |
| 2 | toggle motors |
| 3 | toggle log-level (WARN, DEBUG, INFO) |
| 4 | define max duty |
| 5 | toggle mode MQTT/JOYSTICK |
| 6 | toggle mode SHAKE/JOYSTICK |
| 7 | toggle testing-mode (dry-run) |
Description
Firmware for a homemade automated electric armchair using an esp32 controller on a custom pcb
Languages
C++
83.8%
C
15.3%
CMake
0.7%
HTML
0.2%