Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
oldunixguy opened this issue Oct 28, 2020 · 8 comments

Comments

@oldunixguy
Copy link

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

@cbrake
Copy link
Owner

cbrake commented Oct 28, 2020

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?

@oldunixguy
Copy link
Author

oldunixguy commented Oct 28, 2020 via email

@cbrake
Copy link
Owner

cbrake commented Oct 28, 2020

sure, pull requests are welcome

@oldunixguy
Copy link
Author

oldunixguy commented Oct 29, 2020 via email

@oldunixguy
Copy link
Author

oldunixguy commented Oct 29, 2020 via email

@oldunixguy
Copy link
Author

oldunixguy commented Oct 29, 2020 via email

@oldunixguy
Copy link
Author

oldunixguy commented Oct 29, 2020 via email

@cbrake
Copy link
Owner

cbrake commented Oct 29, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants