Create serial port device file
-
20-06-2021 - |
Question
I need to develop a test program, which sends and recieves data from terminal to the serial port.
In order to do that I want to create virtual device file and work with it. I did that by using command:
mknod -m 666 ttyS32 c 4, 500
The device file was successfully created, however I can't write data to it. Both programmatical and terminal ways give the following error:
No such device or address
In C I used standard file I/O functions, and in terminal I used the 'echo' command. Do you have any ideas how to write data to serial port device file?
Solution
That's right. You can write to the serial device using echo
. Are you sure that the device (not the device file) exists and is properly handled by the driver?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow