0

Im trying the check if a machine is connected to a device trough a COM port, i have tried comparing the dmsg output with the device plugged in and the output without the device plugged in, and they are exactly the same, so the output of dmsg never changes, the tty list in the dev directory never changes, no matter if its plugged in or not.How would i know which tty is COM1

I can do this either by python or bash. Any help and suggestions are appreciated thanks

Letho123
  • 13
  • 3
  • Are you trying to determine if there is a serial device plugged into your computer or that the interface in which you are connecting to another computer is serial? – kemotep Jun 17 '19 at 15:38
  • i am trying to determine if there is a device connected to COM1 serial port – Letho123 Jun 17 '19 at 15:43
  • Does `cat /proc/tty/driver/serial` show anything with `CTS|DSR|CD`? Anther clue is to look for anything located under `/dev/serial` – kemotep Jun 17 '19 at 16:07
  • doing ``` cat /proc/tty/driver/serial ``` shows 3 lines with CTS|DSR|CD , and there is no /dev/serial file or dir – Letho123 Jun 17 '19 at 16:15
  • my issue is than when i unplug or plug the device nothing changes, in the dmsg, in the /proc/tty/driver/serial file – Letho123 Jun 17 '19 at 16:53
  • `/dev/ttyS0` is `COM1`. As you were already told in another Q and which you seem to ignore, serial ports have **no** generic plug & play capabilities. –  Jun 17 '19 at 16:56
  • @Letho123 [Does this help?](https://unix.stackexchange.com/a/125261/276845) – kemotep Jun 17 '19 at 16:56
  • thank you kemotep, i will certainly try what you proposed, if it doesnt work, i think that its something that cant be done – Letho123 Jun 17 '19 at 17:15
  • The linked to answer doesn't work in the general case; a lot of devices that do not set or use the cts/dsr lines. –  Jun 18 '19 at 05:34
  • Possible duplicate of [how can i check the model of a device connected to a specific COM trough a ssh connection](https://unix.stackexchange.com/questions/524148/how-can-i-check-the-model-of-a-device-connected-to-a-specific-com-trough-a-ssh-c) –  Jun 18 '19 at 06:14

0 Answers0