ZeRGBa virtualSync() / LCD widget

I was well on my way into building the Sunrise/Sunset lamp, but I also want it to be possible to just set the RGB values of the lamp, of course. I’m trying to setup a synced ZeRGBa widget, but as soon as I put it in BLYNK_CONNECTED (only the Vpin for the widget) it disconnects me all the time with a “Login Timeout”.

Currently I’m on Android, latest app and latest lib (0.3.8). Are there any known issues with this? I may have to resort to other ways and it’s not really a big deal, but it may be worth looking into.

All this happens on a local Pi server btw, freshly booted a couple times, so I’m thinking that’s not it. All my other projects run fine on it anyway :slight_smile:

Furthermore, when I put a button in front of the virtualSync (so it syncs when I push another button) it keeps jumping from the set value to black (0,0,0) and starts spouting Flood Errors when you press it too frequently, as in two or three times per second.

Do you sync single pin? Or all?

It’s a single sync of only the ZeRGBa pin, plus two simple button pins (syncAll same thing though, just tried).

It probably is in the sketch somewhere. Trace logging on the Pi doesn’t reveal anything unusual, except for the fact the Wemos connects and then instantly disconnects without a message. Serial monitor DEBUG logging also just connects, sends token, then disconnects again.

Now even without a sync or blynk_connected, it refuses to connect :frowning:

Well, that’s a bummer, it’s not the ZeRGBa widget, but it appears to be the LCD widget. If I send 9 lines + an LCD.clear() every second, it appears to be seen as flooding. If I fix all stuff up into two String (each line one), it goes OK.

OK-code:

char currentTimeBuffer[8];
    char currentSunriseBuffer[8];
    char currentSunsetBuffer[8];
    
    sprintf(currentTimeBuffer   ,"%02u:%02u ", hour(currentTime), minute(currentTime) );
    sprintf(currentSunriseBuffer,"%02u:%02u ", hour(sunrise)    , minute(sunrise) );
    sprintf(currentSunsetBuffer ,"%02u:%02u ", hour(sunset)     , minute(sunset) );

    String lineOne = "SynOK " + String(currentTimeBuffer) + "M" + String(modeSunSync) +" " + String(sunType[sunTypeIndex]);
    String lineTwo = "R:" + String(currentSunriseBuffer) + "S:" + String(currentSunsetBuffer);

    lcd.clear();
    lcd.print(0, 0, lineOne);
    lcd.print(0, 1, lineTwo);

Not-OK code

char currentTimeBuffer[8];
    char currentSunriseBuffer[8];
    char currentSunsetBuffer[8];
    
    sprintf(currentTimeBuffer   ,"%02u:%02u ", hour(currentTime), minute(currentTime) );
    sprintf(currentSunriseBuffer,"%02u:%02u ", hour(sunrise)    , minute(sunrise) );
    sprintf(currentSunsetBuffer ,"%02u:%02u ", hour(sunset)     , minute(sunset) );

    String lineOne = "SynOK " + String(currentTimeBuffer) + "M" + String(modeSunSync) +" " + String(sunType[sunTypeIndex]);
    String lineTwo = "R:" + String(currentSunriseBuffer) + "S:" + String(currentSunsetBuffer);

    lcd.clear();
    lcd.print(0, 0, "SynOK");
    lcd.print(6, 0, currentTimeBuffer);
    
    lcd.print(12, 0, "M");
    lcd.print(13, 0, modeSunSync);
    lcd.print(15, 0, sunType[sunTypeIndex]);
    
    lcd.print(0, 1, "R: ");
    lcd.print(2, 1, currentSunriseBuffer);
    
    lcd.print(8, 1, "S: ");
    lcd.print(10, 1, currentSunsetBuffer);
1 Like