Jump to: navigation, search


1-wire interface can be used with a real 1-wire master interface such as mxc-w1, omap-hdq and others, or on a GPIO. On a real 1-wire master interface, you have nothing to do, as the interface is already registered in your devcie tree.

If you want to use w1-gpio driver on a regular GPIO, you need update your device tree to add the w1-gpionode with required information, including GPIO number.

For Raspberry Pi (1, 2, 3), you need to add the following lines to your /boot/efi/extraconfig.txt file, to enable 1-wire interface (on the gpio4) on boot:

 # Enable 1-wire interface on gpio4 (default if ,gpiopin=X is omitted)

Interaction using /sys fs

Check slave devices

By default, the w1 bus is probed continuously.

You can check the number of slave devices found with the following command:

 cat /sys/bus/w1/devices/w1_bus_master1/w1_master_slave_count

And you also have slave devices found in /sys/bus/w1/devices folder.

See also