I'm trying to build a headless system using a Raspberry Pi; I have two programs runnning on it, one to catch all the input from a barcode reader (a simple keyboard emulation device) and one to display some graphics on a hdmi lcd screen using just the framebuffer (no X or DM envolved).
The reader program reads the input from the stdin; it is basically a scanf cycle that reads chars and doesn't print anything.
The barcorde reader prints there its chars and the reader program reads them until the "\n" char.
The display program embeds an http server that wait some request and paint the graphics on the framebuffer.
I run my two programs in two different
screen sessions using:
screen -DmS reader ./reader_server & S1=$! screen -DmS graphics ./graphics_server & S2=$! wait $S1 $S2
I use two different screen sessions in the hope that the reading printed by the barcode reader and readed by the reader program doesn't interfere with the display session.
Everything works fine, both programs start on boot, the reader program awaits in its own session and the graphics program draw its stuff over the local tty...
The problem is that when I try to read some barcode the input is printed on the local tty, breaking my graphics and popping-up console pieces throught of it!
My question is: is there a way to send/redirect every keyboard input to my
screen session where my reader program wait for it?