blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.83k stars 1.39k forks source link

Blynk.logEvent("") doesn't send an event to the webdashboard. #366

Closed Refenz closed 6 years ago

Refenz commented 6 years ago

Blynk library version: 4.8 IDE: Particle IDE IDE version: Board type: Photon Additional modules:

Scenario, steps to reproduce

1) Download the sketch on the board 2) Wait for the board to connect to the network 3) Open the port monitor 4) Make sure to send the event 5) Open a webdashboard 6) Refresh the page 7) Confirm receipt of values and board status is "online" 8) Check whether there are new events on the Timeline

#include <blynk.h>
#include <SparkCorePolledTimer.h>
#define BLYNK_PRINT Serial
#define BLYNK_DEBUG 

char auth[] = "TOKEN";

SparkCorePolledTimer  ValueTimer(10000);
void Value(void);

SparkCorePolledTimer  myEventTimer(10000);
void myEvent(void);

void Value(void) 
    {
int value1= random(0, 10);
Blynk.virtualWrite(V1,value1);
Serial.print("Value");
    }

void myEvent(void)
{
    Serial.println("myEvent");
    int var;
  switch (var = random(1,2)) {
      case 1:
    Blynk.logEvent("info");
    Serial.println(var);
      break;
      case 2:
    Blynk.logEvent("warning");
    Serial.println(var);
      break;
    }
}

void setup() {
    Serial.begin(9600);
    Blynk.begin(auth, "server");
    Serial.println(auth);

    ValueTimer.SetCallback(Value);
    myEventTimer.SetCallback(myEvent);    
}

void loop() {
        Blynk.run();
        ValueTimer.Update();
        myEventTimer.Update();
}

Expected Result

Receive an event every 10 seconds.

Actual Result

Webdashboard displays incoming values, but events don't come.

The Timeline contains events about Online/Offline status of the board, but doesn't contain any other events.

In the webdashboard, the specified events are present. The page was updated. Similar code on other boards (with the adaptation for them) sends events and they are displayed in the webdashboard correctly. (Displaying and receiving events works with other boards)

Refenz commented 6 years ago

@vshymanskyy Any ideas?

vshymanskyy commented 6 years ago

Is it on particle or esp8266 ?

On 17 Oct 2017 1:26 p.m., "Refenz" notifications@github.com wrote:

@vshymanskyy https://github.com/vshymanskyy Any ideas?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blynkkk/blynk-library/issues/366#issuecomment-337188446, or mute the thread https://github.com/notifications/unsubscribe-auth/ABb9lNUOYnmSftvStK3uQnsvBdTnSAC4ks5stIDrgaJpZM4P5jdp .

Refenz commented 6 years ago

@vshymanskyy Particle Photon

vshymanskyy commented 6 years ago

@Refenz please use latest 0.4.10 in Particle IDE. reopen if still issues

vshymanskyy commented 6 years ago

sorry: v0.4.10

nbolton commented 1 year ago

Took me a while to realise, but Blynk.logEvent wasn't working for me because I had actually hit the daily 100 max log messages limit. I also discovered that this limit doesn't reset at midnight, and I have no idea when it resets.

Normally the device would only emit a handful of log messages, but today I was testing some new code, and it seemed to randomly stop working. I didn't know if it was my code or something else, since there is no error when you hit the 100 log message limit (a bit unhelpful, to be honest).

Solution was to delete the Blynk device and create a new one from the template. A bit annoying, but it did solve the issue and my timeline started showing log messages once more.