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