I built my own v19.07.2 with kmod-w1 and kmod-w1-gpio-custom as well as the desired kmod-w1-slave-therm for a Linkit Smart 7688 Target.
I added echo "w1-gpio-custom bus0=0,19,0 bus1=1,20,0" > /etc/modules.d/55-w1-gpio-custom as described in the docs. I also checked the GPIO as described here.
But the connected device (i double checked and even tried a second absolutely new 18b20) does not apear. In fact there are randomly changeing ID's apearing in the Kernel Log like these last 6 lines:
[ 2884.519815] w1_master_driver w1_bus_master1: Attaching one wire slave 00.ec0000000000 crc 4a
[ 2884.570850] w1_master_driver w1_bus_master1: Family 0 for 00.ec0000000000.4a is not registered.
[ 2947.839911] w1_master_driver w1_bus_master1: Attaching one wire slave 00.1c0000000000 crc 3e
[ 2947.890353] w1_master_driver w1_bus_master1: Family 0 for 00.1c0000000000.3e is not registered.
[ 2987.045575] w1_master_driver w1_bus_master1: Attaching one wire slave 00.9c0000000000 crc b2
[ 2987.132644] w1_master_driver w1_bus_master1: Family 0 for 00.9c0000000000.b2 is not registered.
I read a lot in raspi forums and had to regret that the /overlay stuff is not in my knowledge range.
It maybe also differs to what openwrt is because it seems to be another way to do same things.
I then tried to understan the kernel.org description but without success.
I think i have found the /sys/bus path in this resource.
It seams to be the same in a reduced way.
I have also added the right GPIO. My first post has a copy and paste failure from the docs to this thread. It is not quite what I have done really as I have set GPIO 1:
ls /sys/devices/w1_bus_master1/00-400000000000/
ls /sys/devices/w1_bus_master1/00-800000000000
ls /sys/bus/w1/devices/00-020000000000/
ls /sys/bus/w1/devices/00-7c0000000000/
ls /sys/bus/w1/devices/00-fc0000000000/
p.s. i don't know much about i2c just filling in till @AndrewZ gets back... these seemed like the next step based on what you guys have written... but I suspect your issue is lower level.
based on
i believe with one-wire it often needs some sort of pull-up/down somewhere... for bias/reference
I suggest to check (or even try another) gpio port, sensor wiring and, finally, the log file. I don't have 1-wire configured right now, so cannot show you the desired output. Maybe @anon50098793 can provide an example from his log.
I'm a bit skeptic about using gpio1... what is your router model? Can you try another gpio? Better to check it with multimeter before configuring 1-wire stuff.
My "router" model is a Linkit Smart 7688 and i have doublechecked the gpio by deleting the file in /etc/modules.d/55-w1-gpio-custom rebooting and toggle the gpio 1 whith this script stolen from the docs:
#!/bin/sh
GPIOBASE=`cat /sys/class/gpio/gpiochip*/base | head -n1`
GPIOmin=`expr $1 + $GPIOBASE`
GPIOmax=`expr $2 + $GPIOBASE`
cd /sys/class/gpio
for i in `seq $GPIOmin $GPIOmax`; do
echo "[GPIO$i] Trying value $3"
echo $i > export; echo out >gpio$i/direction
echo $3 > gpio$i/value
echo $i > unexport
done
and executeing it like that:
./gpio 1 1 1
./gpio 1 1 0
While measuring the voltage on the pin 13.
That pin goes to 3.3V when ./gpio 1 1 1 is given.
So the wiring seams to be good.
But granted, the pin can be not able to handle w1.
I will solder it to another Pin and check. Thanks for the thoughts in the meanwhile, very appreciated.
I now changed the W1 Data wire to GPIO2 with no success.
I have a previous built device in my house with 12 18b20 sensors on same Linkit Smart 7688 (it's productive) but that one is on OpenWrt SNAPSHOT r11009-4a85748040 / LuCI Master (git-19.264.32154-6dba41c) and it works on the GPIO2.
I do not know how to compare what changed between that (wrongly built master branch) and the v19.07.2 tag.
Is it possible to compare those two somehow?
OMG. GPIO1 does not work but GPIO2 does.
I realized today, I forgot the 4.7k resistor on my test yesterday with GPIO2.
What's the difference between GPIO1 and 2?