Skip to content
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

period & frequency calculation is incorrect if packets are missed - defect #21

Open
DG12 opened this issue Dec 6, 2020 · 3 comments
Open

Comments

@DG12
Copy link

DG12 commented Dec 6, 2020

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.

@DG12
Copy link
Author

DG12 commented Dec 6, 2020

Actually I suppose this means that the frequency/period cannot be calculated in the web page side.

@balda
Copy link
Owner

balda commented Dec 6, 2020

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.

@DG12
Copy link
Author

DG12 commented Dec 7, 2020

Please review regarding not calculating in web page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants