Published event not appearing in Events console?

Hi,

I recently unboxed, registered and began using a Particle Electron. I’ve updated the firmware to 0.6.0, and I’m targeting my compiles to that version. I can successfully flash my device, and it connects to the cellular (breathing teal) and I can interact with my program as expected.

Currently I’m using the “Publish” example, which uses the photoresistor to trigger publishing of beamStatus events. The app seems to work, I can make/break the beam and see the onboard LED signaling that a Particle.publish(“beamStatus”,“broken”,60,PRIVATE) was executed.

However, when I launch the Console and monitor Events, I don’t see any events being recorded.
I can “Ping” the device, it completes successfully.
I do see the last connect time corresponding to when I powered up the device, and it connected to the cloud.

Should I see these events in the console? Is there any tips that would help me troubleshoot?

[edit: 8/15/2017]
Link to code: Publish Example App
Also the main loop pasted below:

void loop() {
  if (analogRead(photoresistor)>beamThreshold) {
    if (beamBroken==true) {
        Particle.publish("beamStatus","intact",60,PRIVATE);
        digitalWrite(boardLed,HIGH);
        delay(500);
        digitalWrite(boardLed,LOW);
        beamBroken=false;
    }
    else {
        // Otherwise, this isn't a new status, and we don't have to do anything.
    }
  }
  else {
      if (beamBroken==false) {
        Particle.publish("beamStatus","broken",60,PRIVATE);
        digitalWrite(boardLed,HIGH);
        delay(500);
        digitalWrite(boardLed,LOW);
        beamBroken=true;
      }
      else {
          // Otherwise, this isn't a new status, and we don't have to do anything.
      }
  }
}

Successful Ping:

Thanks

-John

If you link to or post the code you use it saves us to search the code :wink:

One possibility is that you code is violating the rate limit and hence gets muted. Try adding a delay(1000) in loop() if it’s not there already.

2 Likes

Thanks for the quick reply ScruffR. I’ve updated my post with a reference to the code, it is the out-of-box example. I’ve pasted in the main loop() for additional reference.
I understand your [good] point about the rate limit, but the publish’s are already separated by my interactive making/breaking of the light beam to the photo sensor. Still, I added the delay(1000) to be sure, with no effect.

Should these events be showing in that Event console, or is that for something else?

-John

They definetly should show - providing the account the device is claimed to is the same as the account you’ve logged in with console.

Try pinging the device from console.

The device is listed when I launch the console, under “My Devices”. I’ve only ever registered one device so far.
The ping is successful, and indeed the “Last Handshake” corresponds with the time I power on the device.
I’ve edited the original post to include the Ping toasts.

Is this the correct place to view the events? (see image)

It’s starting to sound like the issue is not on my end, should I reach out directly for a support incident?

-John

What browser are you using?

Try Chrome, that’s known to work.

BTW, I’d also update to 0.6.2. While it won’t impact the issue 0.6.0 is way out.

1 Like

Bingo, I was using Edge, and also tried IE11 - no good.

I just installed Chrome and it worked fine.
So I’ll have to run Chrome as a workaround when I want to check events. I’m pretty disappointed this site has compatibility issues, hope it gets fixed soon.
But I’m happy we arrived at an explanation.

I’m grateful for your help, thanks ScruffR!

-John

1 Like

It’s not the site, but MS has not implemented proper handling for SSE.

e.g.
https://en.wikipedia.org/wiki/Server-sent_events
https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events
http://caniuse.com/#feat=eventsource
https://stackoverflow.com/questions/24498141/is-there-a-microsoft-equivalent-for-html5-server-sent-events

When the employed technique is not supported web devs can’t do a lot about that.

1 Like