Questions tagged [termios]

Termios is Unix API for terminal I/O.

termios
Filter by
Sorted by
Tagged with
1 vote
1 answer
2k views

Check for extra characters in Linux terminal buffer

I try to implement getch() function in Python, which should also return list of chars for special keys like F1-F12 and arrow keys. These special keys generate several chars in a sequence. Therefore ...
anatoly techtonik's user avatar
1 vote
1 answer
85 views

Prevent canonical Mode from echoing special characters in C

Is there a way to prevent canonical mode from echoing characters such as arrow keys by modifying the termios struct? I've tried to play around with raw mode but I would need to rewrite a lot in order ...
Elena Bogner's user avatar
1 vote
1 answer
176 views

What signals does clearing the ISIG flag in termios struct disable?

The Open Group's man page for termios.h specifies nothing: ISIG Enable signals. The OpenBSD's man page for termios.h specfies: ISIG /* enable signals INTR, QUIT, [D]SUSP */ While the Linux's man ...
Harith's user avatar
  • 5,173
1 vote
1 answer
412 views

What can't getpass take input from stdin?

#include <unistd.h> #include <stdio.h> int main() { char *password = getpass("Password: "); puts(password); return 0; } I see that getpass can not take input from ...
user avatar
1 vote
1 answer
312 views

Canonical serial reading using terminos fail?

I am trying to read lines of datas comming from my arduino using serial. My arduino code look like that : Serial3.print(Z, 2);Serial3.print(F(";"));Serial3.println(F("END\n")); ...
plank's user avatar
  • 213
1 vote
1 answer
1k views

Backspace(\b) not clearing text in Non-canonical mode termios

i am trying to clear text by pressing the backspace key, i am using termios in non canonical mode. i have created a conditional statement that when the users press backspace it should remove the ...
Osama Xäwãñz's user avatar
1 vote
1 answer
2k views

Termios.h error on linux, -lftdi error on windows. cross compiling

I am able to compile this for linux and run it on linux, but I would like to be able to run it on my windows machine as well. https://github.com/bear24rw/rgb_table/tree/master/code/table_drivers/...
Jeremy Gilbert's user avatar
1 vote
1 answer
751 views

Difference between USB Serial in Windows and Linux

I bought a Variense VMU931 inertial measurement unit (IMU) for a robotics project at school, and I am struggling to get it to reliably communicate with my laptop in Ubuntu. I am using C++ with termios ...
J. Ford's user avatar
  • 15
1 vote
1 answer
1k views

forkpty works for some terminal apps, not for others

I'm trying to write a pty I/O transparent filter for a shell. The following example mostly works. Most programs run as expected with the wrapper. This example does not do any filtering, it's purpose ...
Bogen85's user avatar
  • 21
1 vote
1 answer
259 views

Read multi-character keyboard strokes

I have a script to read and handle keyboard strokes within python. This works perfectly fine for me for standard keys which send one byte to stdin. I cannot find a reasonable way to read keystrokes ...
amicitas's user avatar
  • 13.4k
1 vote
1 answer
162 views

Some times serial port read giving converted values [ Junk values]

configuring the serial port is given below // open serial port /* O_RDWR means that the port is opened for both reading and writing * O_NOCTTY means that no terminal will control the process ...
tharunkumar's user avatar
  • 2,851
1 vote
1 answer
512 views

Injecting unicode characters via termios.TIOCSTI

I have a piece of python code that injects entries from the bash history into the command prompt. Everything worked perfectly until I switched to Python 3. Now German Umlaute appear wrong. eg. ...
Vindolin's user avatar
  • 847
1 vote
1 answer
4k views

What is the baudrate limit in the termios.h?

This is a quick snippet of code from a serial program I've been working with to interface with a microcontroller. The code has been verified to work but I want to add the global define to make the ...
MaiSpy's user avatar
  • 15
1 vote
1 answer
3k views

Trouble in setting DTR RTS pins of serial port using ioctl() Call in linux

Hi i am writing a small code to control the DTR and RTS lines of USB to Serial port Converter chip FT232 on Linux (Mint Linux 13 Maya,x86). I have successfully wrote code to read and write data to ...
rohkumarj's user avatar
1 vote
1 answer
3k views

termios: XON/XOFF handshake

I'm trying to send data using the XON/XOFF software handshake so the receiver may control the data flow by using control characters. To enable the flow control for sending data I did this: ...
user avatar
1 vote
1 answer
762 views

terminal prompt is distorted and unreadable

I am new to the linux programming. I followed example on the web to read/write to console e.g., "/dev/ttyS0". Each time I run the code, it exits without prompting user to write the input. It also ...
iamauser's user avatar
  • 11.3k
1 vote
1 answer
607 views

serial data truncated by termios on embedded device

I am working on a C program listening to the serial port running on an ARM Linux embedded device. Other sets of data work fine, but always when I send a particular set of data, the beginning of the ...
quadmore's user avatar
1 vote
3 answers
2k views

