OpenMarine
RPi 3 Pypilot control via GPIO push buttons - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: RPi 3 Pypilot control via GPIO push buttons (/showthread.php?tid=2636)

Pages: 1 2 3


RPi 3 Pypilot control via GPIO push buttons - drbarritt - 2020-06-08

Hi, the Tinypilot board supports push buttons directly wired to GPIO.  Is there a way of doing the same on an RPi 3?  I would like to have a simple push button control panel with Engage/Disengage, Add/Subtract from course, Tack etc.  I know I can do this on a mobile phone using the webb app, but I would like a way of controlling Pypilot when my hands are cold and wet!
Thanks
David


RE: RPi 3 Pypilot control via GPIO push buttons - CapnKernel - 2020-06-09

Are you talking about buttons onto tinypilot, or buttons onto OpenCPN?

(I use a keypad like this with tinypilot)

 [Image: s-l1600.jpg]


RE: RPi 3 Pypilot control via GPIO push buttons - ericoh88 - 2020-06-09

CapnKernel,

Your choice of keypad is great.

I was very concerned about using switches that are not waterproof . Is this a customised design?

Eric


RE: RPi 3 Pypilot control via GPIO push buttons - drbarritt - 2020-06-09

I don't have a TinyPilot. I have an RPi 3 running Open CPN (latest version) with the Pypilot plugin. This communicates via a serial link to an Arduino Nano that actually controls the steering motor (a hydraulic pump in my case via a Pololu H bridge controller). This is all working fine (on the bench anyway). So, yes I want to connect the buttons direct to the RPi 3. If this is not supported by the Pypilot plugin then I suppose I could add a keypad to the Arduino to take manual control of the motor, but this would not be as good a solution.
Cheers
David


RE: RPi 3 Pypilot control via GPIO push buttons - seandepagnier - 2020-06-11

The service you need is either "pypilot_hat" or "pypilot_lcd" depending on the pypilot version. This service reads from gpio pins, IR and other inputs and optionally displays as well on a SPI display. This service communicates over a socket to pypilot to control the autopilot, and by default it is not running on openplotter.


RE: RPi 3 Pypilot control via GPIO push buttons - drbarritt - 2020-06-11

Sean, many thanks. I have Pypilot 2.0.8 so please can you tell me with service I need and how to load it. Also, is there a file that defines what each GPIO does?


RE: RPi 3 Pypilot control via GPIO push buttons - xfactor99 - 2020-06-11

(2020-06-11, 11:00 AM)drbarritt Wrote: Sean, many thanks.  I have Pypilot 2.0.8 so please can you tell me with service I need and how to load it.  Also, is there a file that defines what each GPIO does?

Hi David

most awnsers to all of your questions concernig the tinypilot/pypilot (basicly the same) you will find by searching the  wiki, the forum and the code on github.

Also simple trying will learn you a lot and is great fun. At the end when all these did not help others will be pleased to do so ....  
You are absolutely right in wanting save control over the autpilot ..... best by more then one way ....

I leave you a picture of my control at the helm wich is wired (except the clutch-swich for savety) to the GPIO´s:
(and reported in this forum erlier)
[Image: attachment.php?aid=761]


Greetings and save sailing
Andreas


RE: RPi 3 Pypilot control via GPIO push buttons - drbarritt - 2020-06-11

Success! I ran hat.py and browsed to port 33333 and set up the pins to do the actions I wanted. All working fine. All I need to do now is work out how to run hat.py as a service. I also need to stop the pop up lcd screen from appearing on the Pi , I assume it does this as I have no SPI lcd screen connected.
Many thanks for your help!
David


RE: RPi 3 Pypilot control via GPIO push buttons - seandepagnier - 2020-06-13

(2020-06-11, 07:03 PM)drbarritt Wrote: Success! I ran hat.py and browsed to port 33333 and set up the pins to do the actions I wanted.  All working fine.  All I need to do now is work out how to run hat.py as a service.  I also need to stop the pop up lcd screen from appearing on the Pi , I assume it does this as I have no SPI lcd screen connected.
Many thanks for your help!
David

The next version of the pypilot plugin for openplotter configures pypilot_hat as a service.    To run without a display try "pypilot_hat none" to disable the debugging display


RE: RPi 3 Pypilot control via GPIO push buttons - AlanH - 2020-06-14

Sean et al,

I upgraded from OP 1.2->2.0. Not sure now how to configure my GPIO actions as before? I have a hardware button on GPIO19 to shut down the system, and a status LED on GPIO16.  Are these via NodeRED now?