OpenMarine
GPIO pins not working on tinypilot - 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: GPIO pins not working on tinypilot (/showthread.php?tid=4725)



GPIO pins not working on tinypilot - oilybilge - 2023-06-28

Firstly, a massive shout-out to Sean, Ironman, Stelian, and many others on this site, thanks to whom I'm now the proud owner of a working tinypilot. I gave it a trial run yesterday on my boat and it worked brilliantly. Given that the last time I did anything like this I was ten years old and silicon chips had barely been invented I'm quite pleased.

I'm using Stelian's image of the tinypilot on a Pi zero W, and an H-bridge motor controller based on Sean's plan. At the moment I'm using my iPhone to control it, but I'd like to hardwire some push switches to the Zero for basic controls. However nothing happens when I ground the relevant pins. I've followed this advice from Ironman:

To enable the module, type sudo systemctl enable pypilot_hat and sudo systemctl start pypilot_hat (on the tinypilot distribution, replace systemctl with sv)

... but it makes no difference and I'm not even sure I'm doing the right thing. Could anyone help me out?

Cheers!


RE: GPIO pins not working on tinypilot - stelian - 2023-06-28

Hi oilybilge,

What hardware are you using ? The tinypilot hat from Sean or you custom board ?

Since you say you're running tinypilot, you shouldn't have the start pypilot_hat, it should be started automatically. Do you have the output on the LCD screen (if yes, this confirms the pypilot_hat is working correctly).


RE: GPIO pins not working on tinypilot - oilybilge - 2023-06-28

Hi Stelian. Oh dear, there's no hardware at all except for the Pi. I was assuming I could just use the designated pins as inputs. I'm guessing not?

As I'm trying to keep this system as barebones as possible -- basically point and shoot -- what would be the easiest way to get this function?

Thanks again for your image of tinypilot BTW


RE: GPIO pins not working on tinypilot - stelian - 2023-06-28

You do have an IMU at least, right ?

As for the gpio, yes you should be able to use the rpi pins directly.

Try the followlng, this will maybe show some error in the initialisation:

$ sudo sv stop pypilot_hat
$ sudo pypilot_hat

And post here the startup logs.


RE: GPIO pins not working on tinypilot - oilybilge - 2023-06-28

Ha ha, yes, sorry, I do have an IMU.  Tongue

Thanks, I'll give that a go when I'm on my boat tomorrow and report back.


RE: GPIO pins not working on tinypilot - ironman - 2023-06-29

(2023-06-28, 02:52 PM)oilybilge Wrote: Firstly, a massive shout-out to Sean, Ironman, Stelian, and many others on this site, thanks to whom I'm now the proud owner of a working tinypilot. I gave it a trial run yesterday on my boat and it worked brilliantly. Given that the last time I did anything like this I was ten years old and silicon chips had barely been invented I'm quite pleased.

I'm using Stelian's image of the tinypilot on a Pi zero W, and an H-bridge motor controller based on Sean's plan. At the moment I'm using my iPhone to control it, but I'd like to hardwire some push switches to the Zero for basic controls. However nothing happens when I ground the relevant pins. I've followed this advice from Ironman:

To enable the module, type sudo systemctl enable pypilot_hat and sudo systemctl start pypilot_hat (on the tinypilot distribution, replace systemctl with sv)

... but it makes no difference and I'm not even sure I'm doing the right thing. Could anyone help me out?

Cheers!

Did you use the web interface at :33333 to reconfigure the keys? https://github.com/pypilot/workbook/wiki/Step-5-The-HAT-interface:

Open the web interface, hit a key (in my test, I shorted GPIO26 to ground). You should see this happen in the interface. Then, within a few seconds, click one of the actions (in my test, I clicked 'engage'). From then on, shorting GPIO26 to ground engages the autopilot.

The original key mappings refer to the hardware hat and don't work without the hardware hat present. You have to reconfigure them. I've added this comment to the workbook.


RE: GPIO pins not working on tinypilot - oilybilge - 2023-07-14

Apologies for the late reply. I b****** up my back while pulling up the anchor and was laid up ashore for a fortnight. Time to get a windlass I think.

Anyway, thanks Ironman, you were spot on. I'd entirely missed the part about configuring the keys. It was as basic as that. Cheers!