|
【Android】
i need help to identify the relay gpio
Posted at 6/19/2020 01:07:03
View:3785
|
Replies:0
Print
Only Author
[Copy Link]
1#
hey there everyone , totaly new here.
i received not long ago a rockhip chines dev board , it came with android installed on it, and some devices attached to it , leds,sensors,thermal sensor, camera ,relay and more. most of them are connected via gpio , some usb on the board
this is a IOT-3288X
since most the devices are connected via gpios is that the weird part for example are the gpio names, for example there is a led connected to multiple place on the board 1 led 3 colors , they are all under gpio_sw in /sys/class/gpio_sw/ . so instead of having a normal such as LEDWHITE it has totaly different names for example to turn on the white led i have to
"echo 1 > /sys/devices/platform/rk3288-extern-gpio/gpio_sw/WIFI_PW/data"
which make no sense, but i guess everything is messed up
so right now i am trying to understand which gpio is turning on a relay gate ,
i did checked the hardware pins on a chines manual and it seems that the relay is connected to pin 19 and 20 , however when i exported the pins to the /sys/class/gpio/export and then tried to changed the value of it, it did not work. i am at a stage that i am sitting on it for over 16h straight trying to figuring this out without any success
note that i even exported all 264 pins , and tried to change all of them to direction out , however the device crashed and restart , i tried to minimized it to 100 (batch of 100) than minimzed to 10, it carshed all the way, i tried also to change all the values to 1 (without the direction out, so gpio that are on out should've work) it did no changes , i tried to set the value to 0 (on all pins) nothing happen aswell.
when exporting the all the pins , some did not work (all the gpios pins in sys/kernel/debug/gpio could not be exported inside the gpio folder im not sure why , pehaps they are being used or already open/mounted? so how do i use them)
there is an app on the android , which allow me to change the relay more (normaly open, normaly close) (perhaps that can help idk)
any of u have an idea how can i determine what the app is controlling ?
of figuring out what gpio is that so i can turn on and off the relay on my command/demand ?
- cat /sys/kernel/debug/gpio
- GPIOs 0-23, platform/pinctrl, gpio0:
- gpio-1 ( |reset ) out hi
- gpio-3 ( |rk3288 gpio ) out hi
- gpio-5 ( |power ) in hi
- gpio-11 ( |rk3288 gpio ) out lo
- gpio-12 ( |otg_drv_gpio ) out hi
- gpio-13 ( |rk3288 gpio ) out lo
- gpio-14 ( |vcc_host ) out hi
- gpio-17 ( |rk3288 gpio ) out hi
- gpio-18 ( |rk3288 gpio ) out lo
- GPIOs 24-55, platform/pinctrl, gpio1:
- GPIOs 56-87, platform/pinctrl, gpio2:
- GPIOs 88-119, platform/pinctrl, gpio3:
- GPIOs 120-151, platform/pinctrl, gpio4:
- gpio-127 ( |mdio-reset ) out hi
- gpio-139 ( |bt_default_rts ) out lo
- gpio-146 ( |bt_default_wake ) out hi
- gpio-148 ( |reset ) out hi
- gpio-149 ( |bt_default_reset ) out hi
- gpio-151 ( |bt_default_wake_host) out hi
- GPIOs 152-183, platform/pinctrl, gpio5:
- gpio-162 ( |wiegand_d1 ) in hi
- gpio-163 ( |wiegand_d0 ) in hi
- GPIOs 184-215, platform/pinctrl, gpio6:
- GPIOs 216-247, platform/pinctrl, gpio7:
- gpio-218 ( |rk3288 gpio ) out lo
- gpio-219 ( |vcc_lcd ) out lo
- gpio-220 ( |rk3288 gpio ) out hi
- gpio-221 ( |rk3288 gpio ) out lo
- gpio-222 ( |rk3288 gpio ) out hi
- gpio-225 ( |vcc_wl ) out lo
- gpio-226 ( |rk3288 gpio ) out hi
- gpio-228 ( |rk3288 gpio ) out hi
- gpio-229 ( |rk3288 gpio ) out lo
- gpio-230 ( |enable ) out hi
- gpio-231 ( |headset_gpio ) in lo
- gpio-237 ( |rk3288 gpio ) out hi
- GPIOs 248-263, platform/pinctrl, gpio8:
- gpio-248 ( |mpu6500 ) in lo
- gpio-249 ( |rk3288 gpio ) out hi
- gpio-250 ( |recovey ) in hi
- gpio-251 ( |rk3288 gpio ) out lo
- gpio-257 ( |enable ) out hi
Copy the code
- cat /sys/kernel/debug/pinctrl/pinctrl/gpio-ranges
- GPIO ranges handled:
- 0: gpio0 GPIOS [0 - 23] PINS [0 - 23]
- 1: gpio1 GPIOS [24 - 55] PINS [24 - 55]
- 2: gpio2 GPIOS [56 - 87] PINS [56 - 87]
- 3: gpio3 GPIOS [88 - 119] PINS [88 - 119]
- 4: gpio4 GPIOS [120 - 151] PINS [120 - 151]
- 5: gpio5 GPIOS [152 - 183] PINS [152 - 183]
- 6: gpio6 GPIOS [184 - 215] PINS [184 - 215]
- 7: gpio7 GPIOS [216 - 247] PINS [216 - 247]
- 8: gpio8 GPIOS [248 - 263] PINS [248 - 263]
Copy the code
- ls -lha /sys/class/gpio/
- gpiochip0 -> ../../devices/platform/pinctrl/gpio/gpiochip0
- gpiochip120 -> ../../devices/platform/pinctrl/gpio/gpiochip120
- gpiochip152 -> ../../devices/platform/pinctrl/gpio/gpiochip152
- gpiochip184 -> ../../devices/platform/pinctrl/gpio/gpiochip184
- gpiochip216 -> ../../devices/platform/pinctrl/gpio/gpiochip216
- gpiochip24 -> ../../devices/platform/pinctrl/gpio/gpiochip24
- gpiochip248 -> ../../devices/platform/pinctrl/gpio/gpiochip248
- gpiochip56 -> ../../devices/platform/pinctrl/gpio/gpiochip56
- gpiochip88 -> ../../devices/platform/pinctrl/gpio/gpiochip88
Copy the code
(P.S, there is also a thermal sensor , that speaks via i2c, which again idk on what gpio is that so i can perhaps start to communicate with it)
any how thanks for the help , and please ask me anything ! , so i can try to help myself here.
i know maybe it seems abit non organized but i am after 20h of being awake
maybe phrase it differently would be
i want to figure out which path in /sys/... corresponds to which GPIO pin that is connected.
please guide me .
Thanks |
|