Coder Social home page Coder Social logo

Comments (5)

sirhcel avatar sirhcel commented on June 23, 2024

Hello @pandakka, this looks strange indeed. If there is data on the rx line after the port gets opened, than I would expect it to be received.

Just the overcautious question: Is there actually data sent to the serial port you are running the snipped above on?

Could you please cross-check the reception of data with this serial port using a second adapter, crossed RX and TX lines, and hardware_check.rs from the latest main branch? For example:

$ cargo run --release --example hardware_check -- --loopback-port /dev/tty.usbserial-11230 /dev/tty.usbserial-11240

Transmitting data back and forth between these two serial ports, should report success like (at least for the test cases not using flow control):

Testing paired ports '/dev/tty.usbserial-11240' and '/dev/tty.usbserial-11230':
  Transmitting from /dev/tty.usbserial-11240 to /dev/tty.usbserial-11230...
     At 2000000,8,n,1,noflow...
        success
        success
     At 115200,8,n,1,noflow...
        success
        success
     At 57600,8,n,1,noflow...
        success
        success
     At 10000,8,n,1,noflow...
        success
        success
     At 9600,8,n,1,noflow...
        success
        success
     At 9600,8,n,1,softflow...
        success
        success
     At 9600,8,n,1,hardflow...
        success
        success

from serialport-rs.

pandakka avatar pandakka commented on June 23, 2024

@sirhcel Thank for your help ! Thank you for your advice๏ผŒ that I find my embedded linux board have a little diffent from PC,which need take some special setting ๐Ÿ˜“
Now it works. Thanks again : )

from serialport-rs.

sirhcel avatar sirhcel commented on June 23, 2024

I'm glad to hear that! So there is nothing more to do here.

May I just ask out of curiosity what finally caused the data not being received?

from serialport-rs.

pandakka avatar pandakka commented on June 23, 2024

Maybe is my first time touch embedded programing, I try a lot and find the path is /dev/ttymxc3 ๐Ÿ˜‚.
By the way available_ports() works well on my pc .But on my board side file style in "/sys/class/tty/ttymxc3/device/* is different ,which may cause the function() can't find the port ,so i need try by my hand๐Ÿ˜‚.

from serialport-rs.

sirhcel avatar sirhcel commented on June 23, 2024

This sounds like you are running into #66 on your embedded device. On Linux without libudev, the enumeration is done using sysfs and apparently the paths from /sys and not the actual devices files from /dev are returned.

What's your environment on the target? Is udev really not available there? How are you buildilng serialport-rs and your application for the embedded target? Could you please leave a comment in #66 if you are building without udev support?

from serialport-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.