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:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use one gpio button to engage and disengage py-pilot
#1
I want to use buttons connected directly to pi gpios. But I would like to use one button to engage and disengage py-pilot. Is there an easy way to achieve that or do I need to learn python :-)

Thanks
Reply
#2
I am not sure if you want to use 1 button to engage and a different to disengage, or 1 button to toggle. By default the "auto" pin marked on the pypilot hat will do this.

Yes, assuming you are running the pypilot_hat service (already enabled on tinypilot) navigate to the host:33333, or in the web control of pypilot there is a link in the configuration to programming keypads and remotes.

From here you can reprogram the remotes but also any of the gpio pins to do any types of functions, including engage, standby, or auto which toggles (but exits menu if in the menu)
Reply
#3
I am thinking of adding some pypilot actions to the openplotter-notifications app so that some pypilot controls can be triggered by predefined notifications in the Signak k server. This would include GPIO states, environmental conditions, any onboard sensor state... the possibilities are endless. Obviously, this should be handled with extreme care.

Initially I only would include:

ap.enabled
ap.heading_command
ap.mode
ap.tack.direction
ap.tack.state

This would also solve Steve's request because in openplotter-gpio app you can generate notifications using any GPIO.

Any suggestion?
Reply
#4
(2024-05-01, 10:24 PM)Steve OShaughnessy Wrote: I want to use buttons connected directly to pi gpios. But I would like to use one button to engage and disengage py-pilot. Is there an easy way to achieve that or do I need to learn python :-)

Thanks

You might find this and some more information here: https://github.com/pypilot/workbook/wiki...-interface.

So what you want can be done with the standard issue of pypilot. No python knowledge needed, but it might still be a bit intimidating. Let us know where you are at; if you have built or assembled a pypilot, you can do this as well!
Reply
#5
(2024-05-02, 05:10 PM)Sailoog Wrote: I am thinking of adding some pypilot actions to the openplotter-notifications app so that some pypilot controls can be triggered by predefined notifications in the Signak k server. This would include GPIO states, environmental conditions, any onboard sensor state... the possibilities are endless. Obviously, this should be handled with extreme care.

Initially I only would include:

ap.enabled
ap.heading_command
ap.mode
ap.tack.direction
ap.tack.state

This would also solve Steve's request because in openplotter-gpio app you can generate notifications using any GPIO.

Any suggestion?

This could work, but my main concern would be for manual control and the amount of delay time or lag to trigger events this way. It might end up being a lot less responsive. For other actions such as listed here, this is not very important.

Maybe it would be better to instead assign gpio to signalk, or pypilot or other apps similarly to assigning other hardware such as gps or serial ports?
Reply
#6
After reading https://github.com/pypilot/workbook/wiki...-interface I have realized that currently openplotter is not checking GPIO conflicts well. We should parse ~/.pypilot/hat.conf and we are not doing this. I will add this to openplotter v4 ASAP.

Question. I can se this in ~/.pypilot/hat.conf: "gpio27_06", does this mean that both GPIO27 and GPIO06 are used?
Reply
#7
(2024-05-04, 09:30 AM)Sailoog Wrote: After reading https://github.com/pypilot/workbook/wiki...-interface I have realized that currently openplotter is not checking GPIO conflicts well. We should parse ~/.pypilot/hat.conf and we are not doing this. I will add this to openplotter v4 ASAP.

Question. I can se this in ~/.pypilot/hat.conf: "gpio27_06", does this mean that both GPIO27 and GPIO06 are used?

I am not sure exactly what you are referring to, but it likely indicates that if both of those gpio are pressed at the same time a particular action is triggered.   So yes, in that case both would be used.

I am not sure parsing hat.conf is the way to solve this though, that file just defines actions.   Instead we might need a separate way to manage GPIO.   Right now, pypilot_hat just grabs certain gpio and assumes it has the right to use them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)