(Useful links: http://owfs.org/index.php?page=quickstart-guide and https://www.raspberrypi.org/forums/viewtopic.php?t=27379)
Listed below are the steps to install the 1-Wire software or OWFS (One Wire File System) onto the Raspberry Pi. Using the Raspberry Pi, OWFS allows easy interaction with the 1-wire sensors that are connected to the network.
The steps below assume that the 1-Wire network it to be connected to the Raspberry Pi using a USB serial adapter. (This is based on the micro controller LINK (serial adapter) coupled with a FTDI USB serial converter.
Earlier we ran the Raspberry Pi Configuration Utility, and set-up the Pi Interface to recognise the 1-Wire sensors, now we are going to connect the 1-Wire interface, install the One Wire File System, and connect some sensors.
Connect & Check USB Serial Link Adapter
Plug in the Link USB adapter and check that the device is working and recognised by running the dmesg command as follows:
pi@raspbeepi ~ $dmesg
usb 2-4.1: new full speed USB device using ehci_hcd and address 9
usb 2-4.1: configuration #1 chosen from 1 choice
usb 2-4.1: New USB device found, idVendor=0403, idProduct=6001
usb 2-4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-4.1: Product: FT232R USB UART
usb 2-4.1: Manufacturer: FTDI
usb 2-4.1: SerialNumber: A900a3Z7
drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device
ftdi_sio 2-4.1:1.0: FTDI USB Serial Device converter detected
drivers/usb/serial/ftdi_sio.c: Detected FT232RL
usb 2-4.1: FTDI USB Serial Device converter now attached to ttyUSB0
usbcore: registered new interface driver ftdi_sio
drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver
In the dmesg information above, the adapter appears as ttyUSB0. You should see text in the script similar to that highlighted in red
above. ttyUSB0 is the serial port that the USB interface will be outputting the sensor readings through. Take note of this as it will be needed later on in the configuration.
Install the OWFS Package
Install OWFS by typing the following command:
pi@raspbeepi ~ $ sudo apt-get install –y owfs
Text will scroll up the screen giving a commentary on the installation. When the install process ends, the OWFS tasks are started, and they will restart automatically each time you reboot the Raspberry Pi.
Now check that the OWFS software has been properly installed by running the following command:
pi@raspbeepi ~ $ aptitude show owfs
Automatically installed: no
Maintainer: Vincent Danjean <firstname.lastname@example.org>
Uncompressed Size: 25.6 k
Depends: owfs-fuse (>= 3.1p5-1), owserver (>= 3.1p5-1), owhttpd (>= 3.1p5-1), owftpd (>=
Description: Dallas 1-wire support
The 1-Wire bus is a cheap low-speed bus for devices like weather sensors, access control,
etc. It can be attached to your system via serial, USB, I2C, and other interfaces.
This package is a metapackage depending on various other OWFS packages. Installing this
package gets you a FUSE daemon, server arbitrates access to the bus from multiple client
processes, small ftp and webserver.
and where it has been installed:
pi@raspbeepi ~ $ ls -l /usr/bin
************* Show directory listing ***********
When OWFS starts, it reads a configuration file—/etc/owfs.conf
to get its stat-up settings. We need to make changes to this file to ensure that OWFS starts correctly.
Edit the OWFS configuration file using the following command:
pi@raspbeepi ~ $ sudo nano /etc/owfs.conf
Once the editor is open:
- Comment out the lines containing "FAKE" by placing a hash at the start of the line #. These lines have been highlighted in red below.
- # server: FAKE = DS18S20,DS2405
- Uncomment the the following lines by removing the hash at the beginning of the line. These lines have been highlighted in blue below.
- server: device = /dev/ttyUSB0
- mountpoint = /mnt/1wire and
As shown below and highlighted in Blue.
# Sample configuration file for the OWFS suite for Debian GNU/Linux.
# This is the main OWFS configuration file. You should read the
# owfs.conf(5) manual page in order to understand the options listed
# With this setup, any client (but owserver) uses owserver on the
# local machine...
! server: server = localhost:4304
# ...and owserver uses the real hardware, by default fake devices
# This part must be changed on real installation
# server: FAKE = DS18S20,DS2405
# USB device: DS9490
#server: usb = all
# Serial port: DS9097
server: device = /dev/ttyUSB0
# owserver tcp address
#server: server = 192.168.10.1:3131
# random simulated device
#server: FAKE = DS18S20,DS2405
# OWFS ##
mountpoint = /mnt/1wire
http: port = 2121
ftp: port = 2120
server: port = localhost:4304
Edit the "fuse.conf" file in directory "/etc" in order to allow using the "--allow_other" option when invoking the OWFS program at the terminal prompt later on.
pi@raspberrypi ~ $ sudo nano /etc/fuse.conf
Uncomment the line containng "user_allow_other" as shown below:
# Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#mount_max = 1000
# Allow non-root users to specify the 'allow_other' or 'allow_root'
# mount options.
Now we need to make a directory for the OWFS to place all the sensor readings.
pi@raspberrypi ~ $ sudo mkdir /mnt/1wire
pi@raspberrypi ~ $ sudo lsusb
We are now ready to connect the 1-wire sensors to the Raspberry Pi via the USB Adapter. For the purpose of these instructions, a 1-wire temperature sensors and humidity sensor are connected.
Finally, it is time to start OWFS. Restart owserver, owhttpd & the USB Adapter with the following commands.
sudo service owserver restart
sudo service owhttpd restart
sudo /usr/bin/owfs -s 2020 /mnt/1wire/ --link=/dev/ttyUSB0
The OWFS processes should all be running now. To check this go to a web browser and enter the web address as follows:
Where <localhost> is the IP address of your Raspberry Pi, which you should have noted earlier in the installation process. So if the IP address is 192.160.200, you would enter into your browser: