-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RS485 Bus stops after a few days #6
Comments
My initial thought might be the watchdog timer on it in relation to the sleep function. It looks like the WDTCSR is still in the works honestly. I don't even have my sensors in production yet since I'm still going through the firmware. I'll see about looking into improving the watchdog on it and submitting a pull request since Albertas seems pretty busy. If you're not familiar, a watchdog timer basically monitors for a loop condition and if a timeout is reached it resets the device automatically. To keep that from happening you have to keep on feeding the watchdog timeout conditions. Is there a delay between when you do batches of measurements? Can you try a lower number of reads and report back? Like say 50 reads and average and see if it dies in 4 days instead of 2? Also if you have any code that you're using to interact with the sensors that would be super helpful just to make sure it's on the firmware side of things and not an error with the controller. |
Hi, soilmoisturereader.zip |
Okay just fair warning I haven't used python before but everything that I see on your controllers looks good to me. Most errors are handled and you should be getting exceptions reported if there is an error in the controller querying the modbus devices. Try using a lower query rate like I suggested before and see if that changes anything. If it does that might indicate a limit or bug with MQTT. There was a POSSIBLE error with a write protected register in attint441 programming when sleep was called and a reset might not be initiated and an infinite loop would occur. I included that fix with with other request but I have all of 4 weeks of experience with cpp and about 3 weeks of experience writing c so I'm mostly going off of datasheets and research here. Albertas will really need to check it all and program one and see what happens. If what I have doesn't fix it we might have to approach it from a different angle. Just wait and see at this point. Hopefully this works. I think the current problem might lie here This reset function is called by sleep. The walk through is that
This is normally totally fine because when the watchdog timer runs out the system resets!
When reset is called now
|
@cheeeeee reset() in not called from sleep(). Sensor is configured in Safety Level 1.
@impellerturn are you putting sensors to sleep? |
Hi, |
Sorry, I have totally forgotten this. My suspicion lies with the powering. How many sensors are powered from a single usb dongle? I wouldn't use USB dongle as a permanent power solution. It can supply only one - two sensors. |
There were 3 sensors powered by the usb dongle. As of today i do not have the setup any more. |
Hello,
i´ve encountered, that my sensors are not working after a few days of operation.
Setup
Measurement
Result
Has anyone else had similar issues? Maybe @cheeeeee?
Any help appreaciated, thanks and best regards
The text was updated successfully, but these errors were encountered: