Anyone else not seeing events from their devices?

Some time early yesterday, I stopped getting events from my devices.

When I look at https://dashboard.particle.io/user/devices, the “Last Connection” date is correct (i.e. now), but when I go to the log view, https://dashboard.particle.io/user/logs, I don’t get any events, even though my device should be sending them.

Similarly, using the CLI, if I do particle subscribe mine, I don’t see any events, even when I power cycle the device, which normally generates spark/status events.

One other piece of the puzzle is that with particle subscribe all, I get far fewer events than normal. I’m only getting alldata_log events from 2-3 deviceids, just a few every 15 mins, which look like this:

{"name":"alldata_log","data":"2016-4-7D2:15T, AQI:13, PM:13, O3:4.000000, NO2:0.000000, CO:12.000000, hum:14.492554, temp:20.814642","ttl":"60","published_at":"2016-04-07T02:15:22.147Z","coreid":"xx"}
{"name":"alldata_log","data":"2016-4-7D2:30T, AQI:82, PM:82, O3:5.000000, NO2:200.000000, CO:12.000000, hum:19.428772, temp:22.423407","ttl":"60","published_at":"2016-04-07T02:30:43.808Z","coreid":"xx"}

Anyone else else experiencing anything similar?

I removed your codeID just to prevent any security risk.

Things are looking ok on my side. How often are you publishing and from how many devices are you expecting?

Thanks for the response @kennethlimcp. Just to clarify, those were not my cores. They were public events from the firehose (particle subscribe all). Do you also only see these events when you run that CLI command? I’m expecting to see way more events here, since events are public by default.

I have just one device online and it should be publishing every two seconds. I see nothing at all at https://dashboard.particle.io/user/logs, or when I do particle subscribe mine. My device must be successfully connecting to the Particle cloud because the “Last Connection” time and date at https://dashboard.particle.io/user/devices does update.

I have not changed the code on the device since it last worked two days ago, and even if there is a code issue, I should still get spark/status events on power cycling (which I don’t).

You should be using particle subscribe. particle subscribe all listens to the event all in the public firehose.

What device are you talking about? Photon?

Try this:

unsigned old_time = 0;

void loop(){
 if(millis()-old_time > 2000) {
  Particle.publish("test","my-test-msg",PRIVATE);
  old_time - millis();
 }
}

Doh! That explains the lack of firehose events then.

I’ll try your code tomorrow. This is on a Digistump Oak.

Events started coming through again this morning at 10.35 AM ET with no input on my part. My device had been running since I rebooted it last night…didn’t touch anything since. Still running my original code, hadn’t gotten around to trying @kennethlimcp’s suggestion.

Really seems like a switch just got flipped in the cloud.

1 Like

This issue has cropped up again. It started a few days ago. I haven’t seen an event from either of my devices since then, despite the “last connection” time on the dashboard being continually updated. I haven’t changed the firmware on my devices since before this issue first occurred back in April.

Is there a way to get in touch with the Particle Cloud devs about this issue? I’m reasonably confident it’s a bug on the Particle side.

@jgoggins could have a look at the logs, but since I don’t see any indication of a problem on http://status.particle.io nor do I see multiple reports of such problem popping up here, I’m not completely convinced that it’s not at all code related.

@jgoggins, it would be great if you could check the logs to see if anything is showing up. If it helps, I can privately send you the ids for the relevant devices.

@ScruffR, can you recommend some tests to prove that it’s not an issue on my end?

Here is the output of a slightly modified version of the simple test case proposed by @kennethlimcp above. I changed it to also print the return value of Particle.publish().

Code

unsigned old_time=0;

void setup() {
  Serial.begin(115200);
  Serial.println("Begin");
}

void loop() {
  if(millis()-old_time > 2000) {
    Serial.println(Particle.publish("test","my-test-msg",PRIVATE));
    old_time = millis();
  }
}

