Sponsored Content
Top Forums Shell Programming and Scripting Read line from serial device with BASH Post 302985023 by Don Cragun on Thursday 3rd of November 2016 06:47:19 PM
Old 11-03-2016
Quote:
Originally Posted by RudiC
I thought about proposing using the stty utility as well but wasn't sure if it would work/apply, as we are dealing with a USB GPIO device.
Using stty might or might not work, but it is really easy to find out...

If the command stty < /dev/ttyACM0 works (printing the current settings for the device), it will work. If it exits with a non-zero exit status and prints a diagnostic similar to:
Code:
stty: stdin isn't a terminal

then it won't work.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

serial port device path

hi. Im trying to install a switch. And the manual says i should type a command including a SerialPortDevicePath. which is the filepath to serial port used for connection. However.. nothing about how to find this info. Could anyone help me where to find this path? thx mr.T (6 Replies)
Discussion started by: tyskertøs
6 Replies

2. Linux

Device serial number

Hey! I'm trying to figure out a sollution for a problem I have at my company with an Iomega MiniMax 500 GB USB disk. If i run cat /proc/bus/usb/devices I get this information: T: Bus=01 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00... (2 Replies)
Discussion started by: noratx
2 Replies

3. Ubuntu

Ubuntu 9.04 Serial application to telnet to serial device

Hello! I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a... (5 Replies)
Discussion started by: mvona
5 Replies

4. Programming

Problem with read data from serial device

I have problem with C programming. I want to send & receive data through serial communication. I send data(command) to device to get data from device but when receive data, it can't get altogether of data. It get only some data. What should I do to get altogether of data? If all of... (7 Replies)
Discussion started by: noppon_s
7 Replies

5. Shell Programming and Scripting

bash: read file line by line (lines have '\0') - not full line has read???

I am using the while-loop to read a file. The file has lines with null-terminated strings (words, actually.) What I have by that reading - just a first word up to '\0'! I need to have whole string up to 'new line' - (LF, 10#10, 16#A) What I am doing wrong? #make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies

6. SCO

Modifying serial printers device

I am trying to change one of my serial printers from /dev/ttyr002 to /dev/ttyr014: lpstat -s device for check3: /dev/ttyr002 device for check4: /dev/ttyr002 I changed the tty setting for check3 in: /etc/printcap /var/spool/lp/admins/lp/printers/check3 to /dev/ttyr014 Then I get:... (4 Replies)
Discussion started by: herot
4 Replies

7. Shell Programming and Scripting

Bash while read line

I have a script batch_vmdgenpqr.sh which has a problem: #!/bin/bash while read line do vmd.sh -dispdev text -e vmdgenpqr.tcl -args $line done<file The do line calls another program, VMD (called by vmd.sh) and it requires the values from $line, but this is not recognised by... (3 Replies)
Discussion started by: chrisjorg
3 Replies

8. Shell Programming and Scripting

Bash script to read a file from particular line till required line and process

Hi All, Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool. Wraper script am trying is to do with above metion 2 files. utility tool accepts : a. userinfo file : which contains username b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies

9. Shell Programming and Scripting

[BASH] read 'line' issue with leading tabs and virtual line breaks

Heyas I'm trying to read/display a file its content and put borders around it (tui-cat / tui-cat -t(ypwriter). The typewriter-part is a 'bonus' but still has its own flaws, but thats for later. So in some way, i'm trying to rewrite cat using bash and other commands. But sadly it fails on... (2 Replies)
Discussion started by: sea
2 Replies

10. Shell Programming and Scripting

With script bash, read file line per line starting at the end

Hello, I'm works on Ubuntu server My goal : I would like to read file line per line, but i want to started at the end of file. Currently, I use instructions : while read line; do COMMAND done < /var/log/apache2/access.log But, the first line, i don't want this. The file is long... (5 Replies)
Discussion started by: Fuziion
5 Replies
SICONTROL(8)						    BSD System Manager's Manual 					      SICONTROL(8)

NAME
sicontrol -- Specialix SI/XIO driver configuration and debugging SYNOPSIS
sicontrol device command [param ...] DESCRIPTION
The sicontrol utility is used to configure and monitor the SI/XIO device driver. The sicontrol utility operates on the specified device to indicate which port is to be used. The special device string `-' is used to indicate the global driver settings instead. A /dev/ is included if necessary. The following commands are used for the global settings and should be specified with the '-' device name: int_throttle [value] Configure the `aggregate interrupt throttle value'. The maximum number of host adapter interrupts per second is determined by: controller CPU clock / (8 * int_throttle) The default value at boot time is 25000. The host adapter cpu clock is 25MHz. This gives a maximum interrupt rate of about 125 inter- rupts per second. Lowering this value will increase the rate in which the host adapter can interrupt the operating system for attention. rxint_throttle [value] Configure the receiver interrupt throttle value. The default value of 4 at boot time allows an interrupt rate of approximately 25. Lowering this value will increase the rate in which the host adapter can interrupt the operating system to empty the receiver fifos. nport Return the number of ports under the control of the device driver. The following commands are used for the individual ports and should be specified with a device name from /dev: mstate Show the current incoming modem control signals. ccbstat Show the current "ccb" structure for the specified port. This is not of much use outside of debugging the driver and determining why a port is wedged. FILES
/dev/si_control global driver control file for use by sicontrol /dev/ttyA* terminal control ports /dev/ttyiA* initial termios state devices, for use by stty(1) /dev/ttylA* locked termios state devices, for use by stty(1) DIAGNOSTICS
Generally self explanatory..... SEE ALSO
stty(1), si(4), termios(4), tty(4), comcontrol(8) HISTORY
The sicontrol utility is loosely based on a utility called siconfig which was written by Andy Rutter <andy@acronym.co.uk>. Specialix International do not support this device driver in any way. AUTHORS
Peter Wemm <peter@FreeBSD.org> BUGS
Bound to be many... :-) BSD
September 26, 1995 BSD
All times are GMT -4. The time now is 04:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy