Python Plugin: Use of GPIO

Python and python framework

Moderator: leecollings

Post Reply
sldewit
Posts: 3
Joined: Sunday 05 November 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Netherlands
Contact:

Python Plugin: Use of GPIO

Post 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.
doncoron
Posts: 4
Joined: Sunday 19 November 2017 11:47
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8775
Location: Bavaria
Contact:

Re: Python Plugin: Use of GPIO

Post by doncoron »

Good morning,

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

best regards
sldewit
Posts: 3
Joined: Sunday 05 November 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Netherlands
Contact:

Re: Python Plugin: Use of GPIO

Post 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
doncoron
Posts: 4
Joined: Sunday 19 November 2017 11:47
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8775
Location: Bavaria
Contact:

Re: Python Plugin: Use of GPIO

Post 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
rockyt
Posts: 5
Joined: Tuesday 12 December 2017 16:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Use of GPIO

Post 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
sldewit
Posts: 3
Joined: Sunday 05 November 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Location: Netherlands
Contact:

Re: Python Plugin: Use of GPIO

Post 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

rockyt
Posts: 5
Joined: Tuesday 12 December 2017 16:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Use of GPIO

Post 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
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest