19 Aug 2009

Digi Watchport/H USB Serial Humidity/Temperature Sensor in Linux

Using Digi Watchport/H USB Serial Humidity/Temperature Sensor in Linux

Ubuntu 9.04 has everything you need except for minicom. So all I had to do was to:

  • plug it in

    dmesg should get you the following output:

      usb 2-9: new full speed USB device using ohci_hcd and address 50
      usb 2-9: configuration #1 chosen from 1 choice
      io_ti 2-9:1.0: Edgeport TI 1 port adapter converter detected
      usb 2-9: Edgeport TI 1 port adapter converter now attached to ttyUSB0'
    
  • Install minicom:

      sudo apt-get install minicom
    
  • Edit minicom settings:

      minicom -s
    
    1. Change the ‘Serial Device’ to ‘/dev/ttyUSB0’

    2. Change the ‘Bps/Par/Bits’ field to ‘9600 8N1’, (9600 baud, 8 bits, no parity, 1 stop bit). These are the default settings used by the Linux kernel; they can, if necessary, be overridden from the kernel command line by adding extra parameters to the ‘console=’ option. See ‘kernel-parameters.txt’ and ‘serial-console.txt’.

    3. Turn off both ‘Hardware Flow Control’ and ‘Software Flow Control’.

    4. In the ‘Modem and dialing’ menu, remove the ‘Init string’ and ‘Reset string’ completely if required.

    5. Save your new config

    6. start minicom

    7. more details

  • Use one of the following commands:

<td>
    Description
</td>

<td>
    Return Value
</td>
</tr>

<tr>
<td>
    ?<CR>
</td>

<td>
    Tells about the command set available for this Watchport
</td>

<td>
    as described in this section
</td>
</tr>

<tr>
<td>
    I<CR>
</td>

<td>
    Tells what kind of Watchport is connected.
</td>

<td>
    Watchport/H<CR>
</td>
</tr>

<tr>
<td>
    H<CR>
</td>

<td>
    Gives the percentage relative humidity.
</td>

<td>
    38%<CR>
</td>
</tr>

<tr>
<td>
    T<CR>
</td>

<td>
    Gives temperature in Celsius.
</td>

<td>
    +22.2500C<CR>
</td>
</tr>

<tr>
<td>
    TC<CR>
</td>

<td>
    Also gives temperature in Celsius.
</td>

<td>
    +22.2500C<CR>
</td>
</tr>

<tr>
<td>
    TF<CR>
</td>

<td>
    Gives temperature in Fahrenheit.
</td>

<td>
    +72.0000F<CR>
</td>
</tr>

<tr>
<td>
    TF+<CR>
</td>

<td>
    Repeats the TF command every 3-4 seconds until the next keystroke. Appending + also works with the TC and H commands
</td>

<td>
    +72.0000F<CR>
</td>
</tr>

<tr>
<td>
    L4<CR>
</td>

<td>
    Adjusts the slew rate of the data line. When “L” is followed by a numeric value, 1 through 8, Watchport responds with OK. Other values return Invalid Command. The default setting is 4. Adjust the parameter until the data transmission becomes error-free. The setting remains in effect until the Watchport is power-cycled.
</td>

<td>
    OK
</td>
</tr>
Command

Download Watchport’s manual

Now all I need is a perl script to automate the posting of these values to twitter?