Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Orange Pi Zero mainline 1wire devicetree

Featured Replies

Hello does someone have the working configuration enabling the onewire master bus on the mainline version ?

 

I have tried to gather the information from several posts adding the missing configuration on the devicetree but as there is no real step by step guide and the kernel wiki entry makes no sense for the zero`s pins.

 

Overlay or straight settings into the boot configuration.

 

Here is my W1 Overlay that I use on OPi+2E, you can tweak it to change the pin number you wish to use.

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun8i-h3";

        fragment@0 {
                target-path = "/";
                __overlay__ {

                        w1: onewire@0 {
                                compatible = "w1-gpio";
                                pinctrl-names = "default";
                                pinctrl-0 = <&w1_pins>;
                                gpios = <&pio 3 14 0>; // PD14
                                status = "okay";
                        };
                };
        };

        fragment@1 {
                target = <&pio>;
                __overlay__ {
                        w1_pins: w1_pins {
                                allwinner,pins = "PD14";
                                allwinner,function = "gpio_in"; // in (initially)
                                allwinner,pull = <0>; // off
                        };
                };
        };

        __overrides__ {
                gpiopin =       <&w1>,"gpios:4",
                                <&w1_pins>,"allwinner,pins:0";
        };
};

Hi! I falling in similar problem - searching step by step guide with no success. Only thing that I found is http://linux-sunxi.org/1-Wire but I can not find &pio label in decompiled dtb (to dts) for opi zero. My kernel version is 4.9.  Please can you describe procedure of editing dtb, where is this damn &pio label?

 

I was trying compile code above, but native dtc gives "Syntax error". Where can find information about compiling and using above code? Please help!

Thank you!

So this is step by step guide:

We need compile special dtc, compile code above into dtbo and  load dtbo overlay.

 

"Enable 1wire on Mainline kernel".

1. mkdir 1wire; cd 1wire

2. nano 1w.dts,  paste and save:

// Definitions for w1-gpio module (without external pullup)
/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun8i-h3";

    fragment@0 {
        target-path = "/";
        __overlay__ {

            onewire@0 {
                compatible = "w1-gpio";
                pinctrl-names = "default";
                pinctrl-0 = <&w1_pins>;
                gpios = <&pio 0 6 0>; // PWM1/PA06 pin on Orange Pi Zero (0 this is A port, 6 this is 06 pin. for PD14 use  <&pio 3 14 0>)
                status = "okay";
            };
        };
    };

    fragment@1 {
        target = <&pio>;
        __overlay__ {
            w1_pins: w1_pins {
                allwinner,pins = "PA06";
                allwinner,function = "gpio_in"; // in (initially)
                allwinner,pull = <0>; // off
            };
        };
    };

};

3. git clone -b dt-overlays8 https://github.com/pantoniou/dtc

4. cd dtc

5. sudo apt-get install flex bison

6. make

7. ./dtc -@ -O dtb -I dts -o 1w.dtbo 1w.dts   (Several warnings will pop up. it is ok.)

8. sudo mkdir /sys/kernel/config/device-tree/overlays/1wire

9. cat 1w.dtbo > /sys/kernel/config/device-tree/overlays/1wire/dtbo

 

you can read now /sys/kernel/config/device-tree/overlays/1wire/status

and look for new devices in /sys/bus/w1/devices/

 

4.7k resistor should be between VCC and 1wire wires

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.