Am 08.01.2017 um 14:54 schrieb Ekkehard Pofahl:
> 
> I am using OWFS since more than two years in different versions on a Raspi
> 2. This alone shows, that I think it is a very good program.
> 
> From time to time there is the "85 degree" discussion. It is a clear design
> flaw of the DS 18xxx chips to sent out a valid temperature reading, when an
> error code should be sent out.
> 
Ekkehard, I repeat this again and again and again and again…

The 85°C readout isn't an error message. 85°C is default value which is
in the temperature register after power-on.

What happens during a conversion is the following.

1. You read the .../temperature node of the chip. OWFS sends a
"Convert T" command to the chip. It then waits up to 1s for completion.

2. OWFS sends a "Read Scratchpad" command to the chip. The returned
scratchpad has the current value of the temperature register inside.
Which e.g. is 20.5°C.

3. OWFS returns 20.5 to the calling program


When you have a power failure on the DS18B20 during conversion:

1. You read the .../temperature node of the chip. OWFS sends a
"Convert T" command to the chip. It then waits up to 1s for completion.

2. POWER FAILURE. Conversion on the chip is stopped, and the scratchpad
is loaded with the power-on value: 85°C. OWFS is unaware of this.

3. OWFS sends a "Read Scratchpad" command to the chip. The returned
scratchpad has the current value of the temperature register inside.
Which is 85°C now.

4. OWFS returns 85 to the calling program


> 
> BUT it seems, that within OWFS there are other ways to read 85 degrees.
> 
> E.g. reading temperature value to quick after conversion command. This has
> been reported on also Arduino 1-wire software. Or something else ?
> 
This is perfectly expectable. As long the first conversion isn't
successfully completeted, the scratchpad value is still 85°C. When
someone has constant power failures, he may never been able to complete
a conversion.

Please understand that a lot of people are copying the 4.7k pullup
resistor from the datasheet without thinking too much about it. That
4.7k is a very ambitious value, meant to save as much power as possible.
It isn't possible to power the chip through this resistor during
conversion so you need either

        a powered DS18B20

or

        a strong pullup during the whole conversion time.

Most people simply miss those requirements and wonder why it doesn't
work. My advice always is to

        replace the 4.7k pullup by a 1.5k one.

That way you *never* encounter power failures, even if your program is
not controlling the strong pullup as it should.


> 
> 1) make sure wrong timing is not provoking 85 degree readings on the OWFS
> server
>
Wrong timing doesn't provoke anything like this. The scratchpad always
contains the value from the previous conversion. It's only 85°C in the
case there wasn't a previous conversion.


> 2) filter out 85 degree "somewhere" in OWFS. Otherwise every user of the
> OWFS server needs to do that filtering.
> 3) do statistics on 85 degree reading
> 
No. This has all been taken care for already, OWFS repeats a
.../temperature triggered conversion for the case 85°C is the result.
When you still have stray 85°C readings, it means your power failures
are so serious you should check your hardware setup.


When you want to check for this particular problem, set the default
resolution of the chip to some resolution you never use by writing it to
.../tempres. After a conversion with a *different* resolution, and
encountering a 85°C reading, check whether the ../tempres value has been
reset to the default value.

This is a poor man's POR flag. The chip lacks one, that's a design flaw.

.../tempres is writeable since owfs-3.1p4

Kind regards

        Jan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to