|
@greglazor, I'm not sure why you're asking a RaspberryPi question on the OrangePi forum. I actually found your question looking for the answer to this for the OrangePi. Seems like GPIO values and pin outs should be documented on the oPi wiki. But I'm still looking for them, but I haven't spent much time looking yet.
Anyhow I can answer half of your question. The "invalid argument" basically means that the "18" is not a valid value. This can happen for a few reasons:
1. Its not claimed by a driver.
2. Its is in use for some other purpose (like: in active use for SPI, TWI, ...).
3. The driver is rejecting it for some other reason: can't be reconfigured, GPIO isn't available on that pin, ...
My knee-jerk reaction is a missing driver. A module needs loading? If this were a permissions error you would get a more traditional "access denied" error.
First I'd check the /sys/class/gpio/gpiochip* folders to make sure the appropriate driver is loaded. My RaspberryPi 2B has a ".../gpiochip0/label" of "pinctrl-bcm2835". Depending on yours the "BCM" number may vary a little, but I imagine you ought to see the "gpiochip0" folder.
Second I'd check the "base" entry in the correct folder to make sure you have the correct offset, this sometimes changes between driver/kernel versions. On my Orange and Raspberry PIs this is 0. But if not you'll have to add the "base" to your GPIO #. And you also must know what that GPIO number is which usually requires backtracking the connector pin back to the SOC / expander chip and performing a calculation based on the chip's pin number. Seemed like the Raspberry Pi site had that documented fairly well.
And that last bit is what I'm still trying to scrounge up for my oPi Zeros.
Hope this helps |
|