I tested this succesfully in the following way. I installed pypilot on an RP4 openplotter image from github, then ran pypilot at the prompt in one terminal window, pypilot_hat in another window, pypilot_web in a third window. Then I connected a browser to the :33333 port for the hat config screen, and another browser window to the :8000 port for the autopilot screen. I connected GPIO26 to a switch to ground and clicked the switch. In the hat config screen, this was visible and I connected it to the 'engage' function. From then on, I could see that the AP slide in the autopilot screen was switched to 'on' each time I clicked the switch.
So here is a positive scenario that you could replicate. If you succeed, work from here, changing one thing at a time, towards what you want. If you don't succeed, Francesco: post output! Attached mine.
Some notes:
So here is a positive scenario that you could replicate. If you succeed, work from here, changing one thing at a time, towards what you want. If you don't succeed, Francesco: post output! Attached mine.
Some notes:
- something went wrong in the installation from github; I removed the whole git clone directory and started again. Then, pypilot would start (at the prompt).
- Pypilot nowadays complains a lot about 'autopilot iteration running too slow' but that seems to be the latest fashion; just filter the message (e.g., run at the prompt: pypilot | grep -v "autopilot iteration running too slow")
- the test was done without motor controller or imu
- to get pypilot_hat running I had to set pi:ir to false in the hat.conf. At first, this file is not present but it is when you run pypilot_hat a second time.