many years ago.... i get this problem, i did this in php code:

read
if value = 85c, read again
then i get the right value

this worked only for 18?20 maybe a startup problem, but this workaround
worked (read a 9bits first and after a 12bit maybe faster if you want 85c
value, but if you don't want, only one 12bit value (!=85c) are faster than 2
reads)

bye

2008/8/30 Paul Alfille <[EMAIL PROTECTED]>

> Do you want to try this patch and see if it helps? Essentially we are
> filtering for 85C and retrying unpowered.
> Index: module/owlib/src/c/ow_1820.c
> ===================================================================
> RCS file: /cvsroot/owfs/owfs/module/owlib/src/c/ow_1820.c,v
> retrieving revision 1.101
> diff -B -b -w -i -U3 -r1.101 ow_1820.c
> --- module/owlib/src/c/ow_1820.c    18 Jun 2008 15:05:44 -0000    1.101
> +++ module/owlib/src/c/ow_1820.c    30 Aug 2008 18:41:15 -0000
> @@ -578,6 +578,7 @@
>      BYTE pow;
>      int res = Resolutions[resolution - 9].config;
>      UINT delay = Resolutions[resolution - 9].delay;
> +    UINT longdelay = delay * 1.5 ; // failsafe
>      BYTE mask = Resolutions[resolution - 9].mask;
>      int oldres;
>      struct transaction_log tunpowered[] = {
> @@ -590,6 +591,12 @@
>          TRXN_WRITE1(convert),
>          TRXN_END,
>      };
> +    // failsafe
> +    struct transaction_log tunpowered_long[] = {
> +        TRXN_START,
> +        {convert, convert, longdelay, trxn_power},
> +        TRXN_END,
> +    };
>      //LEVEL_DATA("OW_22temp\n");
>      /* powered? */
>      if (OW_power(&pow, pn)) {
> @@ -614,6 +621,7 @@
>      }
>
>      /* Conversion */
> +    // first time
>      if (!pow) {                    // unpowered, deliver power, no
> communication allowed
>          LEVEL_DEBUG("Unpowered temperature conversion -- %d msec\n",
> delay);
>          if (BUS_transaction(tunpowered, pn)) {
> @@ -634,12 +642,35 @@
>      if (OW_r_scratchpad(data, pn)) {
>          return 1;
>      }
> -    //printf("Temperature Got bytes %.2X %.2X\n",data[0],data[1]) ;
> +    if ( data[1]!=0x05 && data[0]!=0x50 ) { // not 85C
> +        temp[0] = (_FLOAT) ((int16_t) ((data[1] << 8) | (data[0] & mask)))
> * .0625;
> +        return 0;
> +    }
> +
> +    // second time
> +    LEVEL_DEBUG("Temp error. Try unpowered temperature conversion -- %d
> msec\n", delay);
> +    if (BUS_transaction(tunpowered, pn)) {
> +            return 1;
> +    }
> +    if (OW_r_scratchpad(data, pn)) {
> +        return 1;
> +    }
> +    if ( data[1]!=0x05 && data[0]!=0x50 ) { // not 85C
> +        temp[0] = (_FLOAT) ((int16_t) ((data[1] << 8) | (data[0] & mask)))
> * .0625;
> +        return 0;
> +    }
>
> -    //*temp = .0625*(((char)data[1])<<8|data[0]) ;
> -    // Torsten Godau <[EMAIL PROTECTED]> found a problem with 9-bit
> resolution
> +    // third and last time
> +    LEVEL_DEBUG("Temp error. Try unpowered long temperature conversion --
> %d msec\n", longdelay);
> +    if (BUS_transaction(tunpowered_long, pn)) {
> +            return 1;
> +    }
> +    if (OW_r_scratchpad(data, pn)) {
> +        return 1;
> +    }
>      temp[0] = (_FLOAT) ((int16_t) ((data[1] << 8) | (data[0] & mask))) *
> .0625;
>      return 0;
> +
>  }
>
>  /* Limits Tindex=0 high 1=low */
>
>
> On Sat, Aug 30, 2008 at 12:55 PM, Christof Egner <[EMAIL PROTECTED]>wrote:
>
>> Hello,
>>
>> I'm using several DS18B20 in powered mode connected to a DS9490R USB
>> adapter. OWFS version is 2.7p4 (I have tried today's CVS version, too).
>>
>> The temperature is always showing 85C, which seems to be some kind of
>> error code. But reading the sensors with digitemp works.
>>
>> I saw some older post regarding this topic, but I couldn't find a
>> general solution.
>>
>> Is there a patch available? Any hints?
>>
>>
>> Regards,
>> Christof
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Owfs-developers mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>>
>
>  ------------------------------
> E-mail verificado pelo Terra Anti-Spam.
> Para classificar esta mensagem como spam ou não spam, clique 
> aqui<http://mail.terra.com.br/cgi-bin/reportspam.cgi?+_d=SCYxNjA1NTM3MSNwZXJtIXRlcnJhJjEsMTIyMDEyMTg5OC4zMzc4MDYuMTA1NTMuZGluZ28uaHN0LnRlcnJhLmNvbS5iciwxNDU5Ng==>
> .
> Verifique periodicamente a pasta Spam para garantir que apenas mensagens
> indesejadas sejam classificadas como Spam.
>
> ------------------------------
>  Esta mensagem foi verificada pelo E-mail Protegido 
> Terra<http://mail.terra.com.br/>
> .
> Atualizado em 30/08/2008
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to