Closed sunhaotian0122 closed 1 year ago
What type of machine is this dmesg from? I'm guessing that it is x86-based since it's using ACPI. It also appears that you are using a dedicated UART on the board (not from a USB device) as the console device. Given that, I wouldn't expect you to have any ttyUSB* devices related to this console (on the machine where the dmesg is being run).
Your kernel command line has "console=/dev/tty0" (note this is NOT 'ttyS0' (with an 'S')). I'm not sure if that matters or not. You might look at /dev/console, and see what it's linked to, under /dev.
Also, just to clarify, is this dmesg from the device under test (the target), or the device watching the device under test (the host). A computer can't use grabserial to watch it's own serial port. The device on the target that is emitting the kernel console messages is different from the device on the host that is receiving the characters. What is the actual hardware connection you have between the host and target? This would help me diagnose the problem.
#uname -a
Linux j66e01291.sqa.eu95 5.10.134-001.ali5000_1003_683de22baf_cbp.alios7.aarch64 #1 SMP Mon Oct 3 20:20:26 CST 2022 aarch64 aarch64 aarch64 GNU/Linux
#grabserial -v -d /dev/tty0 -e 30 -t
Error: serial device '/dev/tty0' does not exist, aborting.
If you think this port really exists, then try using the -S option
to skip the serial device check. (put it before the -d argument)
#ls -l /dev
total 0
crw-r--r-- 1 root root 10, 235 Oct 10 11:57 autofs
drwxr-xr-x 2 root root 240 Oct 10 19:56 block
drwxr-xr-x 2 root root 140 Oct 10 19:56 bsg
drwxr-xr-x 3 root root 60 Jan 1 1970 bus
drwxr-xr-x 2 root root 2860 Oct 10 11:57 char
crw------- 1 root root 5, 1 Oct 10 11:57 console
#grabserial -v -d /dev/console -e 30 -t
Error: serial device '/dev/console' does not exist, aborting.
If you think this port really exists, then try using the -S option
to skip the serial device check. (put it before the -d argument)
In fact, this is an arm64-based machine. Because tty0 is not a serial device, so I did not mention it. It seems that the /dev/console is not linked to any file. This dmesg from the device under test (the target).
I would like to know how I can find the corresponding serial port to use grabserial. In the example, there is only ttyUSB0 without telling how to find the corresponding serial port, if there is no ttyUSB0.
You didn't indicate whether this data is for the host machine or the target machine.
Please do 'uname -a' on the host machine, AND 'uname -a' on the target machine. Please do 'ls -la /dev/serial/by-id/*' on the host machine.
Also, please indicate what hardware is between the host and the target? Is it a serial port cable? USB-serial cable? something else?
What port is the cable connected to on the target and what port or device is it connected to on the host?
Stale issue message
can't reproduce
When I run grabserial, there is no output. I don't know if it's the cause of ttyS0? However, ttyUSB* does not exist on my computer. So, I use
dmesg | grep console
find ttyS0, can it replace ttyUSB0? Or, how can I find the corresponding serial port to replace the ttyUSB0?