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

If your program is logging without recreating the file (by opening it) you shoujld be able to do it by creating the file as a pipe: mkfifo potato.log You can send message to the pipe as if you were writing to the file: $ # This is the logging process: $ echo "Warning!" > potato.log And read them: $ # This is the listener process: $ cat potato.log ...


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

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


2

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


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;


1

The main use of minicom during its heyday was for talking to modems which understood the Hayes command set (AT commands). AT commands are terminated by carriage return. It was convenient to be able to type ATDT5550123 Enter and have the correct command terminator sent to the modem.


1

I guess you're using KDE. You need to use the kdesu command instead of the sudo for programs that are using X.


1

You can use a programming language to open a socket and roll-your-own library, using the modbus spec. Otherwise you can use an existing library, I have no experience with any of them, but this looked promising: http://libmodbus.org/documentation/


1

I’m not sure I understand the big picture of what you’re asking for, but I have a couple of approaches that you might want to consider: Use dd to read your input file exec 3 < input_file while true do dd bs=1 count=1 <&3 > this_byte if ! [ -s this_byte ] # If size is zero, we’re done. then break fi code using ...


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

The steps bellow worked for me: Firstly you have to pair the devices. Pairing is relatively easy. I will call client (who starts talking) and server (who replies) You have to setup the server before: Server side (as root): sdptool add --channel=3 SP mknod -m 666 /dev/rfcomm0 c 216 0 rfcomm watch /dev/rfcomm0 3 /sbin/agetty rfcomm0 115200 linux Client ...


1

I wouldn't go through cups: CUPS is very problematic about RAW devices. It's much easier to do it like so: #!/bin/bash cu -E `` /dev/ttyAMA0 < $1 (I can't remember for sure if you are requiring back-ticks (``) or single-quotes (''). cu calls up the modem. [-E ``] sets the escape sequence to null. < redirects $1 to the modem over the serial line. ...


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

I would recommend http://elinux.org/Grabserial. And formating ts output is a plus, it adds more time precission. ts [%H.%M.%.S]


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

You don't need to modify the kernel, and you can automate it. Add the following single line to /etc/udev/rules.d/99-ftdi.rules ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", RUN+="/sbin/modprobe ftdi_sio" RUN+="/bin/sh -c 'echo 0403 6001 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'" Either reboot or run 'sudo udevadm control ...



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