I´ve an analogue input card and sometimes the values are stucking.
I don´t know why. The i2c bus is running and finding the card.
The problem is on all 4 inputs. After restarting the pi it´s working again.
How can I check for value changes? If they´re stucking that I can restart the Pi automatically.
Thanks in advance,
Start by feeding the value through a filter node, so you will only get a message when the value changes. Then feed that into a Trigger node set to Send Nothing, then Wait for a time, Then Send your alarm message. Also select Extend Delay on new message. Then provided messages keep coming in the Trigger node will send nothing, but if the value sticks, so no messages get to the Trigger node, then after the timeout it will send the alarm message.
I don't think restarting the Pi is the correct solution.
It sounds to me that the i2c bus hangs for some reason it's better to have a look at the problem.
To help you we need some more info.
What i2c node are you using? What device(s) are on the bus with what address?
Can you show a small schematic how it's connected.
Here´s my i2c flow:
At the beginning it was working and I´ve changed nothing.
I´m controlling a sewage pump and shutters.
But in the faulty situation no shutter is moving. It´s happing most at night, sometimes during the day.
Any ideas ?
I´ve enabled i2c kernel tracing.
Maybe I can see a difference in faulty situation.
I´ve seen today, that node-red was the reason for the stucking.
Restarting I2c makes no change, but restarting node-red by stop/start.
In the log files is no reason for the stucking.
Baud rate is 400.000. Can this cause the problem ?