OnionGpio for Python3
New user, and apologies if this question has been asked before (must have been).
Python3 has been out for years, and there's no reason anyone should use Python2... and yet... I've installed python3-light but struggle to find a Python3 version of the Onion basic package for controlling gpio ? Don't want a Python2 version, when I'm using Python3. Could someone help me please ? Got some technical knowledge but not a lot, and get annoyed when I go through Omega documentation and find numerous inconsistencies and non-working code...
Douglas Kryder last edited by
@Neil-Stelling if i remember correctly you need to uncomment some of the repos in the /etc/opkg/distfeeds.conf repo file. maybe one of the lede repos but you might search on it.
@Neil-Stelling is there any update on how to get GPIO to work for python3?
I have solved this problem.
See please for this repository https://github.com/OnionIoT/onion-gpio-sysfs/tree/master/python
You need the onionGpio.py file. But this file for Python2.x version. You must change all code line like "print xxxxxx" for "print(xxxxxx)". For example: "print 'GPIO%d path: %s'%(self.gpio, self.path)" change to "print ('GPIO%d path: %s'%(self.gpio, self.path))".
After that put this file to your project (or in Python PATH) and use it according to the instruction: