Best approach for transmitting string from esp to esp.

Thread Starter

Gamecat

Joined Oct 15, 2016
12
So i have a six sided dice, different colours on each side. Inside; an accelerometer, an esp8266, and a battery.

I have another esp8266 connected to an rgb strip.

I know there are various ways of getting one to talk to the other. GET, MQTT, Blynk appear in similar projects. My question is this: what method would be simplest to make the rgb light show the colour rolled on the dice? I dont need the coding done for me, i want to work it out myself, but im seeking a point in the right direction from the more experienced. Have i provided enough information?
Thanks in advance!
 

jterblanche

Joined May 14, 2017
17
For MQTT you need a broker and GET requests have additional overhead associated with the protocol.

Have you thought about a simple socket server/client model?
 

djsfantasi

Joined Apr 11, 2010
8,910
Just blue skying here.

What are your host processors? The MCU to which you'll connect the WiFi module?

You really don't need to send a string. A single byte would work. Your die can't have more than six colors at most, if a color can't be repeated. You can either send its actual binary value (1,2,...6) or encode it (A,B,...,F).

How are you going to recognize what color the thrown die shows? How experienced a coder are you? OpenCV is a library for computer vision.
 

WBahn

Joined Mar 31, 2012
28,502
How are you going to recognize what color the thrown die shows? How experienced a coder are you? OpenCV is a library for computer vision.
I think the die is supposed to know what color was rolled based on the accelerometer data inside it and to transmit that data wirelessly.
 

Thread Starter

Gamecat

Joined Oct 15, 2016
12
I think the die is supposed to know what color was rolled based on the accelerometer data inside it and to transmit that data wirelessly.
That is correct. I currently have that working. The esp8266 has a server that displays a number (1-6), and a word, eg "cyan". This can be accessed by any device on the same network. It was when i started to think about a rgb device that could be controlled by the dice that i realised i had no idea what i was doing. I could get another esp to client and read the string. Or use mqtt, or blynk or another method. Mqtt is what ive settled on for now, but please let me know if you have opinion.. It was the broker thing that decided it for me. I want to build lots more controllers and recievers, and having a pi in the middle of it all connecting it together seems to make sense.
 

djsfantasi

Joined Apr 11, 2010
8,910
My confusion then. I was not familiar with the esp8266, and it wasn't clear to me from a quick glance at its description that it itself was programmable.
 

Thread Starter

Gamecat

Joined Oct 15, 2016
12
Its really an amazing little board considering its price. A nightmare to program though, as it wont fit on a bread board and requires a fdta cable.
Thanks for your points though. Im going to go with mqtt, and no doubt ill be back once ive hit new problems with that.
 
Top