Comments (7)
I'm sorry for the late reply @zrz4066! Which release of serialport-rs were you using back then? Could you please give our example list_ports
a try? On a Raspberry Pi 3+ running Raspian Buster, it lists me the expected USB serial devices:
$ cargo run --example list_ports
[...]
Found 3 ports:
/dev/ttyAMA0
Type: Unknown
/dev/ttyUSB1
Type: USB
VID:10c4 PID:ea60
Serial Number: [...]
Manufacturer: Cygnal Integrated Products, Inc.
Product: CP2102/CP2109 UART Bridge Controller [CP210x family]
/dev/ttyUSB0
Type: USB
VID:0403 PID:6001
Serial Number: FT[...]
Manufacturer: Future Technology Devices International, Ltd
Product: FT232 Serial (UART) IC
Which operating system release are you running on your Raspberry Pi? If the output differs there, then this is something to look further into.
I've got the output above even with our release 4.2.0 which was out at the time you were writing this issue.
from serialport-rs.
Finally managed to fabricate the output from the description with the list_ports.rs
example and disabled support for libudev:
$ cargo run --no-default-features --example list_ports
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Running `target/debug/examples/list_ports`
Found 5 ports:
/sys/class/tty/ttyUSB1
Type: Unknown
/sys/class/tty/ttyS0
Type: Unknown
[...]
It looks like the actual enumeration just returns directory names from /sys/class/tty
. These are not the device file paths needed for instantiating the devices like /dev/ttyUSB0
. What likely needs to be done:
- Check if there is a symlink pointing to the actual device file from inside
/sys/class/tty/ttyX
? - Or just build the device file name
/dev/ttyX
from/sys/class/tty/ttyX
- Cross check that the device numbers from
/sys/class/tty/ttyX/dev
match?
- Cross check that the device numbers from
from serialport-rs.
Version 4.2.2
Exec code: example list_ports (no-default-features)
Result : No ports found. (actually have ttymxc1 ttymxc2)
Hardware:NXP.I.MX6ULL
Kernel version:4.5.1
Build Env : --target=arm-unknown-linux-musleabihf
Thanks for your Answer at #119 and hope it can help you.
from serialport-rs.
Result : No ports found. (actually have ttymxc1 ttymxc2)
I would have expected them to be listed in /sys/class/tty
@pandakka. How does for example /sys/class/tty/ttymxc1
look like? Could you please capture a directory listing (ls -l
) there? I'm wondering why the enumeration fails.
from serialport-rs.
@sirhcel Sure ! But I need to go outside these days.Once back I will write in this issues.
from serialport-rs.
I found the time to boot up an i.MX8 board. It runs a Linux with BusyBox and in /sys/class/tty
, the links for ttymcx0
and ttymxc2
are present and the linked directories look like they would result in these devices being enumerated'
# uname -a
Linux phyboard-polis-imx8mm-3 4.19.35-bsp-yocto-fsl-i.mx8mm-pd20.1.0 #1 SMP PREEMPT Tue Jun 30 01:59:19 UTC 2020 aarch64 GNU/Linux
# ls -l /sys/class/tty/ttymxc*
lrwxrwxrwx 1 root root 0 Aug 23 22:11 /sys/class/tty/ttymxc0 -> ../../devices/platform/30860000.serial/tty/ttymxc0/
lrwxrwxrwx 1 root root 0 Aug 23 22:11 /sys/class/tty/ttymxc2 -> ../../devices/platform/30880000.serial/tty/ttymxc2/
# ls -l /sys/class/tty/ttymxc0/device /sys/class/tty/ttymxc2/device
lrwxrwxrwx 1 root root 0 Aug 23 22:14 /sys/class/tty/ttymxc0/device -> ../../../30860000.serial/
lrwxrwxrwx 1 root root 0 Aug 23 22:16 /sys/class/tty/ttymxc2/device -> ../../../30880000.serial/
Linux on this board is pretty bare and getting list_ports
to build looks like a pretty bunch of work ahead. So I'm stopping here for now.
How does things look on your system @pandakka?
from serialport-rs.
Sorry for the late reply! It seems looks like same as mine. Due to the system is pretty bare, that libudev may not work which cause the list_ports can't find the port. Right? Thank you for you answar!
from serialport-rs.
Related Issues (20)
- Add supported architecture HOT 2
- windows: UsbPortInfo: Provide the same info about Manufacturer and Product name as POSIX HOT 2
- Auto reconnect HOT 1
- use read_to_end always return TimedOut err HOT 2
- Stuck when writing data to the serial port if paired port is not open [Windows 11] HOT 2
- USB ports detected as unknown in docker HOT 1
- Print to COM port via USB to SERIAL converter cable on Windows HOT 1
- Set a Custom Baudrate HOT 1
- Unplug serial device cause system shutdown on windows HOT 5
- Fast receive missing beginning of packet HOT 3
- Tracking issue for WebSerial support. HOT 1
- Can Add Mark and Space to Parity? HOT 1
- Configurable buffer size HOT 1
- Update dependency on nix to 0.28 HOT 3
- Potentially confusing read_exact timeout semantics HOT 1
- wrong serial number for FTDI modules ? HOT 1
- Timeout reading SerialUSB from Arduino DUE or GIGA HOT 3
- Outdated documentation for TTYPort HOT 2
- Opening a COM port on Windows fails HOT 5
- Cannot list virtual serial ports on Windows 10 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serialport-rs.