I’m having trouble getting gpio 4 5 45 46 working. They measure 3.3v 3.3v 3.3v 0.0v
cd /sys/class/gpio
echo 4 > export
echo out > gpio4/direction
echo 0 > gpio4/value
echo 46 > export
echo out > gpio46/direction
echo 0 > gpio46/value
Changing “value” between 0 and 1 has no effect on gpio. They always read 3.3v 3.3v 3.3v 0.0v.
It seems that the pins 4 and 5 are held by i2c. Pins 45 46 are held by uart1(ttyS1). How do I release the i2c and uart1(ttyS1) to be able to use the pins for gpio? I eventually want to run a 1wire bus on these pins but I’m 1st trying to get them to respond to regular gpio.
Thanks that worked. I added both i2c for pin 4 5 and uart1 for ping 45 46.
ralink,group = “wdt”, “gpio”, “wled_an”, “p0led_an”, “p1led_an”, “i2s”, “i2c”, “uart1”;
GPIO pins are now responding to /sys/class/gpio commands.
However now I can’t install the 1-wire modules even though I added them as modules in make menuconfig. Even though my kernel version is the same as up-stream the kmod-w1-* packages are not installable.
When I added “i2c” and “uart1” to the ralink,group does this break it so pins can’t be used for i2c or uart any more? Is the firmware set that it can only be i2c or only gpio not both toggled in software?
What I’m creating is a network environment monitor for data centers ( if the room is too hot/cold, or wet, or has power issues etc). OpenWRT is great because I can add snmp graphs, email alerts etc. The GL-MT300N-V2 pins defaults to i2c/uart. Should I be using i2c peripherals which are more expensive and larger? Re-compiling to switch the pins to GPIO works but is time consuming. Hence why it would be nice to push the change up-stream - yet I don’t want to break original i2c functionality of the pins.