A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By hbouzas
#18905 The previous implementation of the WIFI color detection was done with an ad-hoc messaging system. Now, the most bang for the buck would be to have MQTT integrated, as it is much more flexible in terms of the message format and content.

I got the color detection, which involves frequency decoding of each of the filtered signals for R,G,B and no-filter, and MQTT working like a charm.

The protocol is simple. An MQTT message is sent to topic “AcquireColor”. Response is obtained by listening to topics “GetColorP” for color percentage and “GetColorF” for raw frequency (proportional to color intensity). The returned info comes back as a JSON string as follows:

Percentages:

{“RGBP”: [{ “Red:”: “37”, “Green”: “30”, “Blue:”: “32”}]}

Frequencies:

{“RGBF”: [{ “Red:”: “6578”, “Green”: “5291”, “Blue:”: “5649”, “All:”: “8695”}]}

Here is the code http://www.horaciobouzas.com