Thank you for taking the time to read this
I'm looking for help on a small project that would benefit a lot of pi robot fans. If you could please help, it would be great.
The worse part of building my robots is the human interface. I need an easy system everyone is familiar with. That's why I'd like to run my robots from a web-based UI: the software stack is mature, available on any device with a browser, and people get it.
My pi has a LAMP stack and I can send messages to the pi by using something like PHP's exec("echo \"some message" > /dev/ttyACM0");
1) PHP can't keep a connection open. Every time it opens a connection the arduino resets.
2) PHP can't receive messages from arduino. Important data for the user may be lost.
What I need is a daemon that maintains the pi/arduino connection and buffers human-readable commands messages both directions.
Arduino would send a ">" to indicate "I'm ready for more data".
Arduino would expect messages terminated with a semi-colon, because "\n" is not reliably delivered.
I don't know exactly what the returning messages look like (eg what format). I don't know exactly how the LAMP stack talks to the daemon. These two issues are interconnected. I'm interested in your thoughts.
Ideally this would be something open source and free to all.
Does such a thing already exist? Is there a simple way to solve this I'm not aware of?