Open sokol07 opened 2 years ago
Using an oscilloscope I determined that the responses from the DS18B20 were valid but for some reason not read correctly by the STM32. I moved the task so it is created first (I don't remember whether the order of task creation matters on their execution but I think I have read that they are executed subsequently as created (as long there isn't some kind of flow control) and changed its priority to higher than any other task. For now the sensor is working correctly, it is starting without problems and keeps working without invalid data with refresh rate of 450ms (I had some invalid data with lower refresh times).
I'll keep watching the device, if the problem is solved we can consider this issue closed but I suggest adding a note to library readme to point out that the task priority can be an issue.
Unfortunately, increasing the priority only seemed to fix the issue - it worked for some time but today the same code doesn't read the temperatures correctly (i get only one valid read in a dozen). The problem lies somewhere else and the DS18B20 is still unusable. Therefore, the issue is still open...
Hi, I am using your code with STM32F411 (disco board) and some chinese probe based on DS18B20. I am using CubeIDE but I've modified a few places in code to let is find all definitions and I've got the code running. However, the temperature read from DS18B20 is extremely unstable and unreliable, making the sensor totally unusable. The task is called as it should be, the DS18B20 address is detected correctly (I can see the address in the debug), usually the temperature is read correctly once and then the data is not read (isValid=0) for dozen seconds (sometimes minutes). After this time the data is read once again and then is invalid again.
Sometimes the situation is even worse - I don't even get the address of the DS18B20.
I lowered the update interval timeout to 1000ms but this doesn't seem to cause the issue because I have the same problems when the timeout is set to 10000ms or even 20000ms.
Is there something I am missing which causes these problems? Can this be made more reliable some way?
EDIT - after some debugging I see that the issue is the CRC which is invalid (crc is not equal to data[8]). There are values within data[] are partially just series of 1s like this:![image](https://user-images.githubusercontent.com/39523480/138096579-f2b34218-d5b6-4b39-97da-88a081b153d0.png)