cbrake/linux-serial-test

Ubuntu 20.04.1 LTS 64bit getting: Error setting RS-232 mode: Inappropriate ioctl for device

oldunixguy opened this issue · 8 comments

I compiled the src with gcc -o linux-serial-test linux-serial-test.c
I have a null modem cable from ttyS0 to ttyS4. Both tty are real rs-232 serial ports.

In shell1 I ran:
linux-serial-test -s -e -p /dev/ttyS4 -t -c -l 250 -b 57600
In shell2 I ran:
linux-serial-test -s -e -p /dev/ttyS0 -r -c -b 57600

In both instances I get:
Error setting RS-232 mode: Inappropriate ioctl for device

and then both instances appear to operate normally.
The error output is paltry. Any suggestions on what to add to the output to narrow down for you what is wrong?

thanks
oldunixguy

It appears we are trying to clear the RS485 settings on a system that does not support it:

https://github.com/cbrake/linux-serial-test/blob/master/linux-serial-test.c#L569

Can you try this branch and see if that works?

https://github.com/cbrake/linux-serial-test/tree/feature-fix-rs485-error

All, any concerns with above change?

sure, pull requests are welcome

Looks like you are making good progress. The IOCTL implementation is likely a function fo the Linux kernel serial driver, which can vary from system to system.

I went ahead and merged my changes to master: #34

Figuring out Git would be good -- if you need any help with Git, feel free to contact me directly via email. Figuring out the command line git client is the best approach (vs making edits in the GitHub web UI).