Power & Source of Big Ideas

Running Python code on NanoPI M3

Moderators: chensy, FATechsupport

Hello there!

I've got a brand new NanoPI M3 board with Debian OS. I thought its GPIO is supposed to be Raspberry Pi compatible, but when i try to use the RPi.GPIO Python module i get such an error:

Code: Select all

[20:22][NanoPi3][~] # python -c "import RPi.GPIO;"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!


Is there any chance that i could somehow use RPi.GPIO on my NanoPI, or is there any other Python library to work with M3's GPIO?
The GPIO is not 100% pin to pin identical to RP's. You need to check M3's GPIO pin description and make some changes accordingly.
http://wiki.friendlyarm.com/wiki/index. ... _M3#Layout

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 2865 on Sun Nov 10, 2019 5:27 am

Users browsing this forum: No registered users and 2 guests