1-Wire Interface for DS18B20 Sensor on A20-LIME2

Started by msx_23, August 05, 2022, 01:53:20 PM

Previous topic - Next topic

msx_23

Hello,

I´m trying to use a DS18B20 temperature sensor on a A20-LIME2-board, but I´m having some trouble and I am a bit confused with the some tutorials and blogs I found online: I´m not sure if I can just use some already available modules with modprobe or recompile a device tree and if so which one...

My current setup is A20-LIME2 board with the LIME2-Shield to which I connect the sensor at PG7 (GPIO199)

Linux version is:
Linux a20-olinuxino 5.10.60-olimex #123632 SMP Sat Aug 21 12:38:05 UTC 2021 armv7l GNU/Linux

If it is necessary I could also upgrade to a newer version.


When I load the 1-wire libs I get the following:
root@a20-olinuxino:~# modprobe w1-gpio
root@a20-olinuxino:~# modprobe w1_therm
root@a20-olinuxino:~# lsmod | grep w1
w1_gpio                16384  0
w1_therm               24576  0
wire                   24576  2 w1_gpio,w1_therm
root@a20-olinuxino:~# ls -l /sys/bus/w1/
devices/           drivers_autoprobe  uevent
drivers/           drivers_probe
root@a20-olinuxino:~# ls -l /sys/bus/w1/
total 0
drwxr-xr-x 2 root root    0 Nov  4 01:05 devices
drwxr-xr-x 4 root root    0 Nov  4 01:04 drivers
-rw-r--r-- 1 root root 4096 Nov  4 01:05 drivers_autoprobe
--w------- 1 root root 4096 Nov  4 01:05 drivers_probe
--w------- 1 root root 4096 Nov  4 01:04 uevent
root@a20-olinuxino:~# ls -l /sys/bus/w1/devices/
total 0

I have no idea where to specify the pin number, when giving it to modprobe it gives:
root@a20-olinuxino:~# modprobe w1-gpio pullup=1 gpiopin=199
root@a20-olinuxino:~# dmesg | grep w1
[ 1612.752901] w1_gpio: unknown parameter 'pullup' ignored
[ 1612.752927] w1_gpio: unknown parameter 'gpiopin' ignored

Does anyone kwow what I have to do in order to get the 1-wire interface to work?


JohnS

I'm wondering if the kinds of ways to do it on RPi would give you insight? E.g. see https://pinout.xyz/pinout/1_wire#

(probably the sudo dtoverlay w1-gpio gpiopin=4 pullup=0 kind of thing)

John

msx_23

root@a20-olinuxino:/home/olimex# dtoverlay w1-gpio gpiopin=199 pullup=1
bash: dtoverlay: command not found

Any other ideas?

msx_23

My boot folder looks like this, in case I have to change something there:

root@a20-olinuxino:/home/olimex# ls -l /boot/
total 39216
-rw-r--r-- 1 root root     2202 Aug 21 15:55 boot.cmd
-rw-r--r-- 1 root root     2274 Aug 21 15:55 boot.scr
-rw-r--r-- 1 root root   189836 Aug 21 14:37 config-5.10.60-olimex
-rw-r--r-- 1 root root 13945336 Oct 15 09:15 initrd.img-5.10.60-olimex
-rw-r--r-- 1 root root 15993811 Aug 21 15:57 kernel.itb
-rw-r--r-- 1 root root    27110 Aug 21 15:57 kernel.its
-rw-r--r-- 1 root root  3557776 Aug 21 14:37 System.map-5.10.60-olimex
-rw-r--r-- 1 root root     1213 Aug 21 15:53 uEnv.txt
-rwxr-xr-x 1 root root  6421608 Aug 21 14:37 vmlinuz-5.10.60-olimex