1.4 Installation of the driver on the target device

If there is no RexCore runtime module installed on your target device, install it first using the Getting started guide of the REX Control System for the corresponding platform[3].

In order to communicate with the 1-Wire devices from the REX Control System it is necessary to install the owserver and ow-shell packages of the OWFS suite and the 1-Wire driver of the REX Control System, which is done by the following command:
Debian:
sudo apt-get install owserver ow-shell rex-owsdrvt
OpenWrt:
opkg install owserver owshell rex-owsdrvt

1.4.1 Running the 1Wire server

The owserver must be configured to use the 1-Wire bus master of your choice. Use sudo nano /etc/owfs.conf command to edit the file.

E.g. for use with USB to 1-Wire adapter (e.g. DS9490R):

!server: server = localhost:4304  
allow_other  
server: port = localhost:4304  
server: usb = all  
timeout_volatile = 2

For I2C devices based on the DS2482-100 or DS2482-800 chip the /etc/owfs.conf file should contain the following:

!server: server = localhost:4304  
allow_other  
server: port = localhost:4304  
server: i2c=ALL:ALL  
timeout_volatile = 2

It is also necessary to activate the I2C bus and enable the i2c-dev kernel module. If you have used our installation scripts for your platform, everything is ready for you. If you have not, you probably know what to and how to do it. In any case, just check that e.g. /dev/i2c-1 is present.

Restart the owserver and list the detected 1-Wire devices by the owdir command. The output should look like this:

/28.551DDF030000  
/bus.1  
/bus.0  
/uncached  
/settings  
/system  
/statistics  
/structure  
/simultaneous  
/alarm

The first line is the 1-Wire device ID (the DS18B20 temperature sensor in this case). Read the temperature by issuing the command:
owread /28.551DDF030000/temperature12
(change the ID to match your device).