Dallas 1 Wire on BPI-R2


#1

Can anyone help with instructions about using Dallas 1 wire on Debian stretch with kernel 4.14.54-bpi-r2-main (or any really). I have a couple of DS18B20’s here attached to a Raspberry Pi 3 and would like to move them onto the R2. I have recompiled Frank-W’s kernel his repository at https://github.com/frank-w/BPI-R2-4.14 and added in w1-thermal and w1-gpio and they load ok but obviously I need something in the device tree. Now on a Raspberry Pi this is easy but I have no idea how to do it with the R2. So if anyone can give me some clear instructions that would be awesome.

Cheers -Phil-


(Frank W.) #2

How is your circuit and how do you load the module (imho somewhere you need to pass the gpio)?

On rpi a additional overlay-dtb is needed: https://github.com/krzk/tizen-tv-rpi-linux/blob/master/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts

This dtb is loaded via config.txt (not used on bpi) with a line like this:

dtoverlay=w1-gpio,gpiopin=4

Currently i don’t knoe how to adapt this to bpi


#3

If by “How is your circuit” you mean how is it connected it has 3 wires, 1 is 3.3v, 1 is ground and 1 is data. I use quite a lot of the pins on the pi at once so this is currently connected to a non standard gpio 25 (Pin 22) instead of gpio 4. The config.txt dtoverlay line looks like dtoverlay=w1-gpio,gpiopin=25 I then load the w1-gpio and w1-therm modules at boot in /etc/modules. It would be a pity if there is no way to do this with the bpi gpio.


(Frank W.) #4

Config.txt does not exit and will not be loaded on bpi.

Pin 22 is gpio 18 see here: https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:gpio

As for overlay-support…our uboot (2014-4) should be too old: https://forum.digikey.com/t/all-beaglebone-varients-u-boot-overlays/26

@Ryder.Lee @linkerosa do you know a way this can be done on r2?