Aspire :: OSGi Bundles :: TEMPerProducer



This section describes the bundle for TEMPer sensor

Context

The TEMPer is a USB-to-serial low-cost thermometer. It can be ordered from many websites. One of the cheapest is http://www.dealextreme.com/details.dx/sku.7003 .

The TEMPerProducer bundle registers one Producer service producing Measurement, Double or String objects (unit is K).

WARNING:
as seen on the Internet, there are two versions of this stick. The current bundle has been tested with the gray version (old one apparently). A blue version exists, with a different data transmission protocol.

Dependencies

This bundle requires :

  • OSGi R4 Compendium, available from OBR in Felix Shell
  • RXTX, available from Aspire SVN Repository/archive/rfidsuite/rfidsuite/bundles/rxtx/

Build

Sources

  • trunk/bundles/sensors/temperproducer/

Device installation

Under Windows
  1. you must install the USB-to-Serial driver on your host with the CD provided with the USB stick (USB Driver/setup.exe).
  2. you may install the demonstration application (CD > TEMPer V8.1/setup.exe) to test the thermometer.
  3. inspect the serial COM port from "System Properties > Hardware > Device Management > Ports (COM and LPT) > USB-SERIAL (COMxx)"
Under Linux
  1. put the device on a USB port
  2. In dmesg, you should see a line like : usb 7-2: ch341-uart converter now attached to ttyUSB0
  3. In this case, ttyUSB0 is the serial port to use to read data from the stick.
WARNING:
Reading serial ports through /dev requires root rights.
Some hints to bypass that problem may be given here later.

Then

  1. cd trunk/bundles/sensors/temperproducer
  2. configure the serial port in src/main/java/org/ow2/aspirerfid/sensor/temperproducer/TEMPerProducer.java
  3. mvn clean install

Configuration

You must configure the properties for your dongle in the source (currently).
The default values are a COM14 port and a poll each 2 seconds.

See org/ow2/aspirerfid/sensor/temperproducer/TEMPerProducer.java

  • Hard coded COM port :
    • Default Value : String portName = "COM14";
    • Under Linux, you should use : String portName = "/dev/ttyUSB0";
  • Poll delay :
    • Default value : int POLLDELAY = 2000;

Artifacts

The artifact to deploy is
  • org.ow2.aspirerfid:org.ow2.aspirerfid.temperproducer
  1. Tests

Under Linux

Tested under Fedora 13 (64 bits), kernel 2.6.33, with included driver

It seems that there is an alternance between a correct value and a constant value.
All the results looked like :

    529.0875 K
    305.15 K
    529.0875 K
    305.65 K
    529.0875 K
    308.15 K
    529.0875 K

Where 305 K is a correct value (around 30°C), and 529.0875 (around 255.9°C) seems to be a control value.

Under Windows

Tested under Windows 7 Professional (32 bits), with the provided driver (on the CD-Rom).

Works fine, no problem found.