I am new to Spark Core. I am using WebIDE particle build to build my firmware. I am finding some issues as explained below. I searched many similar posts, but not able to get what I am exactly looking for. Any help/solution would be very much appreciated.
- Primary requirement is to preserve the charge of my battery that powers my Spark Core
- I should be able to put my spark to deep sleep or wifi sleep and also wake it up using commands invoked over the cloud (Spark function calls).
Here are the issues I am facing:
I can easily put my spark into deep sleep using Spark.sleep() call invoked over the cloud. But the problem is in waking it up. As it turns out, cloud command cannot be sent to wake up the core since its in deep sleep and my command can’t reach the core since the wifi communication is off. Any suggestion on an alternative design/solution for this?
When I invoke wifi sleep, say Spark.sleep(30), the wifi shuts down and I can see the green blinking on RGB LED. But the problem is it never comes out of that even after 30 seconds. Is it a bug or known issue? (I simply call Spark.sleep(30) at the end of my setup()).
I am using a portable USB charger to power my Spark. When I use deep sleep in the range of few minutes, it comes back up. But if I set longer sleep (I used 30 mins/1 hour), the spark doesn’t come back up at all. I have to press the on/off switch of my portable USB charger to bring up the Core. It looks like my USB battery itself is probably going into a standby mode after sometime since very low current is pulled from it. Is it the case? I need to still see my USB charger’s specs. But I am thinking if I use regular 4 AA batteries, I probably won’t get into this issue?
I would like to use interrupt-driven wake up from deep sleep if possible, over the cloud. The use case is that my core should be by default in a deep sleep after it comes up and live for sometime (to preserve my battery power). Now when I send a command (e.g. to rotate a servo attached to A0 of the core) over the cloud, it should wake up the core and execute the command. But I guess this won’t be possible since wifi communication will be off. It seems only native code (no external communication) can be written to trigger an interrupt - but how does external world can trigger that native code?
For now, what I have done is that, inside my loop(), I am sending my core to deep sleep every hour and waking it up for only 3 minutes, and so on. But this is not working due to the USB charger issue. I can possibly bypass that using a 4 AA battery pack. But still this solution won’t help me eventually since the requirement is to be able to wake up the core using user command over the cloud - whether specific command to just wake it up, or some other function command (e.g. rotate the servo) that would first wake up the core and execute the command.