I have a board with UART, and an external converter to RS485. It sits at /dev/ttyS1. The converter requires that I put the UART RTS pin to high when sending and to low when receiving. I can achieve that by manipulating the pin from user-space before read/write calls, but I'd much prefer to have the serial driver do that. I follow verbatim the example in Documentation/serial/serial-rs485.txt, but what I get from ioctl() is ENOTTY - not a tty device. How can I proceed to understand the issue?

$ ls -l /dev/ttyS1
crw-rw---- 1 root dialout 4, 65 Aug 29 09:16 /dev/ttyS1
  • 1
    According to the ioctl(2) man page, ENOTTY means "the specified request does not apply to the kind of object referenced to by the file descriptor in the call". You said you have an external RS485 converter, so the kernel is not aware that the UART is actually driving a RS485 port, and that UART may or may not be capable of the RS485 mode by itself. The document you linked applies only to UARTs with a built-in RS485 mode. – telcoM Aug 29 '18 at 12:44
  • @telcoM Yeah, that makes sense. – user907323 Aug 29 '18 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.