Photon watch dog... and running user code during reconnect to cloud

Hi All!
Has anyone a suggestion to solve the following situation:

The photon seems to block user code during reconnect to the cloud (lost connection during program execution). The reason is not so important; there are many external reasons for a photon to loose the connection.
I want the user code to keep on running during this phase. This user code does not interact with the cloud / local network.
I am well aware of the possible system modes.
As far as I understood @mdma, the network connection is running in a separate thread, or is this a misconception on my side???

The network connection will use a system thread. :stuck_out_tongue_winking_eye: We will have a beta available of that next week. :smile:

That’s what I LIKE!!! good job man.
It happens that the first project I roll out with the photon is in another country where it will be living 5 meters above ground. inside a steel case (with external antenna :grin:)…

Not to push you over the edge, if that is possible at all :wink:, do you have plans on implementing a watchdog or should we rely on an external circuit for the near future?

The photon does have a watchdog, so it could be enabled to reset the system, but that’s quite a brutal and possibly ineffective solution.

With multithreading, the application thread shouldn’t block, but of course there’s always exceptional cases. The system could have a soft watchdog that restarts the application thread, so similar to a reset, but all current global state (variables etc…) would still be preserved.

1 Like

I am aware of these canine variants, currently I am working with a CC1101 connected through SPI. It works quit well, but a bombardment of messages is sometimes too much for the CC1101, so it seems. I am not quit there yet with all the code and timing, but when worse comes to worse a brutal reset will do the job.

The idea of a soft watch dog is a good one, but, some guru wrote one time that a system can not guard itself from itself. Without getting philosophical, it is true. And also true is that the statement origins from the 80’s…

Reply to self…

The communication between the Photon and the CC1101 works fine. It was a matter getting the timings right. Now even in ‘action’ resets of the CC1101 work perfect.

1 Like

Hey

I think i have a similar issue i just want to make sure i’m on the same page as you guys! I have some code running on the photon, if the connection to the cloud (Limited internet connection due to bad wiring) is interrupted, the code is blocked and wouldn’t run.

This is the same issue right? I’ve been trying to mess around with system modes at no avail.

Thanks

I guess your issue should be solvable with the existing SYSTEM_MODE(SEMI_AUTOMATIC)

Could you give some more detail about your issue and some code in a seperate thread?

1 Like