Edit: I noticed in the docs that this syntax for Particle.publish() may not be correct. I have since changed it to what is indicated there:

Particle.publish("test","my-test-msg",60,PRIVATE)

This did not change the observed output.

Output

Begin
1
1
1
1
1
1

(this repeats infinitely, one line every 2 secs, as expected)

So, Particle.publish() is returning success, but I’m not seeing the events on the dashboard or with the particle cli (particle subscribe mine). However, the Particle Cloud is seeing my device at some level, as the “Last connection” time on the devices page of the dashboard is always within a minute or two of the current time, as long as the device is powered on.

Any suggestions?

If you can whip up a test code that exhibits that issue and post it here we can check, otherwise (unless the logs give a clue) there are too many possible factors that you’d need to exclude as contributing factors before you could “prove” it’s not code related.


just seen you have :wink:

Good timing :smile:

If you have Chrome, you could use this to see the firehose

view-source:https://api.particle.io/v1/devices/events/?access_token=<your access token here>

You could also use a self-subscribe event handler to see if the device would see its own events

@ScruffR that doesn’t work for me unless I omit the view-source:

After omitting, I just get the request confirmation, but still no events:

Request

https://api.particle.io/v1/devices/events/?access_token=xxxxxxxxx

Response

:ok

I checked the public firehose (https://api.particle.io/v1/events/?access_token=xxxxxxxxx) to make sure it’s not just a communication problem on my end, and I do see the stream of public events.

To do the self subscribe test, I modified the test case sketch as follows:

unsigned old_time=0;

void handler(const char *event,const char *data) {
  Serial.print("Event: ");
  Serial.print(event);
  Serial.print(", Data: ");
  Serial.println(data);
}

void setup() {
  Serial.begin(115200);
  Serial.println("Begin");
  Particle.subscribe("test",handler);
}

void loop() {
  if(millis()-old_time > 2000) {
    Serial.println(Particle.publish("test","my-test-msg",60,PRIVATE));
    old_time = millis();
  }
}

This is the output I get:

Begin
1
1
1
1
1
Event: testDevice,1,3Phase,testMotor,Chicago,TCV,0.1.0, Data: 90,1.2,1.3,1.4,0.01,0.02
1
1
1
1
1
1
1
1
Event: testDevice,1,3Phase,testMotor,Chicago,TCV,0.1.0, Data: 90,1.2,1.3,1.4,0.01,0.02
1
1

(As before, this repeats infinitely as expected, one line every 2 secs).

That event is not mine. If you look at the public firehose (e.g. with particle subscribe test), you’ll see it every 16-17 s. So, my device picking up events from other people’s devices, just not any of mine.

Just to rule out any issues with public vs. private events, I tried listening only for events from my devices with:

Particle.subscribe("test",handler,MY_DEVICES);

The only effect this had was to exclude the testDevice events. I also tried making the event I’m publishing public by changing the Particle.publish() line as follows:

Particle.publish("test","my-test-msg")

This had no effect, no matter whether I was listening for events from all devices or my devices only.

Maybe using a less common event name than test would be an option to exclude other peoples events :wink:

Oh, sure!

But it actually serves a beneficial purpose here since it confirms that the device is operating and connected to the Particle Cloud.

Thanks for all your suggestions @ScruffR. I have to call it a night. I’ll check back tomorrow. Hopefully @jgoggins might find something informative in the logs.

I just got up an hour ago or so :wink:

I’ve tested your code - and as expected it works fine at my end.
So might be something up with your device or account or token.

How if you publish PUBLIC?

Great recon here guys, sounds like you’ve tried a number of things already, @kh90909 , a couple of questions for ya:

  1. Does this problem only occur when running on a Digistump Oak device?
  2. Could you try repeating your test case on a Photon?
  3. Could provide the exact test case code you are using so I can try to replicate it on my end (and potentially turn into an automated test)?
  4. Please PM me with particular device IDs that are exhibiting the problem.

Thanks!

-joe

1 Like