Home/Support/Support Forum/Python library timeout

Python library timeout

0 votes
Hello,
I've done a small project to measure temperature with Zibgee Xbee modules (S2C TH version) based on thermistors by using the python digi-xbee library.
Basically the system peridocally reads the ADC values from remote nodes by using this library, actually it works well but I've problems If I set the sleep periods bigger than 5-7 seconds.
I mean, If the SP param is bigger the code starts to get timeouts from the remote nodes, of course to solve temporally this issue I've reduced the SP time to 5 seconds but the problem now is that the battery only last a few days (2-3).
I've read all the documentation and I also have set the rest of the params (SM, ST and SO) propperly (I think so)

My question is if someone has worked with this library and has successed with SP times set to bigger values?

Thanks ind advanced
asked Jun 8, 2018 in ZigBee Smart Energy Profile 1.1 by sruedat New to the Community (6 points)

Please log in or register to answer this question.

1 Answer

+1 vote
End Devices with long timeouts cannot be asynchronously messaged in a reliable fashion. A parent will buffer messages for End Devices but not indefinitely so you're just counting on random chance that the end device will wake during the window where a message is buffered.

https://www.digi.com/resources/documentation/digidocs/90002002/default.htm#Reference/r_extended_sleep.htm

Basically, you need your end device to trigger a send to the coordinator that you can detect and use as an indication the End Device is awake and able to receive a message. The simplest method on an XBee (without co-processor attached) is to have the End Device send an IO sample on wake.

https://www.digi.com/resources/documentation/digidocs/90002002/default.htm#Concepts/c_zb_io_sampling.htm

This would make your request for an IO sample redundant. But if you have any other tasks (configure AT registers, etc) you just need to wait for that IO sample.
answered Jun 10, 2018 by jlovinger Veteran of the Digi Community (421 points)
Thanks, I'll try
...