Page 1 of 1

Python Plugin: Use of GPIO

Posted: Monday 06 November 2017 21:10
by sldewit
Hello All,

I'm quite new to Python and the Raspberry Pi. I'm currently trying to make my first plugin for domoticz. The intention for this plugin is to access the hardware of the AutomationHAT by Pimoroni from Domoticz(See https://www.google.nl/url?sa=t&rct=j&q= ... GamtVBW9Hc). I already managed to get the sn3218 LED driver to work from a device in Domoticz. I am able to switch it :D. Unfortunatly I'm not yet able to write or read on of the IO points on the AutomationHAT. For that I would normally use RPI.GPIO. But I read somewhere that it does not work in the Plugin Framework. What other way could I use that would fit the framework to write/read GPIO from within a plugin?

I already know that it is possible to access the device using the standard GPIO device. Only there is one big limitation with that. The HAT contains LED's which are driven by a sn3218 LED driver. This will not work by using GPIO.

Please let me know if any of you have any suggestions.

Re: Python Plugin: Use of GPIO

Posted: Monday 27 November 2017 6:51
by doncoron
Good morning,

try to use SysGPIO. It is mauch easier and better to work with yout GPIO.

best regards

Re: Python Plugin: Use of GPIO

Posted: Monday 27 November 2017 15:12
by sldewit
Hello,

I also already thought about doing this, but I was still unable to use the sysGPIO from the plugin framework. Do you have any examples of how I could use it?
I was unable to get the Import function working properly. Probably has to do with my newby status to python programming.

Best regards,

Stephan de Wit

Re: Python Plugin: Use of GPIO

Posted: Tuesday 12 December 2017 16:25
by doncoron
sldewit wrote: Monday 27 November 2017 15:12 Hello,

I also already thought about doing this, but I was still unable to use the sysGPIO from the plugin framework. Do you have any examples of how I could use it?
I was unable to get the Import function working properly. Probably has to do with my newby status to python programming.

Best regards,

Stephan de Wit
Hi,

try ti make an Autostartfile. I made it so and it works fine. You just have to put in which GPIO you want to use. I you have any Problems i can help you.

Best Regards

DonCoron

Re: Python Plugin: Use of GPIO

Posted: Tuesday 06 February 2018 6:45
by rockyt
Hi Stephan
did you manage to develop the plugin for the Pimoroni phat or did you find anything around?
I have just bought a pHat, I need to use relay and digital input but would rather prefer not to write code by myself...
Thanks
Guido

Re: Python Plugin: Use of GPIO

Posted: Sunday 25 February 2018 9:39
by sldewit
rockyt wrote:Hi Stephan
did you manage to develop the plugin for the Pimoroni phat or did you find anything around?
I have just bought a pHat, I need to use relay and digital input but would rather prefer not to write code by myself...
Thanks
Guido
Hi Guido,
Eventually I just used the GPIO. Using a plugin I did manage to update the status leds. However I did not achieve a complete plugin. Update of IO did not work in the plugin framework. If you do find a way I would like to know.

Verstuurd vanaf mijn SM-G930F met Tapatalk


Re: Python Plugin: Use of GPIO

Posted: Monday 26 February 2018 6:29
by rockyt
Hi Stephan
thanks for the reply. Eventually I used the GPIO myself too. Actually I am able to drive the relay and read the digitals input, I do not know how to drive the digital output or the analog input since I do not need it yet sorry
Regards
Guido