Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 6212|Reply: 8

GPIO not working on OrangePi Win Plus with Python

[Copy link]

1

Threads

5

Posts

34

Credits

Novice

Rank: 1

Credits
34
Post time 2018-4-13 02:56:43 | Show all posts |Read mode
Edited by nishant at 2018-4-13 02:59

Hello every one I'm new to this site and I have recently purchased an Orange Pi Win Plus but got a lot of issues in configuring it.
I'm now able to blink LED through Shell and C with WiringPi but I couldn't find any working Python 3 based Library for GPIO.

I installed WiringPi from : https://github.com/OrangePiLibra/WiringPi

This actually helped me to access GPIO through C/C++ and Shell but I couldn't find any thing for Python that's working.

I came accross a new Python Library : "pyA64" but its not working. Also, the library "OPi.GPIO" doesn't supports my Board.
I also tried this : https://github.com/lanefu/WiringPi-Python-OP
but that's makes my "gpio" command to stop functioning.

I need help!!
Does anyone knows how to access GPIO on Orange Pi Win Plus through Python ?


10

Threads

221

Posts

2040

Credits

Gold member

Rank: 6Rank: 6

Credits
2040
Post time 2018-4-18 07:54:10 | Show all posts
Edited by nopnop2002 at 2018-4-18 07:57
nishant replied at 2018-4-17 23:39
Even that didn't worked on mine. This is my output :
>>> from periphery import GPIO
>>> gpio_out = ...

sudo sh -c "echo 227 >/sys/class/gpio/export"


Is there /sys/class/gpio/gpio227 ??



10

Threads

221

Posts

2040

Credits

Gold member

Rank: 6Rank: 6

Credits
2040
Post time 2018-4-14 04:10:14 | Show all posts
Edited by nopnop2002 at 2018-4-14 08:27
nishant replied at 2018-4-14 03:47
This is my GPIO configuration on OrangePi Win Plus :

$ gpio readall

BCM is GPIO#.

  1. from periphery import GPIO

  2. gpio_out = GPIO(227, "out")

  3. gpio_out.write(1)

  4. gpio_out.close
Copy the Code


Pin#3 is set as 1.

10

Threads

221

Posts

2040

Credits

Gold member

Rank: 6Rank: 6

Credits
2040
Post time 2018-4-13 21:31:28 | Show all posts
Edited by nopnop2002 at 2018-4-13 21:57

If you know /sys/class/gpio allocation about Orange Pi Win Plus, try this.

https://github.com/vsergeev/python-periphery


  1. from periphery import GPIO

  2. gpio_out = GPIO(12, "out")

  3. gpio_out.write(1)

  4. gpio_out.close()
Copy the Code



/sys/class/gpio/gpio12 set to 1.

I don't know /sys/class/gpio allocation about Orange Pi Win Plus.




1

Threads

5

Posts

34

Credits

Novice

Rank: 1

Credits
34
 Author| Post time 2018-4-14 03:40:08 | Show all posts
nopnop2002 replied at 2018-4-13 21:31
If you know /sys/class/gpio allocation about Orange Pi Win Plus, try this.

https://github.com/vserg ...

That's not working at all I'm getting below error:

>>> from periphery import GPIO
>>> gpio_out = GPIO(1, "out")
OSError: [Errno 517] Unknown error 517

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/periphery/gpio.py", line 89, in _open
    f_direction.write(direction + "\n")
OSError: [Errno 517] Unknown error 517

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/periphery/gpio.py", line 43, in __init__
    self._open(pin, direction)
  File "/usr/local/lib/python3.5/dist-packages/periphery/gpio.py", line 91, in _open
    raise GPIOError(e.errno, "Setting GPIO direction: " + e.strerror)
periphery.gpio.GPIOError: [Errno 517] Setting GPIO direction: Unknown error 517
>>>

1

Threads

5

Posts

34

Credits

Novice

Rank: 1

Credits
34
 Author| Post time 2018-4-14 03:47:45 | Show all posts
