New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: Trigger GPIOs ON/OFF on AirPi #18
Comments
I think that some users would benefit from that. I will try to see what I can do. I do not think that adding any other triggers than GPIOs would make sense since it would be a very user specific solution. Like execute specific software commands etc. Only one or two users would benefit from it. DroneBridge communication module is open source and it is super easy to add new message definitions. |
Hello Wolfgang! I am searching for the possibility to trigger some generic switching action (ON/OFF) on the AirPi side of things. I agree with you that this should go alongside/independently from whatever RC-control protocol (Mavlink, SUMD, ...) the user has chosen. Is there any way to complement the RC-control protocols with additional channels (must not necessarily be proportional PPM -which is hard to implement on Pi- or be embedded into the RC-protocol itself. Some additional channels with ON/OFF functionality which go alongside -i.e. parallel- with the RC-control stream would be absolutely sufficient). It would be AWESOME if those additional ON/OFF channels could be either interpreted via software (trigger software actions) or drive a GPIO Pin on the AirPi (physical actuators). The possibilities would be endless:
I think Software/GPIO actions should be implemented to be configurable. Lets image we have 4 extra channels now. It would be great if you could specify what effect these channels have. If a physical action is configured (HW) it will simply call a function that drives the respective GPIO accordingly. If a software action is configured (SW) a empty function body (template) is called where the user can add own code, e.g. call shell scripts, start python scripts, execute own executables . This would be ultimately flexible. I agree however that all switches should be configured to drive GPIOs by default. Example:
Can you comprehend what I mean? Sorry I am not a coder... ;-) Keep up the excellent work! |
Yes I think I do. I kind of like the GPIO (HW-switch) idea. That's why I already opened a project to formalize my ideas. The software-switches you mention are already possible. Do not think of them as "channels" that go alongside the RC or telemetry streams. Think of them as messages. The communication module can transport messages of all kind. If a known message is received it does something. What it should do is totally up to the users implementation. So let's say you want to change some setting of a camera connected to your AirPi. To do that you need to execute a command like "mycam -- shuterspeed 500" on the AirPi.
{ "destination": 5,
"type": "mycamshutter",
"speed": 500,
"id": 4321
}
That's it! Now just send your newly defined message via UDP to the communication module and let it do the rest. With just a few lines of code, a user can implement any custom functionality with ease. I might write a wiki page on that in the future. |
@seeul8er : Great!! A wiki page with a very basic example would be very much appreciated. It will help people with minimal coding knowledge - like me! ;-) The only tricky part now seems to be how to trigger that message at the GroundPi with e.g. a flick of a switch on a Taranis. (There are things that can be done by the APP of course but some things need a dedicated hardware switch on the controller ;-) Afaik user dino.de from the RCgroups forum sometime back implemented a function that reads up to 16Ch from a Taranis and writes them to a memory structure at the GroundPi from where it can be interpreted and used for actions (e.g. switch between different OSD screens). |
DroneBridge does this already. The status module e.g. reads the channel values from that structure and sends them to the app. So yes that would be a way of doing it. |
Use communication protocol to trigger GPIO pins on off on AirPi.
The text was updated successfully, but these errors were encountered: