duino Posted February 9, 2016 Posted February 9, 2016 Hi, totally new at this but here goes. I have been working on a IoT project involving the pcDuino and have been having issues with the image supplied by linksprite and WiFi drivers etc. I came across armbian, noticed the pcduino wheezy image and downloaded, installed all good and very impressed. I then went to run my python scripts to test gpio ports and sensors but received the following error: File "/home/iotadmin/gpio/__init__.py", line 43, in pinMode with open(_MODE_FD_PATH % id, 'w') as f: IOError: [Errno 2] No such file or directory: '/sys/devices/virtual/misc/gpio/mode/gpio1' I assume that the device mapping is different? I would appreciate a pointer to any documentation that will help solve this issue.
Igor Posted February 9, 2016 Posted February 9, 2016 Can you point out exactly which image / kernel have you used and which pcDuino do you have? Generic info / help you can find here: http://linux-sunxi.org/GPIO
duino Posted February 9, 2016 Author Posted February 9, 2016 Image was downloaded from http://www.armbian.com/pcduino3/and was wheezy vanilla. I have a pcDuino3b which according to linksprite is the same image as the pcDuino Nano
Igor Posted February 9, 2016 Posted February 9, 2016 GPIOs are accessible by default but the numbers are different than on old kernel. Check the link in my post before with title: "Accessing the GPIO pins through sysfs with mainline kernel" If you are using some interface like python, than you need to check how that lib was made. ... you can skip all the trouble if you use old / legacy kernel.
duino Posted February 9, 2016 Author Posted February 9, 2016 Thanks for the info. I have downloaded Legacy wheezy and whilst the directory path /sys/devices/virtual/misc/ exists it has no gpis subdir so I am getting the same error. So I take it I have 2 options... 1) check if there is source for the gpio linksprite python libs or 2) Try and work out "Accessing the GPIO pins through sysfs with mainline kernel" ​I think option 2 may be out of my league.
duino Posted February 9, 2016 Author Posted February 9, 2016 Just an update. I have managed to get the GPIO mapping working from your supplied link so thanks for that! There does not appear to be and Analog input support, is that correct? /proc/adc1 for example
zador.blood.stained Posted February 9, 2016 Posted February 9, 2016 There does not appear to be and Analog input support, is that correct? /proc/adc1 for example Only tablet buttons attached to LRADC inputs are supported in mainline kernel, there is no driver that can provide actual ADC value, as far as I see. * Allwinnner sunxi SoCs have a lradc which is specifically designed to have * various (tablet) keys (ie home, back, search, etc). attached to it using * a resistor network. This driver is for the keys on such boards. * * There are 2 channels, currently this driver only supports channel 0 since * there are no boards known to use channel 1.
JohnGO Posted February 24, 2016 Posted February 24, 2016 Cmd for gpio cd /sys/class/gpio echo X > export echo out > gpioX/direction echo 1 > gpioX/value 1
atula Posted September 23, 2017 Posted September 23, 2017 pcduino3 nano Armbian_5.31_Pcduino3nano_Debian_jessie_next_4.11.5.img cat /proc/adc2 work in ubuntu how i do in armbian? .......heaven just knows
Recommended Posts