This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RPi 3 Pypilot control via GPIO push buttons
#1
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
Reply
#2
Are you talking about buttons onto tinypilot, or buttons onto OpenCPN?

(I use a keypad like this with tinypilot)

 [Image: s-l1600.jpg]
Reply
#3
CapnKernel,

Your choice of keypad is great.

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

Eric
Reply
#4
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
Reply
#5
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.
Reply
#6
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?
Reply
#7
Photo 
(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
Reply
#8
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
Reply
#9
(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
Reply
#10
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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)