(SOLVED) Gauge Widget: Displays junk values when combined with text or symbols

I’ve created a “Terminal Widget” to send a “Number” to the Particle Photon. So the photon sends the number back to Blynk for the “Gauge Widget” to display it.

Gauge widget displays numbers without errors, with just “/pin/”.
But with “/pin/ out of 100” (or) “/pin/ / 100”, gauge’s display behaves odd!

Please refer to the Gauge Widget settings used:

With these settings:-
Please refer to this Example 1:

Sent 50 via Terminal - Image “1” looks good.
Sent 100 via Terminal - With Image “2”, please note the text " out of " is removed.

Please refer to this Example 2:

Sent 11 via Terminal - Image “1” looks good.
Sent 10 via Terminal - With Image “2”, please note the text " out of " is removed. And also note the last “zero” looking small.

Please refer to this Example 3:

Sent 2 via Terminal - Image “1” looks good.
Sent 1 via Terminal - With Image “2” the text " out of " is removed. And also note the last “two zeros” looking small.

@ilak2k I saw that you had created two topics on this same issue, as both had the same info, I deleted the older redundant one.

As for your issue, I see that the Gauge Widget now supports the same detail labeling as the Labeled Value Widget (@Dmitriy - but the Gauge Docs do not reflect this?).

Take a look at this to better see how the detailed labeling with /pin/ works: http://docs.blynk.cc/#widgets-displays-labeled-value

I think that since the terminal sends out string data, it might not be converting correctly with the /pin/ variable and thus somehow conflicting with the text to the label.

The small characters are just due to automatic scaling, probably of the text portion of your label.

Are you doing any data conversion in your code, prior to sending back to the Gauge?
Perhaps try https://www.arduino.cc/en/Reference/StringToFloat

@Gunner Oh no! Did you read through the post? Even though screens are same. The one you deleted were showing issues with the Terminal Widget. This post shows the issues with the Gauge Widget… Please undelete it… Or, should I post it again?

Please post your code as well, it might be an error there or not but it’s always relevant in bugtracking.
Remember to format it properly

I’ll post it in a moment…

Labeled Value Widget works fine without issues. It’s only the Gauge Widget that has this issue. I’ll post a screenshot with both Gauge and Labeled Value Widget in a minute

// This #include statement was automatically added by the Particle IDE.
#include <SparkCorePolledTimer.h>

// This #include statement was automatically added by the Particle IDE.
#include <blynk.h>

#define BLYNK_PRINT Serial  // Set serial output for debug prints
//#define BLYNK_DEBUG       // Uncomment this to see detailed prints

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "Your Auth Token";

WidgetTerminal terminal(V3);

char szMsg[256]; // buffer for all sorts of messages

BLYNK_WRITE(V3)
{
  // if you type "Marco" into Terminal Widget - it will respond: "Polo:"
  if (String("Marco") == param.asStr()) {
    terminal.println("You said: 'Marco'");
    terminal.println("I said: 'Polo'");
    // terminal.println();
  } else {
    // Send it back
    terminal.println("You said:");
    terminal.println(param.asStr());
    // terminal.println();
  }

  // Ensure everything is sent
  terminal.flush();
  Blynk.virtualWrite(V11, param.asStr());
}

void setup()
{
    Serial.begin(9600);

    Blynk.begin(auth);

    for(int i=1;i<=25;i++)
    {
        terminal.println();
    }
    terminal.flush();
    
  // This will print Blynk Software version to the Terminal Widget when
  // your hardware gets connected to Blynk Server
  terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
  terminal.println(F("-------------"));
  terminal.println(F("Type 'Marco' and get a reply, or type"));
  terminal.println(F("anything else and get it printed back."));
  terminal.flush();
}

void loop()
{
    Blynk.run();
}

I’d say this is your problem with gauge.
Perhaps it does not handle strings well

Blynk.virtualWrite(V11, param.asStr());
Try
Blynk.virtualWrite(V11, param.asInt());
Just to see if it works better

The response is same like before…

Here is the updated screen with both Gauge & Labeled Value:


I guess it’s time for you to step in @BlynkAndroidDev

I’ve seen it…
Also tried “/pin./”, but same response…

I don’t think Text to Label will be an issue. Labeled Value widget works fine. Refer to the screenshots with both Gauge & Labeled Value widgets. Also, remember and note, there are issues only when displaying these values:
1
10
100
1000
and so on…
All other numbers display just fine…

No, it’s not! Automatic scaling with all Blynk widgets happens as a whole. It doesn’t happen for a portion of the content…

I’ve tried sending data as an integer, also with the same response:
Blynk.virtualWrite(V11, param.asInt());

Sorry, a case of too many similar pictures and layout… and not enough differential clarity.

I have restored that topic, but can you perhaps crop your screenshots to remove extraneous parts of the image… particularly when so visually similar as another semi-related topic as this one (since I still suspect your issue here may be due to the data format coming from the terminal).

OK, now this comparison makes a case that there could be an issue in the (apparently recent) addition of detailed labeling to the Gauge Widget… you should have led with this :stuck_out_tongue_winking_eye:

@Dmitriy - can you refer the correct developer to this topic to confirm. Thanks

PS Apparently it does in this case :wink: The question is whether it is done on purpose to account for the much smaller text space in a Gauge vs other displays (e.g. Keep the primary value /pin/ large and adjust any labeling to fit)

I don’t think so… Refer to the screenshots here:

500 out of 100, is displayed properly and as you said, 500 is big and the rest looks small
1 out of 100, is displayed differently. Instead of “1” as big, here “11” is big and “00” looks small…

The first screen shot actually confirms my hypothesis… the 500 is the primary variable, related to the actual gauge position, and stays large for primary focus (I personally would be more upset if it also scaled down). The rest of the “support” labeling is automatically scaled, based on available space.

The question is why the second one truncates and mixes the variable and the labeling… the Developers will tell us I guess :slight_smile:

Have you tried adjusting the MAX range down to a more realistic level as compared to your test samples?.. say MAX 255 or 1023

True!

Yes! I’ve tried MIN 0 - MAX 100, with no change in results…

So while awaiting a Developer to weigh in, eventually… it is the weekend :wink: Can you post your latest code here… I would like to try to duplicate the issue myself, without assuming what sketch details you have changed. Thanks.

Sure! Here’s the code…

// This #include statement was automatically added by the Particle IDE.
#include <SparkCorePolledTimer.h>

// This #include statement was automatically added by the Particle IDE.
#include <blynk.h>

#define BLYNK_PRINT Serial  // Set serial output for debug prints
//#define BLYNK_DEBUG       // Uncomment this to see detailed prints

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "Your Auth Token";

WidgetTerminal terminal(V3);

char szMsg[256]; // buffer for all sorts of messages

BLYNK_WRITE(V3)
{
  // if you type "Marco" into Terminal Widget - it will respond: "Polo:"
  if (String("Marco") == param.asStr()) {
    terminal.println("You said: 'Marco'");
    terminal.println("I said: 'Polo'");
    // terminal.println();
  } else {
    // Send it back
    terminal.println("You said:");
    terminal.println(param.asStr());
    // terminal.println();
  }

  // Ensure everything is sent
  terminal.flush();
  Blynk.virtualWrite(V11, param.asInt());
  Blynk.virtualWrite(V12, param.asInt());
}

void setup()
{
    Serial.begin(9600);

    Blynk.begin(auth);

    for(int i=1;i<=25;i++)
    {
        terminal.println();
    }
    terminal.flush();
    
  // This will print Blynk Software version to the Terminal Widget when
  // your hardware gets connected to Blynk Server
  terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
  terminal.println(F("-------------"));
  terminal.println(F("Type 'Marco' and get a reply, or type"));
  terminal.println(F("anything else and get it printed back."));
  terminal.flush();
}

void loop()
{
    Blynk.run();
}

OK @BlynkAndroidDev Right off the bat I can confirm that there is an issue with the Gauge’s /pin/ variable received either as Integer or String, and from any source (tested with sketch supplied, slider and terminal).

It functions normally, until the first matching number, then it seems to truncate any preceding label text, displays the matched number along side the /pin/, then carries on as normal. What fun :smiley:

And at risk of turning this topic into Pinterest :wink: here is more picture examples when /pin/ is processed as 0-5 with the numbers 1234 in the label.

Thanks. Doc updated. Ticket created :wink:

2 Likes

Guys, this issue should be fixed with latest 1.12.5 release

1 Like