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

in_waiting property returns 0 instead of data #714

Open
amirt23 opened this issue Aug 20, 2023 · 1 comment
Open

in_waiting property returns 0 instead of data #714

amirt23 opened this issue Aug 20, 2023 · 1 comment

Comments

@amirt23
Copy link

amirt23 commented Aug 20, 2023

Hello

While using this library which incorporates pyserial within it I've encountered a problem reading from a HW (GNSS receiver).
The first attempt connecting to the HW succeeds. However, after terminating the script\object operation and using the close property to close the connection, subsequent attempts of reading data are failing. This is evident by the in_waiting property returning 0 although the HW is sending out data. Only after a power cycle proper data streaming is restored.
Could this have to do with the connection process running as a thread ?

I'm running the code on a machine with ARM Cortex-A78AE CPU, on ubuntu 20.04 using the pycharm IDE.

Thanks in advance, I appreciate the asstiance.

@amirt23 amirt23 changed the title in_waiting method returns 0 instead of data in_waiting property returns 0 instead of data Aug 20, 2023
@dylanwal
Copy link

Hi,
Is the following sentence referring to power cycling the CPU or GNSS receiver?
"Only after a power cycle proper data streaming is restored."

If it is the GNSS receiver, then it is likely and issue with the other library sending data that the GNSS receiver no longer understands (the communication has gotten out of sync and the GNSS receiver does not understand the data sent so it doesn't respond. which is why you get zero 'in_waiting' data - no data was sent from the GNSS to receiver.)

If its the CPU, I am less sure what the issue is. It may be the same issue where the communication is getting out of sync and restating the CPU also resets the GNSS communication.

either way the zero in 'in_waiting' is telling you the GNSS is not sending any data back to the CPU. Its unlikely to be an issue with pyserial, but rather a bug in the other library and what messages it is sending.

  • I don't have experience with GNSS, and I am not a maintainer of pyserial; I am just a frequent user of pyserial sharing some best guesses.

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