Jump to content

Recommended Posts

Posted

I'm trying to access GPIO through python using the following library: https://github.com/duxingkei33/orangepi_PC_gpio_pyH3

 

Online guides say that for OPi One this should be a plug and play solution. However, for me, the pins dont seem to be mapping properly, running dir(ports) and dir(connector)

yields the results shown here All the PAx pins are missing, and the results bare no similarity to the actual pin config found here

 

any help appreciated,

 

Andy

Posted

Strange ... Did you changed any thing on that file : https://github.com/duxingkei33/orangepi_PC_gpio_pyH3/blob/master/pyA20/gpio/mapping.h

My output is here :

>>> from pyA20.gpio import gpio
>>> from pyA20.gpio import port
>>> from pyA20.gpio import connector
>>> dir(port)
['PA0', 'PA1', 'PA10', 'PA11', 'PA12', 'PA13', 'PA14', 'PA18', 'PA19', 'PA2', 'PA20', 'PA21', 'PA3', 'PA6', 'PA7', 'PA8', 'PA9', 'PC0', 'PC1', 'PC2', 'PC3', 'PC4', 'PC7', 'PD14', 'PG6', 'PG7', 'PG8', 'PG9', 'POWER_LED', 'STATUS_LED', '__doc__', '__file__', '__name__', '__package__']
>>> dir(connector)
['LEDp1', 'LEDp2', '__doc__', '__file__', '__name__', '__package__', 'gpio1p10', 'gpio1p11', 'gpio1p12', 'gpio1p13', 'gpio1p15', 'gpio1p16', 'gpio1p18', 'gpio1p19', 'gpio1p21', 'gpio1p22', 'gpio1p23', 'gpio1p24', 'gpio1p26', 'gpio1p27', 'gpio1p28', 'gpio1p29', 'gpio1p3', 'gpio1p31', 'gpio1p32', 'gpio1p33', 'gpio1p35', 'gpio1p36', 'gpio1p37', 'gpio1p38', 'gpio1p40', 'gpio1p5', 'gpio1p7', 'gpio1p8']
>>> 

 

Posted

I think the guy made the mapping specific to opi PC, and so he left lot of GPIO not mapped. 

I had trouble with this so in the end I corrected the mapping by adding all the GPIO in the map file.

However it is not mapped with connector module. So you should use the GPIO name (port.c) to call it "PA01" ...

 

Find enclosed my pyH3 folder, see specifically the mapping.h file.

 

Again I filled the connectors randomly (as it's different between each SbC I don't think it should be used anyway) so use port.

pyH3-0.2.12.rar

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines