@NanoAkron, the short answer is via USB using dfu-utils and the Spark CLI comes in hand as well. There is another trick, however, that I used at the Maker Fair since the wifi there was bad at best! I define a pin on the Spark as a “WiFi enable” pin and check it in setup(). The Core starts with wifi and cloud off and if the pin is grounded, I turn them both ON:
#include "spark_disable_wlan.h"
#include "spark_disable_cloud.h"
//...
#define WIFI_JUMPER D0 //Can be any pin
void setup()
{
pinMode(WIFI_JUMPER, INPUT_PULLUP);
if (digitalRead(WIFI_JUMPER) == HIGH) {
WiFi.on();
while (WiFi.status() != WIFI_ON) //Wait for wifi to come ON
SPARK_WLAN_Loop();
Spark.connect();
while (!Spark.connected())
SPARK_WLAN_Loop();
}
//... rest of your code
}
So if you power up/reset your Core with the pin OPEN, it will enable wifi. With the pin shorted to ground, wifi will remain OFF and your code will run as usual.