Skip to content

invalid GPIO pin specified for upboard with ubuntu16.04 and python #685

@Sterben1111

Description

@Sterben1111

when i tried to run a test program in up wiki to test the board, it told me that " ValueError: Invalid GPIO pin specified"

I don't know what happened, so i think i need some help

error:
Traceback (most recent call last):
  File "light.py", line 11, in <module>
    pin = mraa.Gpio(pin_no,owner=False,raw=True)
  File "/usr/lib/python2.7/dist-packages/mraa.py", line 1122, in __init__
    this = _mraa.new_Gpio(pin, owner, raw)
ValueError: Invalid GPIO pin specified

and the code:

#!/usr/bin/python

import sys
import mraa
import time

# Use pin 7 by default
pin_no = 13

# Export the GPIO pin for use
pin = mraa.Gpio(pin_no,owner=False,raw=True)

# Small delay to allow udev rules to execute (necessary only on up)
time.sleep(0.1)

# Configure the pin direction
pin.dir(mraa.DIR_OUT)

# Loop
while True:
    # Turn the LED on and wait for 0.5 seconds
    pin.write(1)
    time.sleep(0.5)
    # Turn the LED off and wait for 0.5 seconds
    pin.write(0)
    time.sleep(0.5)

Besides, there is the GPIO list:

ls /sys/class/gpio/
export       gpiochip228  gpiochip341  unexport
gpiochip225  gpiochip314  gpiochip414

And I also can not export more new pin in the folder, which confused me a lot and i think it may relate to my question.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions