1-wire occasionally stops working
pavel.cernocky last edited by
I have several temperature sensors connected via 1-wire to Neuron and occasionally all of them stops working. Sometimes they work for one day, sometimes for several months.
In Mervis in variables in debug mode I see Communication error True and the temperature is zero.
On the status screen I see:
Sent packets 2746181
Received packets 2441053
Wrong packets 4
Packet error ration 0.0%
Don't know why is the difference between sent/received packets that big and how it corresponds with wrong packets and error ratio.
(Wanted to paste image here, but it doesn't work)
I tried restarting Raspberry, but not sure whether it could help. Is the 1-wire bus connected directly to PLC or is it connected through Raspberry and then to PLC?
I also tried setting OW_off_1 to true and then back to false (as found elsewhere on the forum), but it didn't help. Is this switching to true and false the right approach?
The only thing which helps is powering off and on the whole Neuron and that's really not what I can use in practice.
I have shielded cables and serial topology, but it's possible there are some communication errors anyway. I think that the controller should be able to recover from that errors and not stuck forever.
I have found several posts in forum complaining about similar behavior, so it seems it's quite common problem.
Could you please guide me to some solution? Or is it necessary to make a fix on Unipi side?
I have a similar problem. I now made e workaround with a shell script that restart the 1-wire bus after a fixed time. It's not nice but it works for me.
#!/bin/sh mbpoll -m tcp -a 0 127.0.0.1 -t 0 -0 -r 1001 1 && mbpoll -m tcp -a 0 127.0.0.1 $ while sleep 120; do echo start mpoll 'date' mbpoll -m tcp -a 0 127.0.0.1 -t 0 -0 -r 1001 1 && mbpoll -m tcp -a 0 127.0.0.1 $ done
pavel.cernocky last edited by
OK, seems promising. I'll try it on next failure and will reply back.
Thanks a lot!
pavel.cernocky last edited by pavel.cernocky
So the 1 wire stopped working again. I tried running the
mbpollcommand from Stefan, but it's not working.
Not sure whether the
$on the end of the line is some typo, it seems not valid,
As I understand it, the command tries to set modbus coil 1001, which is named 'Enable/Disable 1Wire Bus' in Neuron documentation.
It seems the Mervis variable
OW_off_1is mapped to the same modbus coil, so turning it on/off should do the same thing. (UPDATE: confirmed by updating the variable in Mervis and watching by
Any other ideas?
AVsetula administrators last edited by AVsetula
In these cases, this guide can help: https://kb.unipi.technology/en:sw:01-mervis:automatic-restart-of-1-wire-hidden
Unfortunately, if you have improperly processed cabling, or if you have a large number of sensors connected to this bus, you cannot achieve the desired stability, because the 1-Wire bus is very sensitive to interference.
In this case, I recommend checking the wiring to make sure you have all unused wires and the cable shield connected to the ground terminal. Next, check the length of the bus and the number of sensors on the bus.
An alternative to this connection is also the connection of sensors via Extension xG18, which has 8 separate 1W channels, each reserved for one sensor. Perhaps the only disadvantage of this module is that it is possible to connect only sensors DS18b20 and supporting parasitic power.
Finally, I also recommend reading this article about 1-Wire: https://kb.unipi.technology/en:automation:02-glossary:1wire-hidden
I have the same problem but I use NodeRed and EVOK API.
All the sensors connected directly to my Neuron L203 started showing a constant temperature out of nowhere, which was very dangerous. However, the sensors connected via xG18 were showing correctly.
Since then I restart the evok with cron task every hour just to be safe. systemctl restart evok.