This is my GPIO configuration on OrangePi Win Plus :

$ gpio readall

+-----+-----+----------+------+---+-Orange Pi Win/Win+ +---+---+------+---------+-----+--+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
|     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
| 227 |   8 |    SDA.1 |   IN | 0 |  3 || 4  |   |      | 5V       |     |     |
| 226 |   9 |    SCL.1 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
| 362 |   7 |   GPIO.7 |   IN | 0 |  7 || 8  | 0 | OUT  | S_TX     | 15  | 354 |
|     |     |       0v |      |   |  9 || 10 | 1 | OUT  | S_RX     | 16  | 355 |
| 229 |   0 |     RxD3 |   IN | 0 | 11 || 12 | 0 | OUT  | GPIO.1   | 1   | 100 |
| 228 |   2 |     TxD3 |   IN | 0 | 13 || 14 |   |      | 0v       |     |     |
| 231 |   3 |     CTS3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO.4   | 4   | 361 |
|     |     |     3.3v |      |   | 17 || 18 | 0 | IN   | GPIO.5   | 5   | 68  |
|  98 |  12 |     MOSI |   IN | 0 | 19 || 20 |   |      | 0v       |     |     |
|  99 |  13 |     MISO |   IN | 0 | 21 || 22 | 0 | IN   | RTS3     | 6   | 230 |
|  97 |  14 |     SCLK |   IN | 0 | 23 || 24 | 0 | IN   | CE0      | 10  | 96  |
|     |     |       0v |      |   | 25 || 26 | 0 | IN   | GPIO.11  | 11  | 102 |
| 143 |  30 |    SDA.2 |   IN | 0 | 27 || 28 | 0 | IN   | SCL.2    | 31  | 142 |
|  36 |  21 |  GPIO.21 |   IN | 0 | 29 || 30 |   |      | 0v       |     |     |
|  37 |  22 |  GPIO.22 |   IN | 0 | 31 || 32 | 0 | IN   | RTS2     | 26  | 34  |
|  38 |  23 |  GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v       |     |     |
|  39 |  24 |  GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | CTS2     | 27  | 35  |
| 101 |  25 |  GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | TxD2     | 28  | 32  |
|     |     |       0v |      |   | 39 || 40 | 0 | IN   | RxD2     | 29  | 33  |
+-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
| BCM | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | BCM |
+-----+-----+----------+------+---+-Orange Pi Win/Win+ +---+------+----------+-----+-----+

1

Threads

5

Posts

34

Credits

Novice

Rank: 1

Credits
34
 Author| Post time 2018-4-17 23:39:59 | Show all posts

Even that didn't worked on mine. This is my output :
>>> from periphery import GPIO
>>> gpio_out = GPIO(227, "out")
>>> gpio_out.write(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/periphery/gpio.py", line 144, in write
    raise TypeError("Invalid value type, should be bool.")
TypeError: Invalid value type, should be bool.
>>>
>>>
>>>
>>> gpio_out.write(true)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'true' is not defined
>>> gpio_out.close
<bound method GPIO.close of <periphery.gpio.GPIO object at 0x7fa7657908>>
>>>


So I'm sill stuck !!


10

Threads

221

Posts

2040

Credits

Gold member

Rank: 6Rank: 6

Credits
2040
Post time 2018-4-22 09:27:30 | Show all posts
nishant replied at 2018-4-17 23:39
Even that didn't worked on mine. This is my output :
>>> from periphery import GPIO
>>> gpio_out = ...

sudo sh -c "echo 227 >/sys/class/gpio/export"


Is there /sys/class/gpio/gpio227 ??
Post time 2021-11-12 23:39:50 | Show all posts

Useful Iso Accreditation Details

To the people inquiring about iso 27000 family of standards ppt, iso 13485 training courses, iso 45001 lead auditor course pdf, information technology services management (itsm) corp, what is the difference between en iso 13485 and iso 13485, iso 8601 date example java, guidelines for auditing process safety management systems 2nd edition,  I highly suggest this EN 14585-1:2006-Corrugated metal hose assemblies for pressure applications-Part 1: Requirements updated ISO standards details as well as iso 13485 overview pdf, iso 27001 lead auditor practice exam, iso 27001 lead auditor course, iso 27000 series framework, what is iso quality standards, iso 27002 download, iso 8601 date format java 8,  look at this SIST ETS 300 708 E1:2003-Television systems; Data transmission within Teletext awesome ISO accreditation details and don't forget iso 14001 pdf arabic, iso 27002 download free, iso 27001 pdf 2013, what is iso quality standards, iso 9001 pdf francais, tl 9000 vs iso 9001, iso 27001 lead auditor salary,  try this EN 60695-4:2012-Fire hazard testing-Part 4: Terminology concerning fire tests for electrotechnical products best ISO converter site for cybersecurity companies india, iso 9001 standards list, iso 27701 checklist pdf, iso 8601 date format javascript, iso 31000 pdf français gratuit, iso 31000 pdf romana, iso 14000 quality standard is related with mcq,  Also don't forget this IEC 61850-7-1:2011/AMD1:2020-Amendment 1-Communication networks and systems for power utility automation-Part 7-1: Basic communication structure-Principles and models cool ISO standards site alongside all cyber security jobs manchester, cybersecurity training for beginners, iso 14000 standards, iso 14001 pdf arabic, cybersecurity companies singapore, information technology service management (itsm) frameworks and methodologies, army information technology service management (itsm) policy,  look at this EN 1254-1:2021-Copper and copper alloys-Plumbing fittings-Part 1: Capillary fittings for soldering or brazing to copper tubes best ISO converter advice for cyber security jobs leeds, cyber security jobs near me, cybersecurity companies,  alongside all this SIST EN 14254:2005-In vitro diagnostic medical devices-Single-use receptacles for the collection of specimens, other than blood, from humans top rated ISO certification tips as well as iso 27001 lead auditor certification cost, iso 31000 pdf, iso 9001 certification bodies, iso 27002 pdf 2019, cybersecurity training certification, iso 13485 summary, cybersecurity news 2021,  look at this SIST ETS 300 061-1 E1:2005-Integrated Services Digital Network (ISDN); Subaddressing (SUB) supplementary service; Digital Subscriber Signalling System No. one (DSS1) protocol; Part 1: Protocol specification recommended ISO requirements details as well as iso 27001 lead auditor book, iso 27002 download free, iso 27001 standard free download, iso 8601 date format java 8, iso 14001 pdf romana, cybersecurity training near me, iso 27001 standard ensures that,  try this ISO 14411-2:2020-Preparation of particulate reference materials high rated ISO certification tips for iso 13485 overview ppt, cybersecurity companies london, iso 27001 standard ensures that, iso 27701 training in india, information technology service management (itsm) software tool, iso 9001 certification process, iso 45001 lead auditor course uk,  Also don't forget this ISO 12260:2016-Aerospace Screws, pan head, internal offset cruciform ribbed or unribbed drive, stepped shank, short or medium length MJ threads, metallic material, coated or uncoated, strength classes less than or equal to 1 100 MPa Dimensions updated ISO accreditation advice and don't forget iso 8601 date format java localdatetime, iso 9000 pdf 2020, iso 27000 pdf español 2017, iso 13485 overview presentation, iso 27001 lead auditor online training, iso 9001 standard pdf, iso 90001 requirements,  look at this SIST EN 60512-2-6:2003-Connectors for electronic equipment-Tests and measurements Part 2-6: Electrical continuity and contact resistance tests-Test 2f: Housing (shell) electrical continuity great ISO download advice for guidelines for auditing process safety management systems 2nd edition pdf, iso 13485 summary, iso 90003 pdf, See More High Rated Massage News 6ea4c54
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2022-1-27 17:30 GMT+8 , Processed in 0.039471 second(s), 23 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list