Getting strange values when using zeRGBa, server bug?

In the Blynk app (in zeRGBa) I use merge, all 3 value ranges set to 0-255.
When I send 255; 255; 255, on the ESP8266 I get 9999; 255; 255;
What is going on?

• Hardware model : ESP8266 (tried ESP32 with my similar big sketch, it does not help)
• Core version 2.4.2 (tried 2.4.0 version, it does not help)
• Smartphone OS : Android 7.0
• Blynk server
• Blynk Library version 0.5.3 (tried older versions, it does not help)
• App 2.26.7 (tried old apk file 2.18.1, it does not help)

On ESP8266 I recieve with this


BLYNK_WRITE(V3)
{
   //test
   Serial.println("=====rgbTest====");
    Serial.print("R ");
    Serial.println(param[0].asInt());
     Serial.print("G ");
     Serial.println(param[1].asInt());
      Serial.print("B ");
      Serial.println(param[2].asInt());
    Serial.println("=====rgbTest====");
}

when all three zeRGBa values is set to 255 in the app, on my ESP8266 I get this :
=====rgbTest====
R 9999
G 255
B 255
=====rgbTest====

when in the app 0; 1; 0;
I get this:
=====rgbTest====
R -9999
G 1
B 0
=====rgbTest====

So basically I get values for “R” from -9999 to 9999, instead of 0 - 255.

I don’t know when it happen, I use it not very often, and it worked fine before.

Can’t post the whole sketch because it is huge.

Any ideas? does it work for you fine?

in any case, it’s not this part of code that makes trouble.

Well, this workaround works for me now… But what the hell?


    // workaround
       int rConverted = map(param[0], -9999, 9999, 0, 255);

Is this problem on my side? Only I have this?

Well, for me ZeRGBa works as it should…

OK, found the issue) It turns out that you can turn on/off conversion for each pin,
and if you click that thing then it sends values from -9999 to 9999, but it still shows 0-255 everywhere… strange… why not to show real values that widget sends?

http://docs.blynk.cc/#widgets-common-widget-settings-data-mapping

Yes, I agree… I’ve missed that :slight_smile:
But why does it still shows all three is 255 in the app? when in reality it is “9999”,“255”,“255”, that is what it send to the server and what my ESP8266 gets. I think it should be fixed. It is not a bug, it is just misleading.

Because that is the actual values of the colour picker in the widget… No need to overthink it :stuck_out_tongue_winking_eye:

What the widget mapping does is something different and variable with the data output to the device, and in my experience just messes up things, just leave them off and work with the raw data. If you need mapping (not applicable in your case), use the Arduino map() function.

PS, in your image… if you can see the circle and the squiggly line, then mapping is ON, not off.

1 Like

So, Are you saying that mapping is on only for [R] ?
From the picture it looks like it, I agree, but via restful API I get this: [“9999”,“255”,“255”]. (with all like on the picture above)
I just rechecked all again, if widget shows 0; 0; 0; via restful API I get this: [“-9999”,“0”,“0”] it kind of strange… I don’t know.
Anyways, thanks for help. It is good enough for me the way it is.

You’d only activated data mapping for the Red channel, so yes, it’s only on for R values.

With virtual pins, data maps from -9999 to 9999. That’s how it’s desihned to work.
The mapping happens in the background, so is invisible to the app user (as you discovered, the user sees the range specified for that channel - in this case 0-255).

Pete.

2 Likes