Knowledge Base

The AB Electronics UK Knowledge Base provides support solutions, tutorials and troubleshooting guides.

Knowledge Base

OWFS with I2C support on the Asus Tinker Board

Using the 1 Wire File System with the 1 Wire Pi Plus and 1 Wire Pi Zero

Created 11/02/2017 | Last Updated: 25/10/2023

This page details how to set up the 1-Wire File System with the 1 Wire Pi Plus and 1 Wire Pi Zero on the TinkerOS Debian image for your Asus Tinker Board.

Step 1:  Install OWFS and Python-OW

sudo apt-get install owfs python-ow

Step 2: Edit owfs.conf to enable the I2C 1-Wire interface

 

 

Comment out the following line

# server: FAKE = DS18S20,DS2405

Find the following section

# USB device: DS9490
#server: usb = all

Insert the line below to enable i2c support. 

server: device = /dev/i2c-1

Find the section titled

######################### OWFS ##########################

Remove the hashes from the lines

mountpoint = /mnt/1wire
allow_other

Save your changes and exit the nano editor.

 

Step 6: Create a directory called 1wire in /mnt 

sudo mkdir /mnt/1wire

 

Step 7: Before using OWFS with Python, you must start owserver.  To start this, when the Tinker Board boots, you must enable the owserver service.

sudo systemctl enable owserver

 

Step 8: Reboot your Tinker Board

sudo reboot

 

Step 9: Your Tinker Board should now work with OWFS.  To test this, we will create a Python script which lists all 1-Wire devices connected to the 1 Wire Pi.

Create a new Python script called 1wiretest.py

nano 1wiretest.py

Insert the following Python code:

import ow
ow.init('localhost:4304')
sensorlist = ow.Sensor('/').sensorList()
for sensor in sensorlist:
    print('Device Found')
    print('Address: ' + sensor.address)
    print('Family: ' + sensor.family)
    print('ID: ' + sensor.id)
    print('Type: ' + sensor.type)
    print(' ')

Step 9: Save and run the file.

python 1wiretest.py

If everything works correctly, the script should list every 1 Wire device connected to the Tinker Board.

Note:

On specific versions of owfs available on Debian Linux, a bug causes devices in the /mnt/1wire directory to be duplicated, showing two folders for each device.

If you encounter this problem, it can be resolved by editing the configuration file for the owfs service.

Step 1: Open /lib/systemd/system/owfs.service in an editor.

sudo nano /lib/systemd/system/owfs.service

Step 2: Find the following line.

ExecStart=/usr/bin/owfs -c /etc/owfs.conf --allow_other %t/owfs

Remove "-c /etc/owfs.conf" so the line looks like this.

ExecStart=/usr/bin/owfs --allow_other %t/owfs

Step 3: Save the file and reboot your Tinker Board.

You should only see one device instance in the /mnt/1wire directory.

Home

Shop

Learn

Forum

FAQ

Contact

0 item

Your cart is empty

Please browse our shop to order from the wide range of Raspberry Pi boards and accessories.

Subtotal:£0.00
View Basket Continue to Checkout