Hot answers tagged

3

RTS and DTR are output pins - which you can set. DCD and CTS are input pins and can only be read. The device is probably set for hardware handshaking by default. You can change this using tcsetattr (see CRTSCTS). Then you can use the TIOCMBIS ioctl to set RTS and DTR Good references are: Linux Serial HOWTO Linux Serial Programming HOWTO The above might ...


3

This is typically done using the tcsendbreak C library routine. You can get to this from the shell by using a Python or Perl one-liner: python -c 'import termios; termios.tcsendbreak(3, 0)' 3>/dev/yourdevicename perl -e 'use POSIX; tcsendbreak(3, 0)' 3>/dev/yourdevicename


3

Well after a lot of debugging (and head banging against the wall) in the init script that I was using to switch_root to the directory where debian is, I did not mount /dev, /proc and /sys... The correct tty was actually 1:2345:respawn:/sbin/getty ttyHSL0 115200


2

Under linux your devices have not meta-names like com1 or so. Your usb-adapter is added to the /dev-directory with a driver specific name. The most usb-uart adapter use the name /dev/ttyUSB* where the * is a number beginning at 0. The best way to get this name is to view the changes of kernel messages via dmesg before and after plugin of the adapter. You ...


2

You could launch getty once you've booted to get a serial connection to your system. Note that this will not give you the default outputs typically seen with your console (Kernel Panics and other verbosities typically seen in console but not in normal terminals). But if you are just looking to get a login via serial after boot this should work. /sbin/agetty ...


1

Unless I am misreading your question, the answer is yes; were it not possible to do, no device drivers could exist. You won't be able to read any USB device as plaintext or anything like that, though, and you will need direct access to the usb device node. Drivers may interfere with reading from them. But on a theoretical level, yes, one may read data from ...


1

Try the following: sudo apt-get install python-serial import serial port = serial.Serial("/dev/ttyUSB0", baudrate=115200, timeout=3.0) while True: port.write("\r\nSay something:") rcv = port.read(10) port.write("\r\nYou sent:" + repr(rcv))



Only top voted, non community-wiki answers of a minimum length are eligible