AmedeeBulle / pyrak811

RAK811 Python 3 library for Raspberry Pi
Apache License 2.0
50 stars 25 forks source link

Add GPIO Commands #7

Closed ryanteck closed 2 years ago

ryanteck commented 4 years ago

We've had a request to add in the commands for the GPIO Pins. As I've been working on these for the micro:bit recently I'll work on this after TTN Conf

ryanteck commented 4 years ago

Functions are: Write to GPIO Pin Read from GPIO Pin (Digital) Read from GPIO Pin (Analogue)

panban-ux commented 3 years ago

I was thinking can we trigger raspberry pi 4 GPIO's , lets say 5&6 to force a shutdown in this pHat under a downlink command? I'm using old firmware by the way

ryanteck commented 3 years ago

@panban-ux do you mean use the GPIOs on the HAT to then trigger a shutdown of the Raspberry Pi?

I don't think that would be possible.

panban-ux commented 3 years ago

Yes that's what i mean, using a specific downlink to the pHat. Arent GPIO's used as inputs/outputs. I mean a way to trigger a high or low?

panban-ux commented 3 years ago

Regarding my last post, Does a down link from TTN serves any purpose for this particular HAT? Lets say trigger a script on the Rpi Im using the V2 firmware.

AmedeeBulle commented 3 years ago

The GPIOs are of little use, the only thing you can do is set or query the state of the pin from the RPi.

They basically add a few GPIO pins to the Pi, without the flexibility of the native GPIO ports (you can't trigger events on state change, you have to poll).

I have implemented the GPIO interface for the V3 firmware if you are desperate to use these pins, but as I said usability is questionable...

AmedeeBulle commented 2 years ago

Closing this issue, GPIO is supported with the V3 firmware for the RAK811 module; won't backport to V2.