Working with 1-Wire in Linux

Initializing

Note

By default at Armbian Linux 1-Wire is configured at system startup and no additional configuration is required.

Note

This command is only relevant for older revisions of controllers that use a DS2482 chip.

sudo modprobe ds2482
sudo sh -c "echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-0/new_device"

View connected devices

ls /sys/bus/w1/devices/
28-000007430c40  w1_bus_master1

Reading data from a temperature sensor

cat /sys/bus/w1/devices/28-000007430c40/w1_slave
8f 01 4b 46 7f ff 01 10 14 : crc=14 YES
8f 01 4b 46 7f ff 01 10 14 t=24937