I have been playing with my Core a few weeks now but sometimes my Router and Internetconnection give problems in my House… and when that happens my Core stops functioning. It is trying to connect to the Cloud but when that does not succeed my program “freezes up” -is blocked-
I read about switching from automatic to manual connecting to the cloud but the way I see it: even when I connect manually (once every 24 hours?) when there is no internet it still blocks execution of my code (am I right?)
I am planning to use my Core for some “life-depending” situations : controlling temperature and food for my fish, watering my Plants, etc. and it could be dramatic if it stopped working while I am gone for a few weeks.
Yes, I could disconnect it from the cloud but then I would have no means to connect while I am “on the road”…
Did I miss something while exploring this Forum?.. Is there a solution for this?
I’m not sure if this would solve your problem, but if you write your code in a fashion that it doesn’t permanently need the cloud and you only connect/disconnect when needed, then you could try to connect but set up a timed interrupt that may cancel the connection attempt if it doesn’t succeed in due time.
You can find this
When the user calls Spark.connect(), the user code will be blocked, and the Core will attempt to negotiate a connection. This connection will block until either the Core connects to the Cloud or an interrupt is fired that calls Spark.disconnect().
BTW: @Dave, would it not be useful to have something like Spark.connect(uint timeout = 0) which would just terminate any unsuccessful connection attempts without the need for the user to setup a timed interrupt?
I looked at the page about interrupts as you suggested but saw nothing on timed interrupts…
only how to assign an interrupt to a certain pin an how to react to it.
Did I miss something? how can I set up a timed interrupt? (or do I have to make it a Hardware interrupt)
Having a broken internet-connection blocking my program on my Core makes it unreliable (as unreliable as my internet connection or… the servers at Spark - I remember a number of weeks ago there was a serverproblem that blocked my core)… an maybe my Core will come online after the problem is solved… but my fish don’t reboot…
We take our reliability very seriously, please let me know if you’re seeing some kind of issue that you think is on our end, and I’ll investigate. We are constantly improving as we go as well, and sometimes bugs slip through, but we try to keep that a very rare event.