I really need to use the GPIO pins on my beloved GL-MT300N-V2 / Mango.
I was running firmware 3.x.x, and I could see the GPIO pins in Linux, but no matter what value I wrote to them, the voltages didn't change.
So I updated to the latest available firmware version 4.3.17, and now it is even worse? All the GPIO numbers of the pre-defined GPIOs seem to have changed:
root@GL-MT300N-V2:~# cat /sys/kernel/debug/gpio
gpiochip2: GPIOs 416-447, parent: platform/10000600.gpio, 10000600.gpio-bank2:
gpiochip1: GPIOs 448-479, parent: platform/10000600.gpio, 10000600.gpio-bank1:
gpio-454 ( |reset ) in hi IRQ ACTIVE LOW
gpio-458 ( |green:power ) out lo ACTIVE LOW
gpio-459 ( |green:wan ) out hi ACTIVE LOW
gpio-460 ( |red:wlan ) out lo ACTIVE LOW
gpiochip0: GPIOs 480-511, parent: platform/10000600.gpio, 10000600.gpio-bank0:
gpio-480 ( |switch ) in hi IRQ
gpio-483 ( |BTN_1 ) in lo IRQ ACTIVE LOW
gpio-491 ( |usb ) out hi
Note that the GPIO numbers used to be something like -0, -3, -4 and -11. Now they are > 400 ??
Also, when trying to export one of the unused GPIO pins using the number provided in the official pinouts, I just get an error:
root@GL-MT300N-V2:~# echo "45" > /sys/class/gpio/export
ash: write error: Invalid argument
I have installed the packages gpioctl-sysfs and gpiod-tools , but that didn't change anything.
Running "gpiodetect" doesn't return anything.
Please help? I really need these GPIOs ASAP.
Edit: I followed the instructions at https://openwrt.org/docs/techref/hardware/port.gpio in order to use the new GPIO numbers. I am testing GPIO46. So I wired cables between GND (upper left pin) and GPIO46 (bottom right pin).
I ran:
root@GL-MT300N-V2:~# cat /sys/class/gpio/gpiochip*/base | head -n1
416
# 416 + 46 = 462
root@GL-MT300N-V2:~# echo "462" > /sys/class/gpio/export
root@GL-MT300N-V2:~# echo "out" > /sys/class/gpio/gpio462/direction
root@GL-MT300N-V2:~# echo "1" > /sys/class/gpio/gpio462/value
root@GL-MT300N-V2:~# echo "0" > /sys/class/gpio/gpio462/value
But my multimeter always just show 0V on that pin.