Results 1 to 11 of 11

Thread: Very cheap thermometer connected to WL-500g ?

  1. #1

    Very cheap thermometer connected to WL-500g ?

    Is it possible to make some changes so this thermometer will work on WL-500g?


    beware, there's probably mistake in this wiring - PIN 1 and PIN 14 shouldn't be connected together as there's no need - should be enough to connect only PIN1 or PIN14 (read in forum under article)

    "teplomer.c"
    PHP Code:
    #include <stdio.h>
    #include <unistd.h> 
    #include <sys/io.h> 

    #define DATA 0x378
    #define STATUS DATA+1
    #define CONTROL DATA+2

    float ZmerTo (unsigned short naportuunsigned char odkudint stav

    // return temperature in °C
    // parametert
    // naportu - port where is thermometer connected tomereni
    // odkud  - bit where is thermometer connected tomereni
    // stav - set if is bit "odkud" negated or not

    #define DelkaCyklu  0xffff  //length of cycle

    {
    int t0t1t2;
    int mask = (<< odkud);
    t1=0;
    t2=0;    
     
    for (
    t0 0t0 DelkaCyklut0++)
        
    // measurement
        
    if ((inb (naportu) & mask) == 0t1++ ;
      
    // negation of measurement in case the bit/port is also negated
    t2=DelkaCyklu-t1;
    if (
    stav!=0){
       
    t1=t2;
       
    t2=DelkaCyklu-t1;
        };
    // temperature calculation
    return ((((double)t2 / ((double)DelkaCyklu)) - 0.32) / 0.0047);
    }

    int main (void
    {
    if (
    setuid (0) < 0)
        {   
        
    printf ("Program must be run under root privileges\n");
        exit (
    1);
         }
    if (
    ioperm (STATUS31))
        {
        
    printf ("Program must be run under root privileges\n");
        exit (
    1);
        }
    if (
    ioperm (CONTROL31))
        { 
        
    printf ("No access to port\n");
              exit (
    1);
         }

      
    // set control port to 1 so there is +5V for supply
    outb (52CONTROL);
        
    // temp measurement
    //for LPT port and thermometer connected to LPT PIN 15 
    printf ("Temperature is %4.1f \n",  ZmerTo (STATUS30));

    // set control port to 0 so there is NOT +5V for supply
    outb (55CONTROL);    

    return (
    0);

    translated form article:

    http://www.root.cz/clanky/nejjednodu...line-teplomer/

  2. #2
    I've got a usb to serial adapter (pl2303) with a DS one-wire thermometer.

    I have a DS1820 but the DS18S20 or DS1920 should work fine.

    There is even a package in the feed (digitemp) that can read them for you. You can have multiple sensors attached to the one serial adapter.

  3. #3

    digitemp with wl-500gP

    Quote Originally Posted by sgtwilko View Post
    I've got a usb to serial adapter (pl2303) with a DS one-wire thermometer.

    I have a DS1820 but the DS18S20 or DS1920 should work fine.

    There is even a package in the feed (digitemp) that can read them for you. You can have multiple sensors attached to the one serial adapter.
    Is there a step-by-step guide available?

    I have a usb-serial converter and DS1820 with RS232 adapter. The digitemp ipkg I found is only for DS2490, DS9097 and DS9097U.

    I get the error:
    USB ERROR: owAcquire called with invalid port string

    Please help! What can I do?

  4. #4
    Quote Originally Posted by dyonisos View Post
    Is there a step-by-step guide available?

    I have a usb-serial converter and DS1820 with RS232 adapter. The digitemp ipkg I found is only for DS2490, DS9097 and DS9097U.

    I get the error:
    USB ERROR: owAcquire called with invalid port string

    Please help! What can I do?
    First of all remember the wl500g uses different places for the serial port location than most Linux desktops. It uses the full /dev/usb/tts/???

    The serial port adapter is seen as a DS9097.

    As my serial adapter that I'm using is at the following address /dev/usb/tts/0 I use the following to show all devices on the tree
    Code:
     digitemp_DS9097 -s /dev/usb/tts/0 -w
    See the log when you plug it in to determine what address your device is using, should be 0 unless you have multiple serial adapters.

    Once you have that working and you have all your devices plugged in and can see them on the tree walk, initialise the config file by running:
    Code:
    digitemp_DS9097 -i
    I think this creates a file in /opt/ called .digitemprc (I can't remember if I renamed mine)

    Mine looks like this...
    Code:
    TTY /dev/usb/tts/0
    READ_TIME 1500
    LOG_TYPE 1
    LOG_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F"
    CNT_FORMAT "%b %d %H:%M:%S Sensor %s #%n %C"
    HUM_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F H: %h%%"
    SENSORS 1
    ROM 0 0x11 0x0A 0x98 0x11 0x10 0x18 0x44 0x5B
    The initialise will walk the tree and find the sensors and add them to the file.
    Every time you change what sensors are attached you will need to add the addresses to the file or re-initialise.
    This isn't as stupid as it might sound. Just because the order of the sensors is one way round today, doesn't mean than the devices will start-up and report in the same order tomorrow. Ironically, temperature can have a big effect on the start-up of these little parasitic devices.

    In the above file, I think I added the read_time to stabilise the usb serial adpaters I'm using, as they don't quite provide enough voltage for 100% reliability.

    I then call
    Code:
     digitemp_DS9097 -c /opt/.digitemprc -a
    This returns
    Code:
    DigiTemp v3.4.0 Copyright 1996-2005 by Brian C. Lane
    GNU Public License v2.0 - http://www.digitemp.com
    Jun 18 18:24:16 Sensor 0 C: 22.75 F: 72.95
    But the format is changeable (I've changed mine in the config file) and if you use the -l logfile option the copyright text isn't logged.

    For more information see the help files (Readme, etc) that are in the following.
    http://www.digitemp.com/software/lin...p-3.4.0.tar.gz

    To answer a question I got via PM by a different user (strange in the same week getting two questions on something I posted last year), that may or may not help others, I'm using the wl500g Delux with the usb2 ports. I have found that plugging usb1 devices into it sometimes doesn't work unless they are plugged into a usb1 hub that is plugged into the wl500 directly. So I effectivly have one usb2 port on the asus that I have a usb2 hub on (for my Toppy and external hardisk) and the other for the serial adapters and the usb memory I use to boot with.

    I never got the pl2303 adapters to work plugged into a usb2 hub, after some searching I found that there is a Linux kernel bug that stops this from working.

    SgtWilko

  5. #5
    Quote Originally Posted by sgtwilko View Post
    First of all remember the wl500g uses different places for the serial port location than most Linux desktops. It uses the full /dev/usb/tts/???

    The serial port adapter is seen as a DS9097.

    As my serial adapter that I'm using is at the following address /dev/usb/tts/0 I use the following to show all devices on the tree
    Code:
     digitemp_DS9097 -s /dev/usb/tts/0 -w
    See the log when you plug it in to determine what address your device is using, should be 0 unless you have multiple serial adapters.

    Once you have that working and you have all your devices plugged in and can see them on the tree walk, initialise the config file by running:
    Code:
    digitemp_DS9097 -i
    I think this creates a file in /opt/ called .digitemprc (I can't remember if I renamed mine)

    Mine looks like this...
    Code:
    TTY /dev/usb/tts/0
    READ_TIME 1500
    LOG_TYPE 1
    LOG_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F"
    CNT_FORMAT "%b %d %H:%M:%S Sensor %s #%n %C"
    HUM_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F H: %h%%"
    SENSORS 1
    ROM 0 0x11 0x0A 0x98 0x11 0x10 0x18 0x44 0x5B
    The initialise will walk the tree and find the sensors and add them to the file.
    Every time you change what sensors are attached you will need to add the addresses to the file or re-initialise.
    This isn't as stupid as it might sound. Just because the order of the sensors is one way round today, doesn't mean than the devices will start-up and report in the same order tomorrow. Ironically, temperature can have a big effect on the start-up of these little parasitic devices.

    In the above file, I think I added the read_time to stabilise the usb serial adpaters I'm using, as they don't quite provide enough voltage for 100% reliability.

    I then call
    Code:
     digitemp_DS9097 -c /opt/.digitemprc -a
    This returns
    Code:
    DigiTemp v3.4.0 Copyright 1996-2005 by Brian C. Lane
    GNU Public License v2.0 - http://www.digitemp.com
    Jun 18 18:24:16 Sensor 0 C: 22.75 F: 72.95
    But the format is changeable (I've changed mine in the config file) and if you use the -l logfile option the copyright text isn't logged.

    For more information see the help files (Readme, etc) that are in the following.
    http://www.digitemp.com/software/lin...p-3.4.0.tar.gz

    To answer a question I got via PM by a different user (strange in the same week getting two questions on something I posted last year), that may or may not help others, I'm using the wl500g Delux with the usb2 ports. I have found that plugging usb1 devices into it sometimes doesn't work unless they are plugged into a usb1 hub that is plugged into the wl500 directly. So I effectivly have one usb2 port on the asus that I have a usb2 hub on (for my Toppy and external hardisk) and the other for the serial adapters and the usb memory I use to boot with.

    I never got the pl2303 adapters to work plugged into a usb2 hub, after some searching I found that there is a Linux kernel bug that stops this from working.

    SgtWilko

    Many Thanks SgtWilko!

    It is working perfectly. The silly error was the wrong device /dev/tts/x instead of /dev/usb/tts/x
    I suspected a DS9097 issue because of various statements that this simple serial adapter is flaky.

    On the wl-500g Premium only hub1 do work. If you want USB2 performance you have to connect directly to Asus. That' s strange also.

    Regards
    Dyonisos

  6. #6

    connecting 2 sensors on 1-Wire bus

    How could I connect two temp sensors (DS1820(S)) on the bus? Just hook it up parallel on a 20m CAT5 cable? Please let me know.

  7. #7
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    736
    Quote Originally Posted by dyonisos View Post
    How could I connect two temp sensors (DS1820(S)) on the bus? Just hook it up parallel on a 20m CAT5 cable? Please let me know.
    Yes. Its simple like that.

  8. #8

    1-wire bus distance

    Quote Originally Posted by oleo View Post
    Yes. Its simple like that.
    Thanks oleo.
    Do you know the bus distance that could be covered with the passive serial to 1-wire adapter and e.g. 2 sensors? I would like to cover approx. 20m.

  9. #9
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    736
    You could try my http://www.lecad.si/~leon/other/wlan/wrt54ow
    but never tried more than few meters. I suspect that for 20 meters you need edge control.

  10. #10
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt a.M.
    Posts
    299
    Hi there,

    i want to run at least 2 temp sensors on my wl500gP,

    Should I bought 2 of these: LINK ?

    Can somebody write a short how-to?

    Thanks in advance.
    WL-500gP => 1.9.2.7-7g (2007-04-06)
    Running: thttpd, php 5.1, vsftp, rrdtool

    http://onlinefussballmanager.de/userbar/0/53647.png

  11. #11
    I can't find the exact article but www.digitemp.com has a lot of info..

    A quick google provides the following:
    http://www.idtsoft.com/projects/yuki/dthowto.txt - which is as close to the original as I can remember.
    http://www.ban-solms.de/t/IPCop-digitemp.html - Which does provide pictures for those who need there hand held, but I haven't verified that's exactly what Brian described and Brians note does reference a Doc with the diagram in it...

    SgtWilko

Similar Threads

  1. Replies: 2
    Last Post: 07-12-2006, 01:50
  2. 500g vs 550gE...What's the actual difference?
    By stmok in forum WL-550gE Pics & Specs
    Replies: 4
    Last Post: 04-07-2006, 12:58
  3. ASUS 500G Deluxe remotely configure it
    By orzad in forum WL-500g Q&A
    Replies: 0
    Last Post: 10-03-2006, 13:45
  4. tale of a sad 500g owner
    By oferlaor in forum WL-500g Q&A
    Replies: 1
    Last Post: 15-10-2004, 16:27

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •