OpenMarine
Cockpit button control? - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: Feature requests (https://forum.openmarine.net/forumdisplay.php?fid=21)
+--- Thread: Cockpit button control? (/showthread.php?tid=4910)



Cockpit button control? - PhilipL - 2023-09-24

My nav station is below and I would prefer not to have a phone in the cockpit to control PyPilot.  What I would like are three waterproof momentary buttons in the cockpit:

Standby, Port, Starboard.

Short press for 2 degrees, long press for 10 degrees and very long press to tack.

When standby on, press moves linear actuator.

My thought is a small Arduino to take button input and send to RPi via USB cable.

I know I could have cable to the nav station RPi, but one USB cable seems cleaner.

Comments?  I see it as a winter project.

Philip


RE: Cockpit button control? - mgrouch - 2023-09-24

Here is esp32 based project which has
pypilot control screen (on waterproof touchscreen)

You can use it as is. Or adapt the code to use hardware buttons
attached to esp32.

https://github.com/bareboat-necessities/bbn-m5stack-tough


RE: Cockpit button control? - PhilipL - 2023-09-24

(2023-09-24, 06:26 PM)mgrouch Wrote: Here is esp32 based project which has
pypilot control screen (on waterproof touchscreen)

You can use it as is. Or adapt the code to use hardware buttons
attached to esp32.

https://github.com/bareboat-necessities/bbn-m5stack-tough

Very interesting. I'll have a close look at it.

My first thoughts, though, are that I am trying to simplify everything. I had OpenPlotter with PyPilot and had huge problems in getting it to work properly, so adding a different OS doesn't seem too attractive.  After many years of using Linux but not getting to grips with it, I've been putting my head into the internals, so hopefully will be a bit more expert.

I haven't heard of ESP32 boards and have just been delving into Arduino - which has a huge amount of information out there - but will have a look.

Buttons appeal - easy and basic. I'll take a look at your code and see how you have implemented things - very useful.

I am off sailing for a few weeks, so this winter is when I'll get down to the project.

Thanks,

Philip


RE: Cockpit button control? - mpuz - 2023-12-05

you do not need to download new OS, just burn ESP32 controller with the code provided and thats all


RE: Cockpit button control? - kirren - 2023-12-06

If you just want buttons Philip, you don't need a separate microcontroller. You can just wire to the hat (https://pypilot.org/schematics/pypilot_tinypilot.pdf) and have the buttons short to ground. Have a look at the configuration options in the web interface to see if that'd suit you. According to Sean, holding +1/-1 for greater values is now supported (https://forum.openmarine.net/showthread.php?tid=4304&pid=24145#pid24145), so your idea of three buttons for a screen-less set of simple buttons could work fine and would only require 4 wires.


RE: Cockpit button control? - PhilipL - 2023-12-11

(2023-12-06, 12:48 AM)kirren Wrote: If you just want buttons Philip, you don't need a separate microcontroller. You can just wire to the hat (https://pypilot.org/schematics/pypilot_tinypilot.pdf) and have the buttons short to ground. Have a look at the configuration options in the web interface to see if that'd suit you. According to Sean, holding +1/-1 for greater values is now supported (https://forum.openmarine.net/showthread.php?tid=4304&pid=24145#pid24145), so your idea of three buttons for a screen-less set of simple buttons could work fine and would only require 4 wires.
Kirren

Many thanks - just got back to this. Looks like your suggestion solves a lot of programming hassle. On the other hand, I won't learn how to link an arduino and RPi in this project.

Philip