GL-MT300N: Cannot use gpio44 with w1-gpio

I’m trying to use gpio44 on a GL-MT300N with the Chaos Calmer tree from GLi with a w1 temperature sensor and I’m unable to.

cat /etc/modules.d/55-w1-gpio-custom

w1-gpio-custom bus0=0,44,0

reboot and on dmesg:
[ 18.280000] w1-gpio w1-gpio.0: no of_node; not parsing pinctrl DT
[ 18.280000] w1-gpio w1-gpio.0: Failed to parse gpio property for data pin (-2)
[ 18.290000] w1-gpio: probe of w1-gpio.0 failed with error -2
I found this: https://dev.openwrt.org/ticket/21965?cversion=0&cnum_hist=8#no1 but I believe the main problem is in pinmux

Anyone got this working?

I just tried a LEDE Project snapshot image and I got similar results:
[ 235.175618] Driver for 1-wire Dallas network protocol.
[ 238.809742] Custom GPIO-based W1 driver version 0.1.1
[ 238.815181] w1-gpio w1-gpio.0: no of_node; not parsing pinctrl DT
[ 238.815241] w1-gpio w1-gpio.0: Failed to parse gpio property for data pin (-2)
[ 238.822675] w1-gpio: probe of w1-gpio.0 failed with error -2
root@lede:~# uname -a

Linux lede 4.4.30 #0 Sat Nov 5 09:18:27 2016 mips GNU/Linux

@jbarros, we checked gpio 44 hardware and it works. So next thing is find out the problem in software.

can you show the sensor you are using? the configuration you are using or programs you write, command you executed?

Hi alzhao,

Sorry, I forgot to mention I’m using a DS18b20 with kmod w1-thermal/w1-slave-thermal

I was only able to get it working with the patch mentioned on the url on my 1st message

Simple instructions on how you can test and output when it’s working correctly:

Software package installation for 1-WIre Temps

1 – # opkg update
2 – # opkg install kmod-w1 kmod-w1-master-gpio kmod-w1-gpio-custom
3 – # insmod w1-gpio-custom bus0=0,44,0
4 – # echo “w1-gpio-custom bus0=0,44,0” > /etc/modules.d/59-w1-gpio-custom
5 – # opkg install kmod-w1-slave-therm
6 – # cat /sys/bus/w1/drivers/w1_slave_driver/*/w1_slave

d4 01 4b 46 7f ff 0c 10 6f : crc=6f YES
d4 01 4b 46 7f ff 0c 10 6f t=29250

* crc=6f YES means its working and 29250 is the temperature in Celsius

7 – awk -F= ‘/t=/ {printf “%.02f\n”, $2/1000}’ /sys/bus/w1/drivers/w1_slave_driver/*/w1_slave

29.25

Hi jbarros,

I want to have kmod-w1 working like you do .

Would you help me tell how to do that?

where is the drivers/w1/masters/w1-gpio.c ?

and how to compile them with patch ?

pop k

 

Sorry for the late reply!

 

Because I was in a hurry I patched the files directly in the build_dir but if you upgrade sources that will probably be discarded.

The correct way is to make a patch for the kernel: https://lede-project.org/docs/guide-developer/use-patches-with-buildsystem

I haven’t done it myself but on my TODO list