Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Timo Furrer
@timofurrer
Can you try to ask for the type with owfs ?
the type of the sensor?
You could also try to re-install your pi - taking the latest linux
and ONLY install w1thermsensor, but not the owfs library
mikespolk
@mikespolk
Yes, I will answer soon..
So, the types of my sensors, found with the owfs object "type" property; The other lists as DS18B20, and the other as DS18S20 (though has DS1820 printed in its TO-92 case.
mikespolk
@mikespolk
For the pi reinstall, I think that I just did that, by downloading two days ago the NOOBS/Raspbian images, and absolutely without the ow library
But for the bsimmo's post (You need to talk to the HAT with i2c...This module doesn't do that.)
What does this mean in my case?
Hope it does not however mean that I can't get your module to work, since I am having the 1-Wire adapter card?
mikespolk
@mikespolk
For me, that adapter is essential, to avoid any electrical spikes from long sensor cabling, directly to rpi's GPIO bus.
Going to sleep now for today.
I really appreciate your help and answers, thank you so far!
erolfr
@erolfr
hey, firstly nice work.
pi@raspberrypi:~ $ sudo time w1thermsensor all
Got temperatures of 5 sensors:
Sensor 1 (0516b577ffff) measured temperature: 24.56 celsius
Sensor 2 (0416c1d597ff) measured temperature: 27.5 celsius
Sensor 3 (0416c20a7bff) measured temperature: 30.5 celsius
Sensor 4 (0416c21372ff) measured temperature: 26.0 celsius
Sensor 5 (0416c25b2aff) measured temperature: 25.5 celsius
1.12user 0.14system 0:05.56elapsed 22%CPU (0avgtext+0avgdata 15420maxresident)k
0inputs+0outputs (0major+2390minor)pagefaults 0swaps
Timo Furrer
@timofurrer

hey, firstly nice work.

You are welcome :tada:

erolfr
@erolfr
is this a normal time? Or I do something wrong
Timo Furrer
@timofurrer
Can you check how long it takes to read the sensor file directly?
erolfr
@erolfr
its an raspi 3b+
Timo Furrer
@timofurrer
Do you know where the sensor files are?
Can you measure how long it takes to do sudo on your raspi?
time sudo echo "Hello"
erolfr
@erolfr

time cat /sys/bus/w1/devices/28-0416c21372ff
cat: /sys/bus/w1/devices/28-0416c21372ff: Ist ein Verzeichnis

real 0m0,008s
user 0m0,001s
sys 0m0,007s

pi@raspberrypi:~ $ time sudo echo "Hello"
Hello

real 0m0,131s
user 0m0,023s
sys 0m0,017s

Timo Furrer
@timofurrer
Can you read the w1_slave file from the directory?
Where it said "Is ein Verzeichnis" ?
erolfr
@erolfr

pi@raspberrypi:~ $ time cat /sys/bus/w1/devices/28-0416c21372ff/w1_slave
a0 01 4b 46 1f ff 1f 10 e6 : crc=e6 YES
a0 01 4b 46 1f ff 1f 10 e6 t=26000

real 0m0,938s
user 0m0,001s
sys 0m0,032s

sry
Timo Furrer
@timofurrer
And how long did your 5 sensor read take?
erolfr
@erolfr
like 5 seconds :D. That means is normal?
Timo Furrer
@timofurrer
Seems like it - reading the w1_slave file from the kernel modules takes almost 1s itself ... (> real 0m0,938s)
so adding up those 5 sequential sensor reads - 5 seconds seems pretty much possible
You could do some threading to read those
since it's IO, threading helps
This summer I'll take some time to implement asyncio support into w1thermsensor
that would help to if you are in an asyncio environment
erolfr
@erolfr
thank you
Timo Furrer
@timofurrer
Bitte :)
erolfr
@erolfr
w1thermsensor precision funktioniert macht in der Abfragezeit nur kein Unterschied :(
sergeantpol
@sergeantpol
Hello and thanks for that beautiful code. Do you know how can I only use the 12-bits resolution?
sergeantpol
@sergeantpol

oh I found it, Some w1 therm sensors support changing the resolution for the temperature reads. w1thermsensor enables to do so with the W1ThermSensor.set_resolution() method:

sensor = W1ThermSensor(W1ThermSensor.THERM_SENSOR_DS18B20, "00000588806a")
sensor.set_resolution(9)

Timo Furrer
@timofurrer
Great!