clewarecontrol

Contents:

Introduction

Clewarecontrol lets you control the USB-devices made by Cleware GmbH.
You can measure the temperature or humidity, switch on and off and configure switches, control the watchdog, etc.
List of their products: click here.

Some of the devices supported (clewarecontrol supports all Cleware devices, these are just examples):
16 port I/O adapter Status display Temperature/humidity sensor Watchdog/switch
0d50:0030 0d50:0008 0d50:0010/0d50:0020 0d50:0008
Accu controller Warning light 4 ports power switch 8 ports power switch
Click on a picture to jump directly to the Cleware product-page.

What you'll find in the tgz-file

The package consists of 'clewaretool' - the tool to manage the Cleware devices under Linux.
Also you'll find in the 'examples'-directory a couple of scripts:
  • a script to generate graphs using RRDtool
  • a script for nagios that monitores the temperature and raises an alarm if something goes wrong
  • a startup script for RHEL/SLES/Debian/Ubuntu which starts the watchdog functionality

Download

Please note that a Linux kernel of at least version 2.6.8 is required.
For older kernels, please contact me.
Download link:clewarecontrol-0.8.tgz
previous versions:clewarecontrol-0.7.tgz
clewarecontrol-0.6.tgz
clewarecontrol-0.5.tgz
Make sure you have the 'usbhid' kernel module loaded.

Tested on

  • Debian etch (on a 64 bit cpu)
  • Fedora core 7
  • RedHat Enterprise Linux 5
  • SuSE Enterprise Linux 10
  • Ubuntu Feisty Fawn (version 7.04)
  • ...but it should also work with other systems running a recent Linux kernel.

Frequently asked questions

It does not compile on SuSE Enterprise Linux 10

Insert in file USBaccessBasic.c at line 17 (that is BEFORE the line including usbdevice_fs.h!) the following line:
#define __user

clewarecontrol -l doesn't list any devices

The Cleware USB library expects the following files to exist:
crw-rw-rw- 1 root root 180,  96 May  9  2005 /dev/usb/hiddev0
crw-rw-rw- 1 root root 180,  97 May  9  2005 /dev/usb/hiddev1
...
crw-rw-rw- 1 root root 180, 110 May  9  2005 /dev/usb/hiddev14
crw-rw-rw- 1 root root 180, 111 May  9  2005 /dev/usb/hiddev15
If those do not exist then 2 situations are possible:
  • they were simply never created
  • your system is using 'udev'
You can verify if udev is used by invoking the following command:
mount | grep udev
When your system uses udev, this will return something looking like this:
udev on /dev type tmpfs (rw,mode=0755)
When using SuSE 9.1 you can replace USBaccessBasic.c by USBaccessBasic-noHIDIOCGSTRING.c and then recompile. I have not tested this myself but I heard it works.

Systems using udev

Append the following line to /etc/udev/rules.d/10-local.rules:
SUBSYSTEM=="usb", KERNEL=="hiddev[0-9]", NAME="usb/hiddev%n", MODE="0666"
After that either reboot your system (preferred) or restart udev with the device unplugged(!).

Systems not using udev

These commands will create the neccessary files:
mkdir -p /dev/usb
for i in `seq 0 15` ; do MINOR=$((i + 96)) ; mknod /dev/usb/hiddev$i c 180 $MINOR ; done

clewarecontrol still can't find any devices

If that still does not give any output then please e-mail me the output of the following commands:
uname -a
lsusb
lsmod
strace clewarecontrol -l
ps -deaf | grep udev
ls -la /dev/usb/hiddev*
Please also tell me what distribution (e.g. redhat/suse/ubuntu) and what version you're using.

Using the 'ampel' (traffic light) device

You might think you need to use the -al commandline parameter to toggle each light. That is not correct. The ampel-device in reality acts as a switch. So you need to use the -as commandline parameter. E.g.:
clewarecontrol -as 2 0
clewarecontrol -as 0 1
In the example above, the first command (the one toggling switch '2') switches off the green lights while the second command switches on light '0' which are the red lights.
You can interface the ampel device to Nagios using NagAmp.

Using the humidity sensors

That happens when the device was not started. In that case, run clewarecontrol with the -ag commandline parameter. After that you can run clewarecontrol with the -rh parameter as often as you like. E.g.:
clewarecontrol -ag
clewarecontrol -rh
Please note that after a power toggle you need to restart the device again before you can use it.


Changes

0.8 cosmetic bug in the 'set switch' output, fixes in the man-page, one can now reprogram a switch/watchdog/autoreset to become one of these three, added some more examples (e.g. use with Nagios)
0.7 switching switches required an switch-index with an offset, that is now fixed. also added example usage scripts for temperature sensor
0.6 fixes to make this tool compile & run on 64 bit systems as well
0.5 temperatures (and possibly humidity too) were not always measured correctly. fixed
0.4 Switching the USB-switch on and off did not work. That is now fixed.
0.3 fixed bug: older versions did not correctly work with switches. that is now fixed
0.3 added a switch making the program output better machine parseable output
0.2 added support for the USB-IO16
0.1 initial release

Problems/bugs?

Please DO NOT contact Cleware if you encounter any problems while using clewarecontrol with Cleware-devices, instead contact me.

Commercial



 
 
Menu with my UNIX/Linux softwareSlashdot It! e-mail me at: folkert@vanheusden.com (CAcert assurer)
April 30, 2008 Please support Seti@Home