Tag Info

Hot answers tagged

30

These /dev nodes appear because the standard PC serial port driver is compiled into the kernel you're using, and it is finding UARTs. That causes /sys/devices/platform/serial8250 (or something compatible) to appear, so udev creates the corresponding /dev nodes. These UARTs are most likely one of the many features of your motherboard's chipset. Serial UARTs ...


5

USB has a standardized method to learn device information including PID and VID. This information is available by the enumeration phase and takes place of the control endpoint. This is possible because there is an additional protocol on top of the raw data signals. The RS232 serial port is much simpler and does not have similar functionality defined. Data ...


4

Why doesn't the below work? # in one terminal: echo "asdf" > /dev/ttyUSB0 # in another terminal, this hangs and does nothing cat < /dev/ttyS0 Because, as a rule, serial ports don't buffer data. If there's no client app to receive the bytes landing on the serial port, they will simply be discarded. As an experiment, try launching minicom or cu ...


4

Unix version 7 (1979): # ls -l /dev/console /dev/tty?* crw--w--w- 1 root 0, 0 Sep 22 06:46 /dev/console crw-rw-r-- 1 root 0, 1 Sep 22 05:47 /dev/tty1 crw-rw-r-- 1 root 0, 2 Sep 22 05:47 /dev/tty2 (no pty there yet) Linux 3.2.0 (debian wheezy). Note: you can also find these by searching /dev for owned by group tty and dialout. That's a Debian ...


4

interceptty looks like what you want. I found that from this Ubuntu page interceptty - Intercept traffic to and from a serial port. Example If you want to use interceptty as an external serial monitor [connected to two serial ports on your machine and relaying between them, while recording the output] you can use one device as the backend, ...


3

One approach (not necessarily the best...) would be to attach strace to the process (or, in order to handle the race condition, to a wrapper script which execs to this process), set strace to maximum string length and then catch all read()s and write()s (or whatever your process uses). After that you grep the lines with the right file descriptor (which ...


3

A Solution: The problem is that this serial port is non-PlugNPlay, and a system do not know which device was plugged in. Anyway, after reading a HowTo I get the working idea. An *nix-OS already have in /dev/ a files like ttySn where a n ending is a number. Most of this files is dumb i.e. doesn't correspond to an existing devices. But some of those is going ...


3

minicom is great for interactive use, but it's not the right tool for programmatic I/O. Your local Python program should simply open the /dev node for the serial port. It works just like writing to a file: fd = os.open('/dev/ttyUSB0', os.O_RDWR) fd.write(...) The only tricky bit is setting up the bit rate and such. For that, use Python's termios library: ...


2

RS232 has no "cable presence" indicator of any kind. You're just getting transmission or metadata (control) signals through, or you don't - that's all you know. If you receive an incoming signal (CTS|DSR|CD) you know the cable is connected. If you don't receive any incoming signal, the state of the cable is indeterminate and there is no way to determine if ...


2

This is untested in combination: Add a udev rule to IMPORT{program}="/usr/local/sbin/unique-num /run/miner-counter 0 MINER_NUM" for your miners. Then you could use a simple shell script, something like this somewhat tested program: #!/bin/sh if [ $# -ne 3 ]; then echo "Usage: $0 data-file initial var-name" >&2 exit 1 fi datfile="$1" ...


2

Imagine running Linux under virtualization, many of the emulator still rely on outputting console to serial port. It's a convenient standard. Also, headless server still use serial port for communication.


2

This solved the problem: $ socat -d -d pty,link=/dev/CUSTOMNAME,raw,echo=0,waitslave tcp:192.168.x.x:yyyy;


2

You don't need to modify the kernel to just it just once; you can override it. Unplug the device modprobe ftdi_sio echo 0403 6001 >/sys/bus/usb-serial/drivers/ftdi_sio/new_id Plug in the device And your device should work. Your other alternative is to use the bind sysfs interface; I suggest using lsusb -t to figure out the correct path+interface in ...


1

I'm not quite certain what you're asking. You mention 'port' several times, but then in your example, you say the answer is /dev/ttyUSB0, which is a device dev path, not a port. So this answer is about finding the dev path for each device. Below is a quick and dirty script which walks through devices in /sys looking for USB devices with a ID_SERIAL ...


1

On a linux 3.8.2 source tree: $ cscope -dL1 '.*MAJOR' | grep -e TTY -e PTS -e PTY drivers/s390/char/sclp_vt220.c .*MAJOR 31 #define SCLP_VT220_MAJOR TTY_MAJOR drivers/staging/net/pc300_tty.c .*MAJOR 62 #define CPC_TTY_MAJOR CYCLADES_MAJOR drivers/staging/sb105x/sb_pci_mp.h .*MAJOR 42 #define SB_TTY_MP_MAJOR 54 drivers/tty/rocket_int.h .*MAJOR 1168 #define ...


1

All you have to do is open two terminals. In the first terminal you cat everything from the device, e.g. cat /dev/ttyS0 in the other terminal, you can send arbitrary hex characters and text to the terminal e.g. as follows: echo -e "\x7E\x03\xD0\xAF und normaler Text" > /dev/ttyS0 The echo -e command enables the interpretation of backslash escapes. ...


1

All devices on Unix are mapped to a device file, the serial ports would be /dev/ttyS0 /dev/ttyS1 ... . First have a look at the permissions on that file, lets assume you are using /dev/ttyS1. ls -l /dev/ttyS1 You will want read.write access, if this is a shared system then you should consider the security consequences of opening it up for everyone. ...


1

I set the root app to open directly the device in /dev/pts/X and it worked, although continued to fail with the sym. link. I also got non-root applications opening the symbolic links created by socat and communicating properly with the root app without problem. It is also worth noting that if socat were to be run as root, everything worked without a problem ...


1

You can use the ts program from moreutils to add a timestamp to each line. { echo foo; sleep 1; echo bar; } | ts Dec 13 01:07:23 foo Dec 13 01:07:24 bar To read from the serial port and output to a file: ts </dev/ttyS0 >arduino.log (Replace /dev/ttyS0 by the right path for the serial port device, .)


1

Looking through Stackoverflow I found this Q&A titled: Converting serial port data to TCP/IP in a linux environment. Specifically one of the answers to that question highlighted 2 tools that sound like what you're looking for: ser2net - Serial to Network Proxy (ser2net) ser2net provides a way for a user to connect from a network connection to a ...


1

I came across this Chromium project post that shows what you want. It's titled: Debugging a cellular modem. excerpt from that page Communicating directly with a modem with the AT command set Most modems support AT commands which control the modem and query for information. On a Chromium OS device with the developer mode enabled, you can use the ...


1

Finally Success: I found that the Torobot USB board could be communicated with an Arduino serial driver. Conveniently this is available through opkg: opkg install kernel-module-cdc-acm When the board is plugged in, it comes up as /dev/ttyACM0 From here you can simply echo commands to the device. echo "#8P1500T100" > /dev/ttyACM0 This ...


1

Yes, this should be doable given the information provided. Stack exchange has a site specifically for robot builders which may be a more appropriate location for this question. EDIT: You may not have a FTDI to USB driver installed but you will need it. This will provide you with the tty interface which handles this. I think that you'll find that this link ...


1

I would use LD_PRELOAD and a dynamic library (you have to create it) to override the calls that minicom do, open(), read(), write(), ioctl(), close(), I don't think are much more. google for "ld_preload override" you should find ton of examples about the technique. use the command strace with minicom to see the calls it does start overriding the open() in ...



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