-
Notifications
You must be signed in to change notification settings - Fork 128
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
Data misread from serial adapter (serialport only) #190
Comments
Hi @skmagiik, as data you're receiving with the Prolific device looks just garbled and the setup seems to work at least with the FTDI adapter: are you using the same cable for connecting to the device? Not that we are dealing with a connection issue here. Another issue could be baud rate setup. At which baud rate are you communicating with the external device? There might be an issue with setting some/non-standard baud rates with the Prolific adapter. Do both adapters work when you are communicating between them in a cross-over configuration with our example
What does In case you have an oscilloscope at hand, you might look at the actual data on the wire between your device and the adapter. |
Hey @sirhcel I will run that hardware check. I didn't know that existed. For the connection / baud rate etc: |
Here is the result each time I run it:
|
Running with devices in the reverse order gives similar stack trace results:
|
This result does not look like what I would have expected in the first place: the received data is all zeroes where I would have expected some garbled data from what you reported in the description. Well. As you told, that the Prolific adapter works in combination with Minicom - could you please give this combo a spin? May be the initialization sequence of Minicom makes a difference here and we can investigate this further. Like before, with both adapters connected in a cross-over fashion. We have two more examples for this scenario:
Does this get you some data to be transmitted or received as expected with the Prolific adapter? |
Alright, I was incorrect. Minicom is also having some issues reading the serial device: Minicom shows the '.' char as a ? when transmitting from the known working to the Prolific adapter. Trying to transmit from either minicom or tio via the working adapter doesn't succeed with the receive_data. However, tio (https://github.com/tio/tio) is not having any issues receiving On the receive test, no matter which solution I tested we don't receive any data here: |
For future reference. I modified the tio source code to print the termios struct and it did look significantly different than the termios struct that this library tried to write to the tty. Even replicating this struct exactly across to the serialport-rs library and running the example did not resolve. I'm not sure what else could be the culprit. |
Thank you for pursuing the topic! This sounds strange indeed. Have you looked at And by the way, thank you for the pointer to tio! This is a neat tool I did not know beforehand. |
I have tried getting that to work, but I was getting an error result (-1) with an errno value of 14 Invalid file descriptor. |
If you could publish this to a fork, I will have a look into it the next days. The fd should be valid and a small number. What fd do you actually get? |
Looks like i'm getting fd.0 == 3 I'll create a fork for it :) |
Hello! I have an interesting issue that I am not sure how to resolve or debug.
Hardware: Macbook Pro M3 MAX
Architecture: aarch64 (apple silicon)
OS: Mac OS 14.4.1 (23E224)
I have 2 serial adapters. When talking to the same device adapter A works (an FTDI adapter), but adapter B (Prolific Technology adapter) does not. Same baud rate settings etc in the rust program using this crate. Example code below
If using tio (a command line utility for serial data) adapter A and B both work as expected.
Here is an example:
The blue output is adapter A (working FTDI adapter). The green output is adapter B (Prolific Technology adapter).
The data they are receiving should be the same or very similar.
What route should I take for debugging this further?
Device setup:
Read function:
Here is also usbdiagnostic output for the 2 adapters:
The text was updated successfully, but these errors were encountered: