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

"Error: unable to receive stop scanning command response" in example.cc #35

Closed
matpalm opened this issue Jan 27, 2017 · 5 comments
Closed

Comments

@matpalm
Copy link

matpalm commented Jan 27, 2017

i'm running libsweep/examples/example.cc to get some calibration data and often find that after a quick stop/start i get Error: unable to receive stop scanning command response or Error: unable to receive start scanning command response 3 or 4 times before getting connectivity again. Unplugging the device and replugging it back in always seems to clear the problem (i.e. I don't get this error the first time I run the example).

Is this expected? Is there additionally debugging I can provide?

@dcyoung
Copy link

dcyoung commented Jan 28, 2017

Could well be related to #27

A temporary fix is described there (increasing the sleep duration before sending the second stop command).

This will soon be replaced by a proper parse/check for the DX receipt. However, the implementation for that will have to come after we introduce a worker thread which accumulates the scans. This is in the works and should be accomplished soon. For now try increasing the sleep duration and see if that resolves your issue.

Try bumping up the sleep duration in this line:

sweep_sleep_microseconds(5000);

Maybe try doubling or increasing by an order of magnitude. Value is in microseconds, so its still a tiny pause for something like stopping the device.

@daniel-j-h
Copy link
Collaborator

@matpalm can you change the sleep call from 0.005s to x 2 the amount (and if it still does not work x 10) and report back please. I would love to get a sense of how long we have to wait and if this is a feasible hack^W workaround instead of implementing data packet decision logic ourselves.

@matpalm
Copy link
Author

matpalm commented Feb 6, 2017 via email

@daniel-j-h
Copy link
Collaborator

Any updates here? We're waiting for 20ms now to give the hardware a chance to stop sending packets.

@matpalm
Copy link
Author

matpalm commented Mar 17, 2017

sorry for the super late response :(

grabbed latest sweep-sdk and not seeing this anymore from while true; do ./example-c /dev/ttyUSB0; done

fix looks good, thanks!!

@matpalm matpalm closed this as completed Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants