Beaglebone

Using BeagleboneBlack with 1-Wire ds2482-800 and OWFS software

This page is about  using and installing OWFS software on the beaglebone black (BB) mini pc.
The BB is standard installed with the linux Angstrom OS.  Angstrom is based on busybox, it's no use to me.  I choose to use Debian 7.0 (wheezy), see here how to install it.
Rev C  BB is now standard installed with Debian.
I've also a linux Centos 7.x server running, which is being used a nfs fileserver, rrdtools and  logserver to reduce wear and tear  of the flash memory.
Logserver  configuration:
On the BB in  /etc/rsyslog.conf at the bottom:  *.*   @@logserver.example.com:514
On the logserver in /etc/rsyslog.conf before any rules:
:msg, startswith, "beaglebonehostname" /var/log/beaglebonehostname.log
& ~
:fromhost-ip,isequal,"beaglebone ip ddress" /var/log/beaglebonehostname.log
& ~

Remote rrdtools:
On the server in /etc/xinetd.d/rrdsrv:

service rrdsrv
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        server          = /usr/bin/rrdtool
        server_args     = -
}

in /etc/services:
rrdsrv         13900/tcp                       # RRD server

Example perl script for owfs and rrdtools.

I've written a Drupal 7 module to administer the 1wire devices, temperature controls, timers etc in a mysql database  and a perl control script which am i using to control my greenhouse. See http://kas.cuora.nl
download here

 

A webinterface to control the central heating  for example

 

Software installation

The 1-wire owfs software is in the Debian software repository:
apt-get install owfs owfs-common owfs-fuse owftpd owhttpd owserver i2c-tools

Hardware 1-wire

All GPIO's of the BB have a logic level of 3.3V.   To use the 1wire device at 5V a logic bidirectional level shift is necessary, this can be done with the use of a nmos FET, see the Philips application note an97055

In this schematic there are 3 DS2482-800 devices on a I2C bus, all with there own address at pins 6,7,8.

To probe the I2C bus:

/usr/sbin/i2cdetect -r 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- 18 19 1a -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Address 000 at IC1 will be 18.


OWFS

Start owserver:
/usr/bin/owserver --i2c=/dev/i2c-1:ALL

 

 

 

owdir example, it will show 24 busses and 3 ds1820:
/28.701DA7020000
/28.DA419B010000
/28.6B57A7020000
/bus.23
/bus.22
/bus.21
/bus.20
/bus.19
/bus.18
/bus.17
/bus.16
/bus.15
/bus.14
/bus.13
/bus.12
/bus.11
/bus.10
/bus.9
/bus.8
/bus.7
/bus.6
/bus.5
/bus.4
/bus.3
/bus.2
/bus.1
/bus.0
/uncached
/settings
/system
/statistics
/structure
/simultaneous
/alarm

 

 

 

My project,  it has 16/24 1-wire buses, 8 IO outputs for solidstate ralays, 6 reedrelays and 4 ADC inputs.

 

Mini version, 8 1wire buses (ds2482-800),  8 IO outputs (2 relais) and 2 ADC inputs

 

 

GPIO ports

Free available GPIO ports of the BB which i am using to drive solidstate and reed relays:

Address BB connector
45 P8_11
44 P8_12
23 P8_13
26 P8_14
47 P8_15
46 P8_16
27 P8_17
65 P8_18
60 P9_12
50 P9_14
48 P9_15
51 P9_16
49 P9_23
115 P9_27

I've added a buffer 74hct244 on these GPIO outputs, to drive solidstate and reedrelays directly.   74hct is ttl level (2V).   
  Don't use this for inputs, max  input voltage is 3.3V!
 

To alter state to high of port 45 at pin P8 11:
echo 45 > /sys/class/gpio/export
echo high > /sys/class/gpio/gpio45/direction
 

ADC ports

MAX input voltage of the ADC ports AIN0-6 is 1.8V.
To enable analog AIN ports:
echo cape-bone-iio > /sys/devices/bone_capemgr.9/slots.  
Only ports AIN  1 4 5 6   are free available,   the rest is being used for a LCD touchscreen cape.

To read the voltageat AIN1:
cat /sys/devices/ocp.2/helper.14/AIN1  

There is also a raw counter:
cat /sys/bus/iio/devices/iio\:device0/in_voltage1_raw. For me the correction factor with the use of the voltage divider was about 0.00135.

Some scripts for testing.

Hardware:

Conrad:

  • 532665 PB Fastener Wire spool set Wire spool set
  • 531397 SMD EURO-PCB 160 X 100 X 1.6MM

 

Reference:

BeagleBoardDebian - eLinux.org
Robots and electrons: Bringing up a new cape for the Beaglebone Black
Using BeagleBone Black GPIOs - armhf.com
BeagleBone GPIO Adi's
Reading analog (ADC) values on BeagleBone black | Hipstercircuits
BeagleBone GPIO Testing
8 Port 1-Wire Cape Setup Instructions for Ångström OS | www.by-innovation.com

Ulterius