Electron no longer publishing

I have been using the Asset Tracker project for about a year and it has been working quite well. I even made my own webserver to view the results on a Google map.

A few months ago, it quit publishing. No markers on my Google map, nothing on the console. I do get power up and down events on the console but no published data. The exact software I am using is 1-gps-features.ino. That software has Serial.println(t.readLatLon()); which sends the GPS lat and long to a Putty terminal. The data is good and I see a correct Lat and Long every 5 seconds. The publish time is set to 10 min intervals.

My troubleshooting steps so far: sending data to a serial terminal - it works, upgrade the Electron version - 0.6.4, upgrade CLI version - npm ver 1.4.14, node ver 0.10.29, reinstalled CLI + the Windows USB driver and reload the software. I get breathing cyan and it locates the GPS signal rather quickly (I use a battery backup for it).

I need more ability to determine why it no longer publishes. I should see each publish in the console but nothing but power on, off and indication of changing mode like listening, etc. I should get lat lon and battery voltage on the console and my website. I could use some help on how to isolate the problem.

Thanks

Of which library?
There are several libraries that feature this exact sample.

But the most capable and recommended library AssetTrackerRK does not.

BTW, there is a flag transmittingData which can be cleared via Particle.function("tmode", transmitMode) which would prevent the events from being published.
Do you get an event published when calling Particle.function("gps", gpsPublish) or Particle.function("batt", batteryStatus) ?

The above functions would provide you with that, but you need to use them (and also observe the return values).

1 Like

Thank you for the quick reply. I should mention that I meant Dashboard, not console. I’ve been watching the Dashboard for publishes so I can rule out my webserver. I always saw them on the Dashboard. While I was at it, I made sure I’m paid up…I have a valid credit card on file. I’m trying to figure out what has changed to cause it to stop working.

No events are published according to the Dashboard. I can load software over the network and the Dashboard shows power ups and power downs but no publishes.

I never heard of AssetTrackerRK library. As you say, that library doesn’t support 1-gps-features.ino. I’m not sure how to make use of AssetTrackerRK unless I wrote my own program. That will not happen.

In the code for 1-gps-features.ino., the two publish statements that no longer work are:
int gpsPublish(String command){
if(t.gpsFix()){
Particle.publish(“G”, t.readLatLon(), 60, PRIVATE);
and:
Particle.publish(“B”,
“v:” + String::format("%.2f",fuel.getVCell()) +
",c:" + String::format("%.2f",fuel.getSoC()),
60, PRIVATE);
Before it quit publishing both of these worked very well.

About the flag, here is a clip from setup() that shows the flag you mentioned:
int transmittingData = 1;
Then there are these:
// These three functions are useful for remote diagnostics. Read more below.
Particle.function(“tmode”, transmitMode);
Particle.function(“batt”, batteryStatus);
Particle.function(“gps”, gpsPublish);

Note that comment line says “Read more below.” There is nothing to read below and I’ve never been sure about what they do and how they can be a useful diagnostic. If this is documented anywhere, I can’t find it.

If you can point me to some docs regarding the three “useful functions”

Here is what I am going to try: Modify the code to make sure int transmittingData = 1; stays set. I am not sure how to do this. I can rule out the flag stopping publish, right? I can also use serial and insert something like Serial.println(transmittingData); after the Serial.println(t.readLatLon()); Then I can watch the Lat Lon readings along with the flag state using my Putty terminal. You may have some better suggestions.

Thanks

SOLVED!

I did an OTA load of a different program - one I wrote to test the publish command. It compiled but I didn’t get results. Then I reloaded 1-gps-features.ino and its back to publishing. I’m getting markers on my Google Map that runs on my Raspberry Pi server. My Asset Tracker is back to normal. The first marker was way off but the last marker was within 5 feet!

Next time, my first troubleshooting step will be to reload the software. Over the last few weeks, I have been trying to update beyond 0.5.2. Only when I updated CLI by using the Windows CLI Installer, did the Particle Update get me beyond 0.5.2 (now 0.6.4). The Web IDE changes obsoleted the Electron v 0.5.2. The CLI changes obsoleted the Particle Update capability.
When a project sits for 6 months, you need to watch the updates very carefully.

Thank you again for the quick response and the hints about the transmittingData flag. I’m going to try to find some info on how to build some diagnostics that I can view in Serial mode.

Thank you again

With “Dashboard” you do mean https://console.particle.io/devices , right?
This is what we call (Particle) Console.

When you click on the device name (in the Devices Console) you should get into the Device’s own Console view where you will see on the right side the exposed functions (and variables if any). This is where you can trigger the function calls and also see the return value.

That library has other samples in there, but these (including 1-gps-features) are only meant to demonstrate how to use the libraries. While they might do what you want, they should rather be taken as starting point for a real project.

The Web IDE (normally - see footnote) only alters the target version, when you instruct it to .
You probably had selected Default (0.5.2) back then, but that means that you want to follow the Default path which (at that time) stood at 0.5.2 but with each official release gets pushed forward.
If you had selected 0.5.2 the automatic push would not have happened because you explicitly instructed Web IDE to stick with this exact version.
For CLI, once you installed it via the Installer, you should get a notification if there is a newer version which you then can pull in via particle update-cli which then also pulls in the updated modules needed to flash the most current system versions.


(footnote)
Sometimes due to cache reset or backend updates Web IDE might forget what target you had set previously, but that does not push the target forward but usually makes it fall back to the oldest target available, most likely resulting in problems to build due to lack of more modern features, but won’t send your device into Safe Mode for application/system incompatibilities.

Thank you ScruffR for all that good info. Yes, I mean Console. Getting CLI updated was the only way I had to get the command Particle Update to actually update beyond the 0.5.2 target version. As I mentioned, I had to reinstall it just guessing that might help and thankfully, it did. I never knew there was a particle cli-update command. I checked in https://docs.particle.io/reference/cli/ and still don’t see it. So, this has been a good learning experience.

When I select Console from the Web IDE, I see my events and when I click anywhere on the event, I get a line of specific data showing the data with a timestamp and the core ID for my Electron. Being able to trigger function calls as you describe above would be the ultimate troubleshooting method when you suspect it isn’t publishing.

Again, thank you for all the good info.

Sorry, it actually was update-cli and it’s not documented (partly because it’s Windows only)

Did you find the function/variable part in Console?

Today for the first time I got the same console view that you sent in your reply: Functions.
What I did was log out completely, then bring up particle.io and log in. The login button changed to Console. I clicked it and it shows the Functions on the right. I selected the function batt and the battery voltage was published. Then, I clicked gps and the Lat/Lon numbers were published. This makes troubleshooting very easy. It also makes the software testing very easy. I used to wait the 10 min intervals to fine tune things. With this console, I can call the functions at will and see the results in a few seconds. It also triggers my Google Maps html to display on my website. Nothing shows in Variables so I intend to explore that.

It looks like everything is functioning correctly plus I have a better grasp on the development tools. ScruffR, I want to thank you for this support and helping me over these hurdles. I have another Electron that hasn’t been set up yet. I’m now working on ideas for another project. Also, Wed this week, I am going to give an IoT project demo at a local college where I will show the Asset Tracker and the dev tools I used.

1 Like