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
#11
I don't think tinypilot really plays well with node red... So pypilot_hat will configure the io pins as input and read from them. You don't have to assign actions to all of them, so your shutdown should still work but output on one of these may need to slightly modify pypilot/hat/gpio.py
Reply
#12
(2020-06-11, 12:01 PM)xfactor99 Wrote:
(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

Hi Andreas, this looks great. Can you share the connections for each push switch to the TinyPilot? Auto and Menu are clear, but tehe remaining pins on the Pi are up, down, and select. How do you handle the double-left/double-right?
Thanks
Phil
Reply
#13
(2020-07-01, 08:25 PM)Phil_Shotton Wrote:
(2020-06-11, 12:01 PM)xfactor99 Wrote:
(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

Hi Andreas, this looks great. Can you share the connections for each push switch to the TinyPilot? Auto and Menu are clear, but tehe remaining pins on the Pi are up, down, and select. How do you handle the double-left/double-right?
Thanks
Phil

Hi Phil

the gpio's are
keys with switch to ground gpio   (17, 27, 22, 18, 23, 5, 6, 26)

so if I remember well the 5 and 6 is the double left and right.
up and down is single left and right 27 and 22.

Select I dont use and there is also a posibility to tack ....
Just try the above pins by shortening them just a short time to ground
and see what happens.

Greetings 
Andreas
Reply
#14
The future versions of pypilot uses the same pins, but also offers 7 more external pins (via arduino)

All of the pins can have customized functions as well via the web interface to reconfigure them.
Reply
#15
(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?

Not sure if you have the service set-up, but you can run a python script just by adding it in /etc/rc.local:

- start terminal
- sudo nano /etc/rc.local
- Just before the exit command, type the command you run to open the script (usually: python3 /pathtoscript/scriptname.py
- Don't forget to close with & after the script name

Hope this helps until the next version launches.
Reply
#16
(2020-06-09, 03:52 AM)CapnKernel Wrote: Are you talking about buttons onto tinypilot, or buttons onto OpenCPN?

(I use a keypad like this with tinypilot)

 [Image: s-l1600.jpg]

Did you need to adjust anything software wise to get this switch array to work? Can you show my how you wired it to the gpio pins?
Reply
#17
You don't need to change software to use this switch. It just needs to be plugged in the right way, and the led won't work, and the 'power' will be select/back.
Reply
#18
(2020-10-09, 11:14 PM)seandepagnier Wrote: You don't need to change software to use this switch.   It just needs to be plugged in the right way, and the led won't work, and the 'power' will be select/back.

Thanks Sean, That would work fine, so what value of resistor should I put in series and what side of the switch should the resistor be placed? Between the gpio pin and the switch or between the switch and ground?
Reply
#19
(2020-10-09, 10:03 PM)rastam4n Wrote: Did you need to adjust anything software wise to get this switch array to work? Can you show my how you wired it to the gpio pins?

No, just connected it, like this:

 https://forum.openmarine.net/showthread....3#pid11963

(2020-10-10, 01:04 AM)rastam4n Wrote: Thanks Sean, That would work fine, so what value of resistor should I put in series and what side of the switch should the resistor be placed? Between the gpio pin and the switch or between the switch and ground?

In another thread, Sean suggested a resistor between the GPIO and the keypad pin to provide some protection against possible short circuits.  I used a 1k resistor array and it works ok:

   

I've connected the LED to GPIO7, but I don't know if that's the recommended pin, or if the pin has sufficient drive current.
Reply
#20
(2020-10-12, 02:10 AM)CapnKernel Wrote:
(2020-10-09, 10:03 PM)rastam4n Wrote: Did you need to adjust anything software wise to get this switch array to work? Can you show my how you wired it to the gpio pins?

No, just connected it, like this:

 https://forum.openmarine.net/showthread....3#pid11963

(2020-10-10, 01:04 AM)rastam4n Wrote: Thanks Sean, That would work fine, so what value of resistor should I put in series and what side of the switch should the resistor be placed? Between the gpio pin and the switch or between the switch and ground?

In another thread, Sean suggested a resistor between the GPIO and the keypad pin to provide some protection against possible short circuits.  I used a 1k resistor array and it works ok:



I've connected the LED to GPIO7, but I don't know if that's the recommended pin, or if the pin has sufficient drive current.
I believe the resistor Sean suggested was a current limiting resistor to GND avoiding a direct short to ground by the switch.
I have a number of these membrane keypads and they all have a resistance from 27-47 Ohm per switch, so no need for the resistor to GND.
My keypad has an LED as well with a separate wire for the power, not using it at the moment.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)