WIFI Color Detection with the ESP8266


The reading of the color components is done via a TCP request to the board. The reading returns a frequency in KHz proportional to the intensity of the color. The frequencies in KHz are returned in a JSON string. The value of the intensity for all colors is also returned. Percentage components of color can be calculated from the frequency readings as these are proportional to the color intensity.

The sequence for reading is done by sending the following strings via TCP on port 9999:


(wait 5 seconds for acquisition to complete)

readf to read the frequency values

readp to read the percent values

The return message is in JSON format as follows:


{“RGBF”: [{ “Red:”: “1640”, “Green”: “1230”, “Blue:”: “2250”, “All:”: “6250”}]}}]}

each number representing a frequency in KHz proportional to the intensity of the light for red, green, blue and unfiltered (all).



{“RGBP”: [{ “Red:”: “33”, “Green”: “42”, “Blue:”: “25”}]}}]}

each number representing a percentage of the intensity of the light for red, green, blue.

This might seem stupid, but given the memory issues on the LUA API, this at least works nicely. Lets see in I can squeeze in MQTT.

About hbouzas

Born in Buenos Aires, Argentina. Studied Physics at the University of Buenos Aires. Joined Schlumberger in February 1985 in Houston, Texas, and worked in several technical and managerial positions until 2000. From 2000 until 2008 held several management positions in Abingdon, UK; Calgary, Alberta and London, UK. Worked in the areas of Geophysical Exploration, Geological Modeling, Structural Modeling, Reservoir Modeling and Petroleum Economics and holds several patents. He is currently the Norway Technology Center Manager for Schlumberger Information Solutions and is based in Oslo and Stavanger. Main interest are software, technology, innovation, 3D visualization, design, human computer interaction, energy, environment.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s