I am still figuring things out with the spark core so forgive me if this has been solved, or there is a way to make this situation work. The closest I have found was “Can I Turn the CC3000 OFF?” located here https://community.spark.io/t/can-i-turn-the-cc3000-off/3233 . What I am looking to do may also be accomplished in code possibly, but I am not sure where to start.
If I 1. lose WiFi, or 2. lose connection to the cloud the core appears to stop processing the code/user loop. Sometimes I get auto-reset (CFOD) and then there is no WiFi available and the core sits. I seem to be able in code to check if I am connected to WiFi and check the connection to the cloud and can program around a no connection scenario. However, when the loop stops and/or resets I can’t program around that.
What I would like if possible…
User/Code loop executes no matter what, period.
If WiFi is available, latch on and get an ip address. If not try again later.
If cloud is available connect to cloud. If not try again later.
(nice to have, but not a connectivity issue) When a core is being flashed, instead of halting the execution fire off a method “finally” or “done” whatever you want to call it with a timeout. This way I can nicely save off any data to the EEPROM, save my state off with HTTP call, and change the states of the pins (set them low to turn off relays etc.) This would provide a graceful firmware update.
Is there some way to accomplish this? Or any chance these ideas could be incorporated in to the firmware?
Thanks for your reply @kennethlimcp. I hope with the possibility of #1 in June it gets implemented since it seems like how most users expect the core to function. I don’t see much harm implementing #4 since if you don’t need that type of functionality you could just leave the function blank. I will have to pull down the code and see if I can figure out how to implement such functionality. How does the process work to get functionality baked in to the default? Is there some sort of voting?
My wifi has dropped out at night for 2 days in a row. Green light flashing. Signal strength is reasonable strong. Im about 7 meters away from a 3 antenna router. It will not recover unless I reset the spark. As a test, i turn router wifi off and on, and it recovers fine. Any tips? How can I tell the signal strength?
Is the external trigger going to help signal strength. (I have internal)
Can i ping the spark?
I dont have that mac. Closest mac to that doesnt ping, thought the spark works.
So I will try serial console.
Ive never run console on spark before. I held down switch to get usb to work, installed drivers ok.
open com port and there is no traffic, and the spark code doesnt run.
Lot of things to know for new person to spark. Love it though.
@kiwibird1, you can put the CC3000 in standby using Spark.sleep(seconds) and it will wake after the specified time. You cannot actually turn the CC3000 off unless you put the Core into deep sleep. You can boot with WiFi disabled by including:
at the top of your code and then use WiFi.on()/WiFi.off() to control the wifi with your code. You can test for wifi connectivity using WiFi.status() which will return an WIFI_ON/WIFI_CONNECTING/WIFI_ON status that you can test and act on.
You could use a combination of these:
setup your code to start with wifi disabled
at the top of loop() and based on a timer (see below) do a WiFi.on() and timeout if it does not connect
if you timeout, do a WiFi.off() to put the CC3000 in standby
(re)start a timer to wait x seconds or minutes before trying the WiFi.on() again
The com ports working and not working seems to happen to me as well from time to time. I have found sometimes I just unplug the usb going to the core wait a little and connect and the com port is back. On windows you can verify when the port if available via device manager under com ports.