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

Random assignment of which level is high and which is low #1

Open
Martin-Laclaustra opened this issue Apr 26, 2017 · 1 comment · Fixed by #2
Open

Random assignment of which level is high and which is low #1

Martin-Laclaustra opened this issue Apr 26, 2017 · 1 comment · Fixed by #2

Comments

@Martin-Laclaustra
Copy link
Contributor

Because only change is monitored, the first timing printed out to serial may correspond to a high or low state.
However, php code assumes that the first level is always low, and it plots it that way.

As a result, in several trials it is possible to get "symmetrical" plots in the vertical direction. Half of them will be unsuitable to interpret the protocol.

@Martin-Laclaustra
Copy link
Contributor Author

I think that my previous fix (and my raspberry pi port, because it uses the same method) may fail in the rare occasions when the program stops recording exactly at the last position of the buffer or just one position before it. If the program has to "correct" the first position to ensure a low initial level it will not consider resetting the buffer position to 0 and will probably throw an error or provide wrong data.
I do not plan to write a fix for this in the near future. The fix seems easy to write but the testing environment would be complex, requiring a transmitter to emit exactly a certain number of level switches (or hard-wiring a transmitter pin of a device to a receiver-pin of another).

You should reconsider reopening the issue just to provide the warning that there is this chance of failure (I calculate 1 in 1000 runs).

@sui77 sui77 reopened this Nov 1, 2017
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

Successfully merging a pull request may close this issue.

2 participants