Testing 1-Wire on Linux

Linux kernel has native support to 1-Wire bus. To use this feature you need to have a 1-Wire master chip on your board (for example DS2490, DS2482, etc) or you could to select use a GPIO 1-Wire implementation which emulates a real 1-Wire master.

This is the steps to enable DS2482 on kernel:

Device Drivers  --->
    {*} Dallas's 1-wire support  --->
         Maxim DS2482 I2C to 1-Wire bridge

If your device was recognized correctly, then you could see the directory “w1 bus master” at /sys/devices.

Then enter on this directory:

# cd /sys/devices/w1*

You can see the name of your master device:

# cat w1_master_name                                                            

Case you have some slave device plugged on your 1-wire master the w1_master_slave_count will be different of 0.

Then before connecting an i-Button:

# cat w1_master_slave_count                                                     

After connecting an i-Button, the kernel prints this message:

w1_master_driver w1 bus master: Family 1 for 01.0000135b46fa.17 is not regist.

Now the number of slave plugged will be different of 0:

# cat w1_master_slave_count                                                     

Now I can see the name of my slave on the bus:

# cat w1_master_slaves