Tag Info

Hot answers tagged

29

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


6

SAK in this case really means Secure Attention Key. The message you are seeing is a kernel message defined in drivers/tty/tty_io.c. SAK is a key combination which ensures secure login for a user on console. On Linux SAK ensures this by killing all processes attached to the terminal SAK is invoked on. It is expected that init will then restart the trusted ...


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

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


4

I managed to resolve the issue with the help of pabouk's answer. The code based solution that I finally discovered which allows the SAK flag to be set/unset on the serial port when opening using userspace API can be found on stackoverflow here How can I disable the serial port SAK option on Linux using userspace API?


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

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

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

You need to replace the form feed character (\f) with proper ANSI Escape codes. You can do this with GNU sed: sed 's/\f/\o33[2J\o33[0;0H/g' /dev/ttyACM0 In detail: \033[2J Clear screen, \033[0;0H: Go to pos 0,0 (If this does not work, try tail -f /dev/ttyACM0 | sed 's/\f/\o33[2J\o33[0;0H/g')


2

Someone on SO hinted in the right direction; the problem was with the baudrate, it was set to a different value than what I need. To check the baudrate: stty -F /dev/ttyUSB1 To set the baudrate: stty -F /dev/ttyUSB1 57600 (57600 in my case is the baudrate my device needs) It's working like a charm now.


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


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

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


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

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


1

You should be able to change the device names with a udev rule. Run udevadm info -a -n /dev/ttyS2 to obtain characteristics of your device. Find attributes that uniquely identify the multiport card, and one attribute that identifies the port. Then write udev rules for each port. The rules might look like this: SUBSYSTEM=="tty", DRIVERS=="serial", ...


1

The modem rules should match ACTION=="add", SUBSYSTEM=="tty" combined with idVendor, idProduct and port_number attributes: ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ATTRS{port_number}=="0", SYMLINK+="ttyPort0" ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ...


1

Serial ports are especially weird beasts. You'll want to use an Old School terminal emulation program. I used to think tip was the best, but nobody seems to have the source for it any more. cu comes with UUCP, and it's a complete hassle to install and configure, don't even bother. A quick google around tells me that people tend to use minicom these days. ...


1

When your FPGA execute the print("\n\f") it is really sending two bytes on its stdout, the first one is a linefeed and the second one is a formfeed. These bytes are 0x0A and 0x0C. Then, the stdout is trasferred over the USB cable, and read via an emulated serial device. This serial device will just trasfer both bytes to the controlling terminal (because you ...


1

I found a lot of references online that say bash should interpret \f as a clear screen. And just as many saying it doesn't work. You may be able to mess with your stty settings to get it to interpret \f properly (which in this context would be written as ^L for Ctrl+L). But I couldn't find anything obvious. A workaround would be to change your code. But ...


1

Apparently, hplip does not support USB to parallel adapters - see for example http://www.mail-archive.com/hplip-help@lists.sourceforge.net/msg02858.html I managed to get a parallel printer connected via a PL2305 adapter like yours to work with CUPS by manually editing the printers.conf file as described by @Sandro kensan - I am looking at the CUPS 'Printer ...



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