Device Tree Overlay configure for w1 bus purpose

I'm trying unsuccessfully to connect DS18B20 to BPI-R3.

The DS18B20 electricaly connected to GPIO44 UART1_CTS (18pin of 26pins connector) of my BPI-R3.
OpenWRT 25.12.0 is installed to emmc of the BPI.

How I can direct w1_gpio kernel module to 18pin? How I can edit and apply DTO (dts) configuration with OpenWRT? Can I use ConfigFS with my router? Does anyone have an example/howto?

See https://openwrt.org/docs/techref/hardware/port.gpio/1-wire#installation_as_of_v21020

I have not a boot partition or /boot folder :frowning:

Then you probably need to amend the dts on your local build system prior to building the image.

What I made:

  1. I created fat partition ( mmcblk0p6 )
    # lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    mtdblock0 31:0 0 126M 0 disk
    mtdblock1 31:1 0 2M 0 disk
    mmcblk0 179:0 0 7.3G 0 disk
    ├─mmcblk0p1 179:1 0 512K 0 part
    ├─mmcblk0p2 179:2 0 2M 0 part
    ├─mmcblk0p3 179:3 0 4M 0 part
    ├─mmcblk0p4 179:4 0 32M 0 part
    ├─mmcblk0p5 179:5 0 7.2G 0 part
    ├─mmcblk0p6 179:6 0 20M 0 part
    └─mmcblk0p128 259:0 0 4M 0 part
    mmcblk0boot0 179:8 0 4M 1 disk
    mmcblk0boot1 179:16 0 4M 1 disk
    ubiblock0_2 254:0 0 12.5M 0 disk
    fit0 259:1 0 6.8M 1 disk /rom
    fitrw 259:2 0 7.2G 0 disk /overlay

  2. I wrote compiled w1-gpio.dtbo file to the partition.
    ( dtc -@ -I dts -O dtb -o w1-gpio.dtbo w1-gpio.dts )

/dts-v1/;
/plugin/;

/ {
compatible = "bananapi,bpi-r3", "mediatek,mt7986a";

fragment@0 {
target = <&pio>;
__overlay__ {
w1_pins: w1-gpio-pins {
pins = "GPIO44";
function = "gpio";
};
};
};

fragment@1 {
target = <&uart1>;
__overlay__ {
status = "disabled";
};
};

fragment@2 {
target-path = "/";
__overlay__ {
onewire {
compatible = "w1-gpio";
gpios = <&pio 44 0>; /* GPIO44, pin 18 */
pinctrl-names = "default";
pinctrl-0 = <&w1_pins>;
status = "okay";
};
};
};
};

  1. … and set fw_enviroment (‘run load_w1’ inserted into the boot_production):

fw_setenv fdt_addr_r ‘0x46000000’
fw_setenv load_w1 ‘fatload mmc 0:6 $loadaddr w1-gpio.dtbo && fdt addr $fdt_addr_r && fdt resize 8192 && fdt apply $loadaddr’
fw_setenv boot_production ‘run boot_update_conf ; led $bootled_pwr on ; run load_w1 ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off’

It’s not work! The BPI-R3 not see a DS18B20 on 18 pin.

Where am I wrong?

I’ve tested electrical connection with Raspberry now. All rights, the Raspberry see the sensor on
GPIO4. The schema return to BPI-R3 to 18 pin.