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

FTDI usb serial open failed #302

Open
mnswwz opened this issue May 13, 2024 · 0 comments
Open

FTDI usb serial open failed #302

mnswwz opened this issue May 13, 2024 · 0 comments

Comments

@mnswwz
Copy link

mnswwz commented May 13, 2024

I used the serial library of version 1.0.1 to open the FTDI USB Serial Device, but it failed. The error prompt shows garbled code.
I use the library like this:

try{
    serial::Serial* m_Serial = new serial::Serial(port, baudrate, serial::Timeout::simpleTimeout(1), serial::eightbits, serial::parity_none, serial::stopbits_one);
    if(m_Serial->isOpen())
    {
          std::cout << "serial open success" << std::endl;
    }
    else
    {
         std::cout << "serial open failed" << std::endl;
    }
}
catch(std::exception& e)
{
    std::cout << "serial open failed of exception: " << e.what();
}
``I gived the parameters like this:
port : /dev/ttyUSB1
baudrate: 2500000
When I debug the code, the prompt showed in the terminal like this: 
"serial open failed of exception: oo/o"
When I used the serial port debugging assistant to connect the serial with the same parameters, it succeed. During the above test, I was clear the assistant was closed.
Before this test, I also tried to use the same library to open the CH341 usb serial device, and it succeeded. I was confused why? Thank you for any help.
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

1 participant