How to change termios configuration, so that getc() immediately returns when user presses <tab> key?

I want to implement auto-completion feature for my CLI application. The default behavior of getc() is returning only when the following list of characters are entered: NEW_LINE or EOF. I want to add ...
Benji Mizrahi's user avatar
1 vote
0 answers
67 views

Send files over UART

I am transferring 6 different files from my Windows PC to BeagleBone over UART communication. I have written receiving (BeagleBone) side C code to receive and store 6 files at the "/home/debian/...
Avinash's user avatar
  • 11
1 vote
0 answers
69 views

Serial Port Communication Issue in C Code on Linux [duplicate]

I am facing an issue with serial port communication in a C program on Linux. The scenario is as follows: After booting my Linux system, I run a C program that reads data from a serial port. However, ...
Hareendran MG's user avatar
1 vote
0 answers
93 views

Using my TUI tool in a subshell or pipe "steals" the stdout. How can I delay a write to a pipe so that my TUI can use the terminal first?

I'm writing a simple TUI in Go from scratch, it puts the terminal into Raw mode (non-canonical mode) and turns off echoing, then it interprets user input, draws a TUI and shows an image based on that ...
sweet's user avatar
  • 25
1 vote
0 answers
37 views

STDIN dup2 for OpenBSD/NetBSD

I have a child using dup2: case OPGAME: users[userid]->userNextEntry = redirectuser( userid, 0, USERMODULES[MENU] ); pid = fork(); if ( pid == -1 ) parseerror( SYSTEMERROR )...
Giorgos Saridakis's user avatar
1 vote
0 answers
65 views

Why does a call to read() hang waiting for a newline (C)? [duplicate]

Consider this program (a basic implementation of cat): #include <assert.h> #include <errno.h> #include <stdio.h> #include <unistd.h> int main() { char buffer[4096]; ...
user129393192's user avatar
1 vote
0 answers
20 views

How to understand the following quote from termios description

I'm using Mac (10.14.6), following quote is from man termios: When a controlling terminal becomes associated with a session, its foreground process group is set to the process group of the session ...
mzoz's user avatar
  • 1,325
1 vote
0 answers
353 views

understanding tcflush and usleep

I'm working with a serial device RFID reader (caenrfid lepton7). It has a mode where it can send data forever each time it sees a new RFID tag. The problem with the nature of the serial line is that ...
markand's user avatar
  • 505
1 vote
0 answers
190 views

No module named 'termios' when creating a DAG on Airflow Docker

I am trying to create a sample DAG on VSCode after installing Airflow through docker but I run into this error. ModuleNotFoundError*: No module named 'termios'* Wondering what went wrong with my ...
tsukikosagi's user avatar
1 vote
3 answers
414 views

Why do tmux and vim print garbage in my SSH wrapper script?

I have written an SSH wrapper script that does local line editing. It is invoked similarly to SSH. For example: python3 sshwrapper.py [email protected] -CX. The problem is that when I connect to a ...
Flux's user avatar
  • 10.4k
1 vote
1 answer
1k views

using termios - Cannot set parity to even, get EINVAL error

Summary: I am currently working on a program on embedded Linux using termios. If I do not enable even parity, my program works fine. I start to have issues when I set PARENB active and PARODD inactive....
Victor.Wiedemann's user avatar
1 vote
1 answer
214 views

Serial socket - ignore POLLHUP received in non-canonical mode?

I have a Raspberry Pi connected via UART to a microcontroller. The code on the RPI is trying to read incoming non-canonical UART data, but randomly receives POLLHUP. I have been able to recover by ...
Fadeway's user avatar
  • 558
1 vote
1 answer
777 views

How to detect USB cable disconnect in blocking read() call?

I have a smart energy meter which sends energy consumption data every second. The daemon program I've written (C++/C Arch Linux) to read the data doesn't exit when the USB cable is disconnected and ...
apohl's user avatar
  • 11
1 vote
0 answers
78 views

Can printf() be made SMP safe?

I'm trying to get RTEMS running using SMP on a Leon3/gr712rc (2 cores). I have it partially running, but it crashes intermittently on printf's. Can anyone tell me if there's a way to make printf() ...
Symmetric's user avatar
  • 4,021
1 vote
0 answers
1k views

Serial communication over RS-232 stops after a while, can't transfer data, why?

I am trying to communicate between a special board(details below) and my notebook with RS-232 protocol over USB to TTL converters (datasheet). I use GtkTerm(version 1.0) on my notebook. On board I use ...
Muhammed Kılıç's user avatar
1 vote
1 answer
1k views

How do I fix socat to work properly on MacOs?

I've tried the Homebrew version of socat on MacOs Mojave and it fails to work when run with: socat STDIO,raw TCP:localhost:40707 This gives the error: tcsetattr(7, TCSADRAIN, 0x10457ad30): Device ...
Keeely's user avatar
  • 945
1 vote
0 answers
128 views

Termios behave differently in Ubuntu 18.04 and 19.04

The following code behaves differently in Ubuntu 18.04 and 19.04. In 18.04 the computer waits for input of the string as it should. In 19.04 the computer does not wait and terminates (but shouldn'...
programmer's user avatar
1 vote
0 answers
245 views

RTEMS without /dev/console

I'm working on an (old) application used since many years, based on RTEMS 4.6.2. Everything well, but now I've to made some changes to test a demo: I need to use an RS232 interface to communicate with ...
Andre's user avatar
  • 186
1 vote
1 answer
257 views

Starting localstack fails - missing termios

termios appears to be a Python module required for localstack. Installing on my Windows machine using pip fails. Further research reveals this is only available on UNIX systems. What is the Windows ...
BillZ's user avatar
  • 137
1 vote
0 answers
883 views

send/receive string via GATT in BLE

I have been successfully sending and receiving hexa values via GATT using "Heart rate service" and with characteristic "Heart Rate Measurement". Now I need to send TX/RX strings over GATT. Can anyone ...
Loki's user avatar
  • 11
1 vote
1 answer
638 views

Linux termios noncanonical read() timeout doesn't work

I'm currently trying to communicate with an external device using the serial port, and it works just fine... if the device is connected. However, since there is no guarantee that it is (and i have ...
Felix G's user avatar
  • 682
1 vote
1 answer
601 views

Python3.4 termios modification

I am trying to figure out how to use the termios calls to configure the tty. Below I am playing with baudrate. I am able to call tcgetattr, change the values, see that they have changed in a print ...
DougM's user avatar
  • 9
1 vote
0 answers
384 views

How do I upgrade a shell into TTY in C?

I'm developing a client that uses TCP sockets to connect to a listening server (an ncat for example) and when it does the program uses the dup2(socketfd, all three standard I/O file descriptors) ...
Brian Fiszman's user avatar
1 vote
1 answer
716 views

How to register an event using termios.h in a class

I'm making a c++ serial class in Linux. I'm trying to register an event when incoming data is received. I'm working on a Olimex Lime2 board. gcc version 4.6.3 (Debian 4.6.3-14) This is the error i ...
S. Drollinger's user avatar
1 vote
2 answers
3k views

Linux set higher baud rate and associated settings

Input hardware: BeagleBone Black, with some GNU/Linux distro running on it. What I want to achieve: I want to set some UART peripheral to 921600 baud value, and be able to set the other serial-...
mariusmmg2's user avatar
1 vote
1 answer
289 views

Cannot configure TERMIOS in SOCAT, xioinitialize: Assertion

I am using SOCAT 1.7.2.4 from Yocto with PowerPC as target (Big Endian) on a Linux machine. Not able to start SOCAT as I am getting the below assertion xioinitialize.c:45: xioinitialize: Assertion `3 ...
Neo's user avatar
  • 141
1 vote
0 answers
854 views

Arrow navigation input in C

I am creating a shell interface for a program, at first I used getline combined with strtok to split user entry, but it's not a great choice because if a quoted string is passed it will be splitted in ...
Nicolas Scotto Di Perto's user avatar
1 vote
1 answer
194 views

my linux C program cannot receive data from Arduino through USB Serial

My Linux C application cannot receive bytes from Arduino Hi all, I intend to use Arduino Mega 2560 as a programmer for AT89S52 (a family of 8051 microprocessor). The Arduino board connects to PC via ...
Huy Dang's user avatar
1 vote
0 answers
686 views

C++ How to implement timeout in serial canonical communications

I´m using ubuntu as host, and C++ as language. I´m communicating to a serial device that uses line by line commands. For that purpose I opted for a canonical mode of operation and my termios flags ...
Mendes's user avatar
  • 18k
1 vote
0 answers
1k views

How to make the termios read() return after the VTIME value?

I do have open a native serial port on linux using termios. The port is opened in blocking mode and with the settings VMIN = 10 and VTIME = 5. I thought this should mean the blocking read function is ...
p0fi's user avatar
  • 1,076
1 vote
0 answers
3k views

Termios configuration

In a MAC OS X (10.10) program, I have a hard time setting up termios correctly for RS-485 serial communication (I use a starcom USB → RS-485 featuring the FTDI chip) I need to set up the following: ...
Adeline's user avatar
  • 465
1 vote
0 answers
979 views

Linux termios.h: incoming bytes can only be read after \n

I'm trying to write a C program in linux that interacts with serialports. The program got 2 threads, one main wich writes and a listening thread. My problem is in the listening thread. I want the read ...
Tac0's user avatar
  • 21
1 vote
2 answers
2k views

Serial Programming: Sender and Receiver

So I am using two Xbee ZB (S2B) in a project to transmit data from one to another. It is a 8 data bit, no parity, 1 stop bit system (8N1). I have two questions. 1. Since I am interfacing with an ...
M B's user avatar
  • 41

1 2
3
4 5
7