No data sent over serial port in linux c++
The Arduino resets the moment you open the serial port.  Once reset the bootloader executes, which consumes (and discards since it's invalid) any serial data for a second or so before your sketch runs.

Because of this anything you send immediately after opening the serial port is ignored.

There are two commonly accepted "fixes" for this:


Delay for a pre-defined period after opening the serial port, and
Have the Arduino send a "READY" signal before doing anything else which your program waits for before sending.