Hello. I am using the NanoPi NEO Core board with the Mini Shield for NanoPi NEO Core/Core2.
I am trying to configure some GPIOs using the RPI.GPIO_NP library and Python 3.7.7. This is the code I am using:
I've also run the script with sudo (e.g., sudo python3 gpio.py).
The problem is that GPIOs 35, 64 and 66 give ValueErrors, and GPIO 7 does not allow to configure a GPIO detect event. Does anybody know what is the problem?
This is the output of the gpio readall command of the WiringNP library:
I am trying to configure some GPIOs using the RPI.GPIO_NP library and Python 3.7.7. This is the code I am using:
Code: Select all
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.IN) # Does not allow adding a GPIO detect event using GPIO.add_event_detect() - it returns RuntimeError: Failed to add edge detection
GPIO.setup(13, GPIO.OUT)
GPIO.setup(15, GPIO.OUT)
GPIO.setup(19, GPIO.IN)
GPIO.setup(21, GPIO.IN)
GPIO.setup(23, GPIO.IN)
GPIO.setup(35, GPIO.IN) # ValueError: The channel sent is invalid on a NanoPi
GPIO.setup(37, GPIO.IN)
GPIO.setup(12, GPIO.IN)
GPIO.setup(16, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
GPIO.setup(24, GPIO.IN)
GPIO.setup(62, GPIO.OUT)
GPIO.setup(64, GPIO.OUT) # ValueError: The channel sent is invalid on a NanoPi
GPIO.setup(66, GPIO.OUT) # ValueError: The channel sent is invalid on a NanoPi
GPIO.setup(26, GPIO.OUT)
GPIO.setup(28, GPIO.OUT)
GPIO.setup(32, GPIO.OUT)
GPIO.setup(30, GPIO.OUT)
GPIO.cleanup()
I've also run the script with sudo (e.g., sudo python3 gpio.py).
The problem is that GPIOs 35, 64 and 66 give ValueErrors, and GPIO 7 does not allow to configure a GPIO detect event. Does anybody know what is the problem?
This is the output of the gpio readall command of the WiringNP library:
Code: Select all
+-----+-----+----------+------+---+-NanoPi-NEO-Core--+------+----------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 12 | 8 | GPIOA12 | ALT5 | 0 | 3 || 4 | | | 5v | | |
| 11 | 9 | GPIOA11 | ALT5 | 0 | 5 || 6 | | | 0v | | |
| 203 | 7 | GPIOG11 | OFF | 0 | 7 || 8 | 0 | ALT5 | GPIOG6 | 15 | 198 |
| | | 0v | | | 9 || 10 | 0 | ALT5 | GPIOG7 | 16 | 199 |
| 0 | 0 | GPIOA0 | ALT5 | 0 | 11 || 12 | 0 | OUT | GPIOA6 | 1 | 6 |
| 2 | 2 | GPIOA2 | OFF | 0 | 13 || 14 | | | 0v | | |
| 3 | 3 | GPIOA3 | OFF | 0 | 15 || 16 | 0 | OFF | GPIOG8 | 4 | 200 |
| | | 3.3v | | | 17 || 18 | 0 | OFF | GPIOG9 | 5 | 201 |
| 64 | 12 | GPIOC0 | ALT4 | 0 | 19 || 20 | | | 0v | | |
| 65 | 13 | GPIOC1 | ALT4 | 0 | 21 || 22 | 0 | ALT5 | GPIOA1 | 6 | 1 |
| 66 | 14 | GPIOC2 | ALT4 | 0 | 23 || 24 | 1 | OUT | GPIOC3 | 10 | 67 |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+----------+------+---+-NanoPi-NEO-Core--+------+----------+-----+-----+
+-----+-----+----------+---- NanoPi-NEO-Core USB/Audio ----+----------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| | | 5v | | | 25 || 26 | 0 | ALT4 | GPIOA15 | 22 | 15 |
| | | USB1 | | | 27 || 28 | 0 | ALT4 | GPIOA16 | 23 | 16 |
| | | USB1 | | | 29 || 30 | 0 | ALT4 | GPIOA14 | 21 | 14 |
| | | USB2 | | | 31 || 32 | 0 | ALT4 | GPIOA13 | 20 | 13 |
| | | USB2 | | | 33 || 34 | | | Mic | | |
| | | IR | | | 35 || 36 | | | Mic | | |
| 17 | 19 | GPIOA17 | OFF | 0 | 37 || 38 | | | Audio | | |
| | | I2S | | | 39 || 40 | | | Audio | | |
| | | I2S | | | 41 || 42 | 0 | ALT5 | GPIOA5 | 18 | 5 |
| | | I2S | | | 43 || 44 | 0 | ALT5 | GPIOA4 | 17 | 4 |
| | | I2S | | | 45 || 46 | | | 5V | | |
| | | 0v | | | 47 || 48 | | | 0v | | |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+----------+------+---+-NanoPi-NEO-Core--+------+----------+-----+-----+
+-----+-----+----------+---- NanoPi-NEO-Core Network ----+----------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| | | Eth | | | 49 || 50 | | | Eth | | |
| | | Eth | | | 51 || 52 | | | Eth | | |
| | | Eth | | | 53 || 54 | | | Eth | | |
| | | NC | | | 55 || 56 | | | NC | | |
| | | NC | | | 57 || 58 | | | NC | | |
| | | 0v | | | 59 || 60 | | | 0v | | |
| | | USB3 | | | 61 || 62 | 0 | OFF | GPIOA7 | 24 | 7 |
| | | USB3 | | | 63 || 64 | | | GPIOE12 | | |
| | | 5v | | | 65 || 66 | | | GPIOE13 | | |
| | | 5v | | | 67 || 68 | | | 3.3v | | |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+----------+------+---+-NanoPi-NEO-Core--+------+----------+-----+-----+