MyPi 1-Wire Card Configuration


OWFS usage via the file system has been determined to be too buggy to work on either Wheezy or Jessie Raspbian, this is the method that uses a mount point and just results in duplicate or disappearing devices. A more reliable approach is to instead use the owserver service and ow-shell commands.

For this test I have hooked up a temperature sensors to the 1W ports

First Let's check the bus master devices have all been detected :

#i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 19 -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Looks good

1W bus 1    => 0x19
1W bus 0    => 0x18

So let's install all the owfs packages we need

# apt-get install owfs ow-shell


We'll stop these for the moment as they're not required for the sake of the demo

# service owhttpd stop
# service owftpd stop

These can be permanently disabled via :

# update-rc.d owserver disable
# update-rc.d owftpd disable
# update-rc.d owhttpd disable

Using the OWFS config file (/etc/owfs.conf) appears problematic when dealing with multiple I2C bus master devices, so instead we'll use this command to start the server instead (note -C = Celceius) - for more info see man owserver
 

# owserver -C --i2c=/dev/i2c-1:ALL --allow_other

We can now use these ow-shell commands to get more info :

owdir      owget      owmon      owpresent  owread     owtap      owwrite

So lets have a look at the temperature reading from one of the devices, note we can directly access the device or go via the bus.x route :
 

$ owdir
/28.FF691F921503
/28.FF4E26901501
/bus.1
/bus.0
/uncached
/settings
/system
/statistics
/structure
/simultaneous
/alarm
$ owread /28.FF691F921503/temperature
     20.8125
$ owdir /bus.0/
/bus.0/interface
/bus.0/28.FF9461901501
/bus.0/simultaneous
/bus.0/alarm
$ owdir /bus.0/28.FF9461901501
/bus.0/28.FF9461901501/address
/bus.0/28.FF9461901501/alias
/bus.0/28.FF9461901501/crc8
/bus.0/28.FF9461901501/errata
/bus.0/28.FF9461901501/family
/bus.0/28.FF9461901501/fasttemp
/bus.0/28.FF9461901501/id
/bus.0/28.FF9461901501/locator
/bus.0/28.FF9461901501/power
/bus.0/28.FF9461901501/r_address
/bus.0/28.FF9461901501/r_id
/bus.0/28.FF9461901501/r_locator
/bus.0/28.FF9461901501/temperature
/bus.0/28.FF9461901501/temperature10
/bus.0/28.FF9461901501/temperature11
/bus.0/28.FF9461901501/temperature12
/bus.0/28.FF9461901501/temperature9
/bus.0/28.FF9461901501/temphigh
/bus.0/28.FF9461901501/templow
/bus.0/28.FF9461901501/type
$ owread /bus.0/28.FF9461901501/temperature
     21.5625

Note that the ow-shell commands only work if the owserver service has been started.

For more information on how OWFS works, including how to configure human readable aliases for the device IDs have a look through the page below :

OWFS Documentation

Contact us now to discuss your project

Ready to order, contact us today for pricing or samples

Contact Us