Close

The code

A project log for Cubetto Clone

I would like to build a re-engineered Cubetto clone for my son.

konkavKonkav 02/04/2018 at 21:450 Comments

At the moment, the codes for the two ESP's are in an advanced condition. Thinking about communication between them, I came to the idea, to create a new protocol. Not a completely new thing, it still communicates over TCP/IP, but something to add to the bare byte transfer. Some fallback mechanisms, if one or the other uC restarts, or just lost connection. Well, how hard it can be, at the end, it is a fairly simple function. Here is some description to it. I am using a 10 byte packet. It has a 4 bytes unique ID of the ESP's, a direction, counter, command, data, and a terminator. It have no checksum at the moment, but I left one byte unused, to implement is later. The controller is in STA mode. When the robot starts, it looks to connect to the controller, with the saved credentials. If it connects successfully, starts the sync process. Both sides are having semaphores for the communication state. There is a menu on the serial port, just on the controller at the moment, where one can set up different things, program the programming Bits, or manually drive the robot. Later the robot will get the menu system also. On both side there is an emulated EEPROM for saving the configs.

Now, I am awaiting for the new motors, and using the time to fiddle with the plywood. Not having specialized tools, like laser cuter or CNC makes it a little difficult, and I was just tried one of my idea, but it was complete failure. If the other idea turns out to be also bad, I will have no other choice, but to find a laser cuter somewhere :)

Discussions