There has been a problem: when sending a command to Arduino, the Serial-port is overwhelmed every time, which leads to a reboot of the board.
came up with such a solution: to put a looped program with a constantly open Serial port, which each cycle reads the file. And in this file already write commands from a web server.
Question: Is such a situation possible that the command to the file is incompletely shown by one program, and the other program (looped, which sends commands through the port) read these incomplete data? And what to do with it?
Serial port stores all the information until it reads it to put it in so called buffer. The buffer stores information before reading it or reset (cleaning it or reboot the program).
Is such a situation that the command in the file has become incompletely discharged
one program, and another program (looped, which sends
Commands through the port) read these incomplete data? And what to do with it?
responding to your question:
- Port can only listen to one program, you fail to connect to one port by two programs, the port is blocked.
- If you sent the team and the program did not have time to read it – then you lose this command.
- Yes, you can write these commands to the file and then work with them.