Closed einars closed 1 year ago
https://github.com/efento/NB-IoT-sensors-integration/blob/3969b144d71255b2d5e8c217ddaacfd20d39d16d/NB-IoT-sensors-integration-2-way-communication.py#L81-L82
timeDifference = measurementPeriod * int((abs(sampleOffset - 1) / measurementPeriod))
As the actual samples are, say, [1 32401] for one alarm and [-1, -32401] for a different alarm sensor, this calculation seems off,
[1 32401]
[-1, -32401]
wrong: abs(sampleOffset - 1) # [0 32400] [2 32402] better? abs(sampleOffset) - 1 # [0 32400] [0 32400]
and, perhaps, now there even might be no need to even consider the measurementPeriod boundaries and this might just work?
timeDifference = abs(sampleOffset) - 1
Hi, you are right. We have already fixed this and uploaded the fix to the repository. Thank you!
https://github.com/efento/NB-IoT-sensors-integration/blob/3969b144d71255b2d5e8c217ddaacfd20d39d16d/NB-IoT-sensors-integration-2-way-communication.py#L81-L82
As the actual samples are, say,
[1 32401]
for one alarm and[-1, -32401]
for a different alarm sensor, this calculation seems off,and, perhaps, now there even might be no need to even consider the measurementPeriod boundaries and this might just work?