0 Replies Latest reply on Aug 14, 2014 2:02 PM by SpiderKenny

    Using Galileo to read 1-Wire (such as iButton) devices.


      I've written a small test app which uses the standard UART at /dev/ttyS0 to interface to 1-Wire devices.

      It can detect, write to and read from 1-Wire devices such as iButtons and so on.

      Since the timing to the GPIO pins is non deterministic and somewhat slow, I used the UART instead to generate the required pulses to reset, write to and read from the devices.


      It's written for native linux, rather than Arduino.


      The full source code is attached in a single file. Copy the file to a location on your Galileo and run:

      gcc -o owtest OWUart.c to compile the code from OWUart.c to an executable called owtest.

      Screen Shot 2014-06-13 at 15.54.55.png

      You need to connect TX and RX together, (Pins 0 and 1, if using ttyS0) and then to the contact of a 1-Wire device, along with GND.

      Then run owtest with the path to the serial port, such as:

      owtest /dev/ttyS0 and it will output the ID of any iButton you connect to it.


      There is a full write up at my blog site.