iomari Posted March 23, 2019 Posted March 23, 2019 Greetings, I have installed your wiringpi-python on our Nano Pi M4 as instructed on http://wiki.friendlyarm.com/wiki/index.php/WiringPi-Python_for_RK3399. All went well with the installation. However, when trying to execute wpi.wiringPiSetup(), I get the following error: Oops: Unable to determine board revision from /proc/cpuinfo -> No "Hardware" line -> You'd best google the error to find out why. This is strange because there is no "Hardware" line in proc/cpuinfo on any Linux system in our organization. Can you please explain what is the way forward. Or is there a python 3 alternative to wiringpi that is as detailed? Or is there an update to WiringPi-Python for the Nano Pi M4 running rk3399-eflasher-friendlydesktop-bionic-4.4-arm64-20190308.img We are at a standstill due to this as you must be aware that without "wiringPiSetup()" working, the whole wiringpi-python library is useless. Thanks in advance iomari
pavelectric Posted March 23, 2019 Posted March 23, 2019 It's simple, look here - https://github.com/Pavelectric/WiringPi_M4 And here are modest experiments - https://github.com/Pavelectric/Python_GPIO
iomari Posted March 23, 2019 Author Posted March 23, 2019 Thanks but I have already done all all of that. The error I posted above is after successfully installing WiringPi.
pavelectric Posted March 23, 2019 Posted March 23, 2019 44 minutes ago, iomari said: Thanks but I have already done all all of that. The error I posted above is after successfully installing WiringPi. Read again the sequence of actions ... Perhaps you will see that you first need to put just WirinPi, and only then WirinPi for Python ...
iomari Posted March 25, 2019 Author Posted March 25, 2019 pavelectric, I appreciate your help. However I have both the python and C versions installed. The C version works but I want to use python for this project. additionally, I don't see where WiringPi must be installed at all if using python let alone before. the WiringPi-Python page clearly states: 1 Introduction to WiringPi for Python The wiringPi for Python utility is an implementation of wiringPi in Python. It can be used in Python programs to access hardware such as GPIO/I2C/SPI/UART/PWM etc. It is a popular and powerful utility. FriendlyELEC has ported the wiringPi for Python utility for all existing FriendlyELEC-RK3399 based boards: NanoPi M4, NanoPi NEO4 and NanoPC-T4. Current version: 2.44 WiringPi's home page: http://wiringpi.comThere is a C version too and here is the reference link: WiringPi for RK3399 Notice the red highlight. It does not say it is a requirement. But regardless, I installed it anyway for test purposes. Thanks iomari
chwe Posted March 25, 2019 Posted March 25, 2019 On 3/23/2019 at 2:31 PM, iomari said: I have installed your wiringpi-python on our Nano Pi M4 as instructed on http://wiki.friendlyarm.com/wiki/index.php/WiringPi-Python_for_RK3399. no it's friendly elecs... Whereas Armbian is independent from board-makers and Armbian isn't marked as supported image (http://wiki.friendlyarm.com/wiki/index.php/WiringPi-Python_for_RK3399#Supported_OS). Nevertheless, I don't see much a reason why it shouldn't work on Armbian as well. Unfortunately there's not the whole source code available from their page.. Likely that some board detection mechanism doesn't. Just compare cat /proc/cpuinfo from an armbian image with a friendly arm image to see if there's a difference.. Or ask them if they can provide the sourcecode of their lib.. to see what kind of information there is needed. It looks like some 32bit 64bit issue which wiringPi has..
iomari Posted March 25, 2019 Author Posted March 25, 2019 Yes, I've already contacted them but no reply yet. I'll take your advice and compare the code. Thanks for the tip..
pavelectric Posted March 25, 2019 Posted March 25, 2019 4 hours ago, iomari said: iomari, Run the gpio readall command and tell about its output. I don't see much a reason why it shouldn't work on Armbian as well. - On Armbian, it works at the moment.
pavelectric Posted March 25, 2019 Posted March 25, 2019 1 minute ago, iomari said: https://pastebin.com/MF8SePMx It means that you have completed part 1 correctly. Install further on the recommendation of the manufacturer or my instructions. I reinstalled various versions from Armbian and FriendlyCore about 5 times, everything always worked (regarding access to GPIO through Python) the first time.
pavelectric Posted March 25, 2019 Posted March 25, 2019 6 minutes ago, iomari said: are you using a nano pi m4? You have created the theme "Nano Pi M4 wiringPiSetup () not working", I answered you in it. The link to my GitHub refers to the M4 board. And to answer your question .... I do not even know how ...
iomari Posted March 25, 2019 Author Posted March 25, 2019 I've followed your instructions to the letter. I'm not new to this. And while I appreciate all your efforts, that python function still does not work. I even tried it using python 2 but the result is the same. I've emailed the vendor many times and they have not replied yet other than to ask me which image am I using which I replied last week. I guess I'll just have to use C. Really a shame. This changes the whole scope of my project.
pavelectric Posted March 25, 2019 Posted March 25, 2019 Just now, iomari said: I've followed your instructions to the letter. I'm not new to this. And while I appreciate all your efforts, that python function still does not work. I even tried it using python 2 but the result is the same. I've emailed the vendor many times and they have not replied yet other than to ask me which image am I using which I replied last week. I guess I'll just have to use C. Really a shame. This changes the whole scope of my project. Do not quit started job! It worked for me - it means it will work for you. Check that these components are installed "python-dev, python-setuptools, python3-dev, python3-setuptools, swig"
iomari Posted March 25, 2019 Author Posted March 25, 2019 OK, I'll recheck everything again ...................
iomari Posted March 25, 2019 Author Posted March 25, 2019 Building dependency tree... Reading state information... python-dev is already the newest version (2.7.15~rc1-1). python-setuptools is already the newest version (39.0.1-2). python3-setuptools is already the newest version (39.0.1-2). swig is already the newest version (3.0.12-1). git is already the newest version (1:2.17.1-1ubuntu0.4). python3-dev is already the newest version (3.6.7-1~18.04). The following packages were automatically installed and are no longer required: python3-decorator python3-ipython-genutils python3-pexpect python3-pickleshare python3-prompt-toolkit python3-ptyprocess python3-pygments python3-simplegeneric python3-traitlets python3-wcwidth Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
iomari Posted March 25, 2019 Author Posted March 25, 2019 [iomari@NanoPi-M4]─[~/code/setuptools-33.1.1]─[0]─[5291]-[][:)][Mon,Mar 25, 2019 05:32:45 pm] --> sudo easy_install wiringpi-2.44.4-py3.6-linux-aarch64.egg Processing wiringpi-2.44.4-py3.6-linux-aarch64.egg removing '/usr/local/lib/python3.6/dist-packages/wiringpi-2.44.4-py3.6-linux-aarch64.egg' (and everything under it) creating /usr/local/lib/python3.6/dist-packages/wiringpi-2.44.4-py3.6-linux-aarch64.egg Extracting wiringpi-2.44.4-py3.6-linux-aarch64.egg to /usr/local/lib/python3.6/dist-packages wiringpi 2.44.4 is already the active version in easy-install.pth --> ipython3 Python 3.6.7 (default, Oct 22 2018, 11:32:17) Type 'copyright', 'credits' or 'license' for more information IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import wiringpi as wpi In [2]: wpi.wiringPiSetup() Oops: Unable to determine board revision from /proc/cpuinfo -> No "Hardware" line -> You'd best google the error to find out why.
pavelectric Posted March 25, 2019 Posted March 25, 2019 38 minutes ago, iomari said: --> sudo easy_install wiringpi-2.44.4-py3.6-linux-aarch64.egg And if you try Python 2? sudo easy_install-2.7 wiringpi-2.44.4-py2.7-linux-aarch64.egg
iomari Posted March 25, 2019 Author Posted March 25, 2019 It works as python 2 now. Thanks for your patience. Now if only I can't figure out the problem with python 3.......
pavelectric Posted March 25, 2019 Posted March 25, 2019 10 minutes ago, iomari said: It works as python 2 now. Thanks for your patience. Now if only I can't figure out the problem with python 3....... The main result is obtained. The rest is a matter of refinement and customization. Successful experiments and decent results. And do not forget to share your results, it is very interesting. And if there are photos - it is generally gorgeous!
Marko Buršič Posted November 20, 2019 Posted November 20, 2019 @pavelectric Why there is no source code of your project? I would like to patch it to work with RockPi 4. Also Friendlyelec is hiding the code, but do not forget that original WiringPi was written by Gordon, open source, so also your forks and Friedlyelec's forks should be open source.
Recommended Posts