@kennethlimcp, With the default Spark application, the user setup() and loop() doesn’t run unless the Core first connects to the cloud at boot-up.
What you want could be achieved by removing the following if() clause in main.cpp.
if(!SPARK_WLAN_SETUP || SPARK_WLAN_SLEEP || !SPARK_CLOUD_CONNECT || SPARK_CLOUD_CONNECTED || SPARK_WIRING_APPLICATION)
{
}
When the above is done, most of the time the socket connect call for cloud connection will block the user loop from running and will constantly lead to WLAN restart if internet is not present or blocked (WiFi is available)
I’ll create a github issue so can be debated over there if this is what the user experience should be i.e. run user application irrespective of cloud/internet connection.