Close

July 2 - First phase of project mostly complete

A project log for IP control for inexpensive line following robots

A project for my grandchildren to first build line-following robots then convert them to being controlled by their phones and tablets.

jedjed 07/03/2019 at 05:540 Comments

Today I've posted the code that runs the line-following robot, called ESPLineMouse.ino. I've also updated sendudp.cgi to make sharper turns. Now I can drive my mouse quite well on a bare floor using only a web browser.

That makes this phase of the project a success! I still need to enable multiple concurrent cars to be driven by allowing some way to specify the IP address of the target car. At boot, the cars DO display their IP address (THE major reason each needs a display), but as of yet there is no way to USE that IP except to edit the cgi script on the server.

I can think of two ways to fix this - my original plan was to store the IP in a hidden field of the web page and send it with the touch coordinates each time. It looks like that won't work - I don't see how to process both the coordinates AND read the IP. A second way is to have the cgi routine use the IP address of the requestor to look up the address of the target. The requestor would set that address and the cgi routine would remember it. That seems pretty easy, now that other things are working.

Now for the problem - once our week together is done, my grandchildren will go to home. That's bad enough, but they won't have a web server to run the cgi and let them drive their cars. THAT is unacceptable! Six of them live over 500 miles away, too. I need a way for them to drive the cars at home. This is the problem that I alluded to earlier and still needs to be solved.

It looks like I need a hand-held UDP source. I again have two solutions in mind. 1) an app, either one I can find (better) or one I write (not my favorite). 2) another piece of simple hardware, perhaps a joystick attached to another NodeMCU. It would need a power source and a display and everybody would need one. Approximate cost: NodeMCU $5, display $3, case, battery and holder, joystick $2 = about $15 each. I'd rather not spend the money.

Discussions