I am working on a robotic project that I want to control from the web. The brain will be a RPi3 controlling a number of arduinos as well as a camera.
What I want is a self contained python script running on the robot, this script works now through the python shell. I can execute the program and type in commands and the robot reacts.
What I want is to keep that working, but add in an interface from the web, in pseudo -code something like:
wi = <web input>
ki = <keyboard input>
if ki <> " " or wi <> " "
I've tried using cgi.FieldStorage() and identifying the python script in the action parameter on the page but I can;t seem to get it to work. I get no error in the apache error log, but I get the access entries in the apache access log. So it is doing something but I don't know what
I can provide the code on what I have, but I would prefer to start from scratch using the current working python script and just add in the new elements, but I am looking for the best solution. I've tried having the page write a file (the file never generated) and talk directly using the cgi functions with no luck. and embedding the HTML into the python, but the problem with that is the RPi3 needs to connect the arduinos on the serial ports so there are functions that need to run while the page is loading. to eliminate that I am looking to keep the current python running constantly on the robot and have the web page just send data to it to process like from the keyboard.
Any guidance on this would be greatly appreciated!
Thanks in advance.