Thanks very much for the debugging ideas-- they solved one of the two issues. However the automatic firmware update to the latest version isn’t happening. I have a few suggestions also.
By the way, I continue to be very impressed with the particle.io products and direction – well documented, reasonable cost devices, and very easy to integrate! We have about 10 of these now installed at alpha customer sites for my client’s demand energy monitoring devices at Brayden Automation. It looks like a really good fit-- although we’re running into some situations where we can’t get the devices to connect through the wireless modems. This is still under investigation.
Here are the results of the experiments:
I first tried powering the router down and back-- the device did disconnect and reconnect and the last connection time updated. However the firmware didn’t upgrade. The firmware version field prior to running this experiment is unlocked and was set to v4 and the released version is v5. The only way I was ablet to upgrade it was to do a “lock and flash now”.
- I increased the time that the device was disconnected and that solved one of the two issues. The last connection update field is now reliably updating. My main loop has a particle.disconnect() followed immediately by a reconnect() and I’m guessing there needs to be a minimum time of being disconnected-- presumably because of linger settings in the network connection?. I added a delay between the two calls of 10 seconds and that seemed to do the trick. However-- the firmware is still not automatically downloading and updating.
I re-read the documentation and might suggest you make a few changes. In the firmware reference, it states
“In most cases, you do not need to call Particle.connect(); it is called automatically when the device turns on. Typically you only need to call Particle.connect() after disconnecting with Particle.disconnect() or when you change the system mode.”
My understanding now is that you must call Particle.disconnect() and Particle.connect() if you expect firmware updates to occur automatically from a corporate dashboard. In addition, it does sound like you need a minimum time of being disconnected in order for a connect to work properly. If I’m understanding this correctly, you may need to document that as well.
Still would appreciate someone looking into the automatic firmware update to the released version. That still doesn’t appear to work. We do also connect to our Brayden Automation server to send data and disconnect from that in the main loop, and we do update a particle.io variable. These may have some side effects perhaps?