Open DG12 opened 3 years ago
Actually I suppose this means that the frequency/period cannot be calculated in the web page side.
In fact, it's the period and frequency of reception, not emission. So, the math is good :) But it's true that I must specify it in the docs.
For the period and frequency of emission, we can maybe make something with the measurement sequence number to fill the holes (if tags are in data format 5). I'll think about it.
Please review regarding not calculating in web page.
The period calculation in index.js/calcFrequency does not account for missing packets.
A ruuvi at distance or in a radio isolation area (like a refrigerator ) may miss packets.
Worst case is receiving 1 packet, missing many, then receiving 2 consequential packets causes the calculation to be the average. A better algorithm would be min( last calculation , this calculation ) but that's not really good either. Calculating the frequency requires the time of 2 consequential packets.