question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, Great library. I have used it successfully for groups of sensors. Something I have noticed and been unable to resolve:

from w1thermsensor import W1ThermSensor
os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
while True:
    for sensor in W1ThermSensor.get_available_sensors():
        print("Sensor %s has temperature %.2f" % (sensor.id, sensor.get_temperature()))
   time.sleep(10)

the above works fine and if I run the program with 3 sensors I get a line for each.
If I then stop the program and remove a sensor and run it again it returns this message : “w1thermsensor.core.SensorNotReadyError: Sensor is not yet ready to read temperature”

What do I need to do to clear the old list of sensors and start over. ?

thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
petert100commented, Dec 6, 2016

Timo, Thank you very much. Those things make sense. M usual Python goto guy ( my son) is en route via the Alaska Highway to Anchorage and is out of touch. so I really appreciate your taking time to help me.

thanks again. Peter

On Mon, Dec 5, 2016 at 10:47 PM, Timo Furrer notifications@github.com wrote:

You didn’t import the w1thermsensor module - You did from w1thermsensor import W1ThermSensor at the top which only imports the W1ThermSensor class from the w1thermsensor package.

Replace it with from w1thermsensor import W1ThermSensor, SensorNotReadyError and change the except line to: except SensorNotReadyError:.

These are some really basic python things, so I suggest you to go through some tutorials to learn those. You’ll see - it won’t be hard at all. 🍻

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timofurrer/w1thermsensor/issues/28#issuecomment-265066585, or mute the thread https://github.com/notifications/unsubscribe-auth/ADDPs2slhLOpaRJyxqWpRgyhDpv3DOuoks5rFPb_gaJpZM4LEogh .

– Peter Carman

307.690.1881 cell 307.733.2389 land line

0reactions
timofurrercommented, Jun 18, 2019

@natanbenchimol you’ve already opened an issue for your problem #55 , let’s keep this one clean 😃

Thanks @petert100 and @natanbenchimol 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

timofurrer/w1thermsensor - GitHub
A Python package and CLI tool to work with w1 temperature sensors like DS1822, DS18S20 & DS18B20 on the Raspberry Pi, Beagle Bone...
Read more >
w1thermsensor - PyPI
This little pure python module provides a single class to get the temperature of a w1 sensor.
Read more >
PythonMiniProbe - w1thermsensor - GitLab - CDG82
W1ThermSensor ![Gitter](https://badges.gitter.im/Join Chat.svg). This little pure python module provides a single class to get the temperature of a w1 therm ...
Read more >
timofurrer/w1thermsensor - Docker Image
W1ThermSensor. Gitter. Get the temperature from your w1 therm sensor in a single line of code! It's designed to be used with the...
Read more >
timofurrer/w1thermsensor - Gitter
oh I found it, Some w1 therm sensors support changing the resolution for the temperature reads. w1thermsensor enables to do so with the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found