When I turn the spark core off and ping the ip that it last uploaded to the cloud with WiFi.localIP(), the ip address returns packets. I can’t understand why. My goal is to quickly be able to see when the Spark drops off the network, and the cloud updates to “connected”: false too slowly for my needs. Where can I get the DHCP address of the spark core?
Could you please elaborate a bit more about how you turn the Core off.
You have to distinguish between the WiFi and thw cloud connection.
The WiFi.localIP() address is the address assigned to your core by the local DHCP server, typically your router. I think something is wrong with either your network or your methodology if something at that address still answers pings after being powered off.
After the last major TI WiFi chip patch (“deep update”), the TI CC3000 does not always autonomously answer pings. It seems to depend on whether or not there is network activity already. If you have the cloud on, my experience is that a core will not answer pings, but if start with the cloud off, it will answer.
Maybe you could describe what you are doing in more detail?
I unplug the core from the microusb plug to simulate it suddenly leaving the network.
OK, so the power to core is off, right?
How are you pinging it? From where?
I turn the core on with a script that will/(should) store the local ip address to the cloud. Once I power on the core and wait for it to connect to the cloud, I run a python script that grabs the ip address from the cloud with an https request, and starts pinging it continuously. It works well, up until the point when I unplug the core, and I continue to get responses from it’s ip address. I am currently on my school wifi, so I’m uncertain how the network is set up, though.
I don’t think you are actually pinging your core. Like I said above, when the cloud is on, it does not answer pings for me. I think you are actually pinging some other host.
In order for this scheme to work, your core and the computer running python that pings it have to be on the same WiFi network. Are they on the same WiFi network (same SSID, same access point, etc)?
Have you checked the IP address you’re pinging?
Is it really the Core’s address?
How does your network/script react to other hosts’ drop-outs?