-
Notifications
You must be signed in to change notification settings - Fork 301
Adding measurement age to custom data format #787
Description
Hi,
Firstly, many thanks for this firmware - it's excellent!
I'm using my own code to receive beacon frames from a few MHO-C401, and write them to a TSDB. I have the sensors configured to use the "Custom" format.
My receiving code currently detects and ignores duplicated receive frames.
Currently the measurement time is not known. It might be very soon after the time of packet reception (if the first beacon for each measurement is successfully received), or it might not be.
Because the same data is transmitted multiple times in successive beacon frames, it would be good to have some way for the receiver to know when the measurement occurred.
Some ideas:
- Add another bit flag to the custom format, to introduce a "time since last measurement" feature (this could be a configuration setting in the firmware) - the time could be transmitted in addition to the existing data, or it could (for example) replace one of the two battery measurements (e.g. only transmit one of % or mV, not both).
- The receiver could (after receiving many packets) try to infer the measurement time based on a combination of the measurement count and packet reception time for many packets. This is possible, but may be error prone, would add complexity to the receiver code, and could also get easily confused if the transmitter settings (e.g. measurement interval) is changed.
Any thoughts would be welcome. I'm not very familiar with BLE, so it's possible that there is a better solution which I'm not aware of.
If you think the idea of adding a firmware option to replace one of the battery data items with the time since last measurement (or similar, e.g. beacons since last measurement) would be generally useful (and could be implemented without adding too much code complexity or size), then I would be happy to submit a PR.