I have two DS18B120 1-Wire temperature sensors connected to my PI and working. I then also start a Flask server to stream video using this code.

Everything works fine individually but if I try to read the temp sensors after the video has been streaming for a few seconds, the sensors aren't found. In fact, both "28-xxxx" directories (under /sys/bus/w1/devices) disappear. Once I stop streaming the video the directories reappear again after a few seconds.

The issue is I need to asynchronous;y read the temperature values (using AJAX requests) while the video is also streaming. Obviously I can't get it to work this way.

Shouldn't this be doable or is it possible that I am overwhelming the PI? Any hints or workarounds would be appreciated.

  • How are you reading the sensors? Post your code. – Milliways Feb 9 '16 at 1:15
  • I have tried both reading the files in the device directories directly and using the the W1ThermSensor (github.com/timofurrer/w1thermsensor) library – Mark Wagoner Feb 9 '16 at 1:55
  • The 1-wire module can conflict with the Pi Camera see this bug report: github.com/raspberrypi/linux/issues/435 – Craig Feb 9 '16 at 20:30
  • Thanks @Craig. I tried all of the work-arounds they mentioned but it still won't work. I guess maybe it's not possible. – Mark Wagoner Feb 11 '16 at 1:40

The timing requirements for the DS18B20 (Dallas 1-wire bus system) are quite tight, and the kernel driver depends on interrupts to read each bit. Unfortunately interrupt latency and processing time can get jittery even within the kernel when the system is busy. Video streaming is a fairly busy activity.

I am not aware of a solely Pi based solution using those sensors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.