Setting up OrangePi 3 LTS
-
I've recently got my hands on an OrangePi 3 LTS and have been able to get pretty far along the set up process listed in the docs for other boards. I'm having quite a bit of trouble now at the GPIO Stage / running of the duetcontrolserver. I have spent quite a while trying to understand where I'm going wrong, but in all honesty there's only so much a mechanical engineer with access to ChatGPT and very little knowledge about linux can do... I have it hooked up to a duet 3 6hc via the ribbon cable (and I did check that the pinout for the SPI pins is the same.) regardless I keep receiving fatal errors when trying to start up the server because it failed to open the gpio device. can anyone point me in the right direction on how to resolve this error?
(at first I did have the incorrect transfer pin GPIO number and Chip number incorrect, but I believe I have since resolved that.)
P.S.
I am running the Debian 11 flavor downloaded from OrangePi's website -
@Dakota If DCS cannot put that line into event mode, that's usually an indicator that the given pin is either not accessible or it is still allocated by SysFS. You may need to unexport it before DSF can use it (see
/sys/class/gpio
, maybe you can achieve that by sendingecho 2 | sudo tee /sys/class/gpio/unexport
according to https://f1atb.fr/index.php/2022/01/20/orange-pi-gpio/). -
@chrishamm thank you for the reply!
so my specific ability to edit and control the gpio pins is different as orangepi uses a fork of "wiringPi" called "wiringOP". From there I am able to unexport using:
gpio unexport 13 out
I am also able to change the mode and value using:
gpio mode 13 in/out/pwn/clock/up/down/tri gpio write 13 0/1
where I get lost now is I have no idea what mode or value to change it to for DSF to be able to use it...
-
@Dakota There are two sets of utilities for controlling GPIO pins, one is SysFS (which WiringPi and probably WiringOP use AFAIR) and the other one is gpiod (which DSF uses for performance reasons). The pin numbering is different depending on the subsystem used. You should use the
gpioinfo
utility from the gpiod utils instead ofgpio readall
which probably uses the wrong GPIO interface. Please make sure to follow https://github.com/Duet3D/DuetSoftwareFramework/wiki/SBC-Setup-Guide#link-between-the-duet-and-sbc as some extra steps are also required to get DSF to operate nicely on different SBCs. -
@Dakota 117 seems ok from the formula used by the sunxi driver :
(position of letter in alphabet - 1) * 32 + pin number
So in your case, the pin 22 is mapped to PD21 (See the image below but that is also wrote in yourgpio readall
output)
as D is the 4th letter : (4-1) * 32 + 21 = 117.
However, I believe the GPIO chip device
/dev/gpiochip1
you are using is incorrect.
gpioinfo
which is provided bygpiod
package may give you more clue about that. -
@Falcounet I tried using both chip0 and chip1 which didn't change the outcome...
here is my list from running gpioinfo:
gpiochip0 - 64 lines:
line 0: unnamed kernel input active-high [used]
line 1: unnamed kernel input active-high [used]
line 2: unnamed unused input active-high
line 3: unnamed unused input active-high
line 4: unnamed "red-led" output active-high [used]
line 5: unnamed unused input active-high
line 6: unnamed unused input active-high
line 7: unnamed "green-led" output active-high [used]
line 8: unnamed unused input active-high
line 9: unnamed kernel input active-high [used]
line 10: unnamed unused input active-high
line 11: unnamed unused input active-high
line 12: unnamed unused input active-high
line 13: unnamed unused input active-high
line 14: unnamed unused input active-high
line 15: unnamed unused input active-high
line 16: unnamed unused input active-high
line 17: unnamed unused input active-high
line 18: unnamed unused input active-high
line 19: unnamed unused input active-high
line 20: unnamed unused input active-high
line 21: unnamed unused input active-high
line 22: unnamed unused input active-high
line 23: unnamed unused input active-high
line 24: unnamed unused input active-high
line 25: unnamed unused input active-high
line 26: unnamed unused input active-high
line 27: unnamed unused input active-high
line 28: unnamed unused input active-high
line 29: unnamed unused input active-high
line 30: unnamed unused input active-high
line 31: unnamed unused input active-high
line 32: unnamed unused input active-high
line 33: unnamed unused input active-high
line 34: unnamed unused input active-high
line 35: unnamed "reset" output active-low [used]
line 36: unnamed unused input active-high
line 37: unnamed unused input active-high
line 38: unnamed unused input active-high
line 39: unnamed unused input active-high
line 40: unnamed unused input active-high
line 41: unnamed unused input active-high
line 42: unnamed unused input active-high
line 43: unnamed unused input active-high
line 44: unnamed unused input active-high
line 45: unnamed unused input active-high
line 46: unnamed unused input active-high
line 47: unnamed unused input active-high
line 48: unnamed unused input active-high
line 49: unnamed unused input active-high
line 50: unnamed unused input active-high
line 51: unnamed unused input active-high
line 52: unnamed unused input active-high
line 53: unnamed unused input active-high
line 54: unnamed unused input active-high
line 55: unnamed unused input active-high
line 56: unnamed unused input active-high
line 57: unnamed unused input active-high
line 58: unnamed unused input active-high
line 59: unnamed unused input active-high
line 60: unnamed unused input active-high
line 61: unnamed unused input active-high
line 62: unnamed unused input active-high
line 63: unnamed unused input active-high -
gpiochip1 - 256 lines:
line 0: unnamed unused input active-high
line 1: unnamed unused input active-high
line 2: unnamed unused input active-high
line 3: unnamed unused input active-high
line 4: unnamed unused input active-high
line 5: unnamed unused input active-high
line 6: unnamed unused input active-high
line 7: unnamed unused input active-high
line 8: unnamed unused input active-high
line 9: unnamed unused input active-high
line 10: unnamed unused input active-high
line 11: unnamed unused input active-high
line 12: unnamed unused input active-high
line 13: unnamed unused input active-high
line 14: unnamed unused input active-high
line 15: unnamed unused input active-high
line 16: unnamed unused input active-high
line 17: unnamed unused input active-high
line 18: unnamed unused input active-high
line 19: unnamed unused input active-high
line 20: unnamed unused input active-high
line 21: unnamed unused input active-high
line 22: unnamed unused input active-high
line 23: unnamed unused input active-high
line 24: unnamed unused input active-high
line 25: unnamed unused input active-high
line 26: unnamed unused input active-high
line 27: unnamed unused input active-high
line 28: unnamed unused input active-high
line 29: unnamed unused input active-high
line 30: unnamed unused input active-high
line 31: unnamed unused input active-high
line 32: unnamed unused input active-high
line 33: unnamed unused input active-high
line 34: unnamed unused input active-high
line 35: unnamed unused input active-high
line 36: unnamed unused input active-high
line 37: unnamed unused input active-high
line 38: unnamed unused input active-high
line 39: unnamed unused input active-high
line 40: unnamed unused input active-high
line 41: unnamed unused input active-high
line 42: unnamed unused input active-high
line 43: unnamed unused input active-high
line 44: unnamed unused input active-high
line 45: unnamed unused input active-high
line 46: unnamed unused input active-high
line 47: unnamed unused input active-high
line 48: unnamed unused input active-high
line 49: unnamed unused input active-high
line 50: unnamed unused input active-high
line 51: unnamed unused input active-high
line 52: unnamed "interrupt" input active-high [used]
line 53: unnamed unused input active-high
line 54: unnamed unused input active-high
line 55: unnamed unused input active-high
line 56: unnamed unused input active-high
line 57: unnamed unused input active-high
line 58: unnamed unused input active-high
line 59: unnamed unused input active-high
line 60: unnamed unused input active-high
line 61: unnamed unused input active-high
line 62: unnamed unused input active-high
line 63: unnamed unused input active-high
line 64: unnamed unused input active-high
line 65: unnamed unused input active-high
line 66: unnamed unused input active-high
line 67: unnamed unused input active-high
line 68: unnamed unused input active-high
line 69: unnamed unused input active-high
line 70: unnamed unused input active-high
line 71: unnamed unused input active-high
line 72: unnamed unused input active-high
line 73: unnamed unused input active-high
line 74: unnamed unused input active-high
line 75: unnamed unused input active-high
line 76: unnamed unused input active-high
line 77: unnamed unused input active-high
line 78: unnamed unused input active-high
line 79: unnamed "usb0_id_det" input active-high [used]
line 80: unnamed unused input active-high
line 81: unnamed unused input active-high
line 82: unnamed unused input active-high
line 83: unnamed unused input active-high
line 84: unnamed unused input active-high
line 85: unnamed unused input active-high
line 86: unnamed unused input active-high
line 87: unnamed unused input active-high
line 88: unnamed unused input active-high
line 89: unnamed unused input active-high
line 90: unnamed unused input active-high
line 91: unnamed unused input active-high
line 92: unnamed unused input active-high
line 93: unnamed unused input active-high
line 94: unnamed unused input active-high
line 95: unnamed unused input active-high
line 96: unnamed unused input active-high
line 97: unnamed unused input active-high
line 98: unnamed unused input active-high
line 99: unnamed unused input active-high
line 100: unnamed unused input active-high
line 101: unnamed unused input active-high
line 102: unnamed "gmac-3v3" output active-high [used]
line 103: unnamed unused input active-high
line 104: unnamed unused input active-high
line 105: unnamed unused input active-high
line 106: unnamed unused input active-high
line 107: unnamed unused input active-high
line 108: unnamed unused input active-high
line 109: unnamed unused input active-high
line 110: unnamed "PHY reset" output active-low [used]
line 111: unnamed unused input active-high
line 112: unnamed unused input active-high
line 113: unnamed unused input active-high
line 114: unnamed unused input active-high
line 115: unnamed unused input active-high
line 116: unnamed unused input active-high
line 117: unnamed unused input active-high
line 118: unnamed unused input active-high
line 119: unnamed unused input active-high
line 120: unnamed unused input active-high
line 121: unnamed unused input active-high
line 122: unnamed unused input active-high
line 123: unnamed unused input active-high
line 124: unnamed unused input active-high
line 125: unnamed unused input active-high
line 126: unnamed unused input active-high
line 127: unnamed unused input active-high
line 128: unnamed unused input active-high
line 129: unnamed unused input active-high
line 130: unnamed unused input active-high
line 131: unnamed unused input active-high
line 132: unnamed unused input active-high
line 133: unnamed unused input active-high
line 134: unnamed unused input active-high
line 135: unnamed unused input active-high
line 136: unnamed unused input active-high
line 137: unnamed unused input active-high
line 138: unnamed unused input active-high
line 139: unnamed unused input active-high
line 140: unnamed unused input active-high
line 141: unnamed unused input active-high
line 142: unnamed unused input active-high
line 143: unnamed unused input active-high
line 144: unnamed unused input active-high
line 145: unnamed unused input active-high
line 146: unnamed unused input active-high
line 147: unnamed unused input active-high
line 148: unnamed unused input active-high
line 149: unnamed unused input active-high
line 150: unnamed unused input active-high
line 151: unnamed unused input active-high
line 152: unnamed unused input active-high
line 153: unnamed unused input active-high
line 154: unnamed unused input active-high
line 155: unnamed unused input active-high
line 156: unnamed unused input active-high
line 157: unnamed unused input active-high
line 158: unnamed unused input active-high
line 159: unnamed unused input active-high
line 160: unnamed unused input active-high
line 161: unnamed unused input active-high
line 162: unnamed unused input active-high
line 163: unnamed unused input active-high
line 164: unnamed unused input active-high
line 165: unnamed unused input active-high
line 166: unnamed "cd" input active-low [used]
line 167: unnamed unused input active-high
line 168: unnamed unused input active-high
line 169: unnamed unused input active-high
line 170: unnamed unused input active-high
line 171: unnamed unused input active-high
line 172: unnamed unused input active-high
line 173: unnamed unused input active-high
line 174: unnamed unused input active-high
line 175: unnamed unused input active-high
line 176: unnamed unused input active-high
line 177: unnamed unused input active-high
line 178: unnamed unused input active-high
line 179: unnamed unused input active-high
line 180: unnamed unused input active-high
line 181: unnamed unused input active-high
line 182: unnamed unused input active-high
line 183: unnamed unused input active-high
line 184: unnamed unused input active-high
line 185: unnamed unused input active-high
line 186: unnamed unused input active-high
line 187: unnamed unused input active-high
line 188: unnamed unused input active-high
line 189: unnamed unused input active-high
line 190: unnamed unused input active-high
line 191: unnamed unused input active-high
line 192: unnamed unused input active-high
line 193: unnamed unused input active-high
line 194: unnamed unused input active-high
line 195: unnamed unused input active-high
line 196: unnamed unused input active-high
line 197: unnamed unused input active-high
line 198: unnamed unused input active-high
line 199: unnamed unused input active-high
line 200: unnamed unused input active-high
line 201: unnamed unused input active-high
line 202: unnamed unused input active-high
line 203: unnamed unused input active-high
line 204: unnamed unused input active-high
line 205: unnamed unused input active-high
line 206: unnamed unused input active-high
line 207: unnamed unused input active-high
line 208: unnamed unused input active-high
line 209: unnamed unused input active-high
line 210: unnamed unused input active-high
line 211: unnamed unused input active-high
line 212: unnamed unused input active-high
line 213: unnamed unused input active-high
line 214: unnamed unused input active-high
line 215: unnamed unused input active-high
line 216: unnamed unused input active-high
line 217: unnamed unused input active-high
line 218: unnamed unused input active-high
line 219: unnamed unused input active-high
line 220: unnamed unused input active-high
line 221: unnamed unused input active-high
line 222: unnamed unused input active-high
line 223: unnamed unused input active-high
line 224: unnamed unused input active-high
line 225: unnamed unused input active-high
line 226: unnamed "ddc-en" output active-high [used]
line 227: unnamed unused input active-high
line 228: unnamed unused input active-high
line 229: unnamed unused input active-high
line 230: unnamed unused input active-high
line 231: unnamed "vcc33-wifi" output active-high [used]
line 232: unnamed unused input active-high
line 233: unnamed unused input active-high
line 234: unnamed unused input active-high
line 235: unnamed unused input active-high
line 236: unnamed unused input active-high
line 237: unnamed unused input active-high
line 238: unnamed unused input active-high
line 239: unnamed unused input active-high
line 240: unnamed unused input active-high
line 241: unnamed unused input active-high
line 242: unnamed unused input active-high
line 243: unnamed unused input active-high
line 244: unnamed unused input active-high
line 245: unnamed unused input active-high
line 246: unnamed unused input active-high
line 247: unnamed unused input active-high
line 248: unnamed unused input active-high
line 249: unnamed unused input active-high
line 250: unnamed unused input active-high
line 251: unnamed unused input active-high
line 252: unnamed unused input active-high
line 253: unnamed unused input active-high
line 254: unnamed unused input active-high
line 255: unnamed unused input active-high -
@chrishamm I was able to edit through the directories, however now I get an error saying access denied to /unexport. But after rebooting it returned to error code 19 and unable to connect.
-
@Falcounet well wait now I'm confused... when I look at the directory it lists chip0 and chip352... gpio info still lists chip0 and chip1.
-
@Dakota Look at chrisamm comment above about sysfs / gpiod
You can't use sysfs with DSF. -
@Dakota What I did a while ago when I was faced the same issue is :
- To feed 3.3V (or whatever voltage is safe for your GPIO pin to set it to TRUE state) on the pin number 22 on the connector
- Run gpioget in a loop to all the pins and store the ones that reports 1
- Connect the pin number 22 to GND
- Run gpioget in a loop to all the pins again and store the ones that reports 0
- Make an intersection on the results from #2 and 3#
If you are lucky, you get only one result but if not, it should reduce the number of potential candidates pins.
However, be careful because there is some pins driven by the system so they can get a random state when you poll them.