To disable the particle internet connection, you'll want to run your Oaks in SEMI_AUTOMATIC mode i.e.
SYSTEM_MODE(SEMI_AUTOMATIC); at minimum... this will get them onto your wifi, but won't start the particle connection itself. This also allows you to still use the
SoftAP OakConfig app (although the particle login on the app would then be rather pointless).
If you want full control of the wifi, you then want your Oaks in MANUAL mode i.e.
SYSTEM_MODE(MANUAL); which will let you choose when to start the wifi connection. The following code should give you an idea as to how it all fits together. It will connect to a hard-coded wifi network, and attempt to use the specified IP. Whilst the wifi is connecting the P1 led should rapidly blink. Then once the main loop is running the classic blink sketch runs... I disabled persistence so that it doesn't interfere with the SoftAP OakConfig app as the P1 config mode is still available for use, and there is no need for it anyway as the wifi SSID / passwd is hard coded in the sketch. This then allows your to use Particle still for the OTA programming if you want access to it at any time.
When you load this code via OTA programming, you will get a message saying "Error : Reboot timeout - flash likely failed.", which is to be expected, as the Oak never connects to particle after starting the sketch, thus can't report that it is online.
SYSTEM_MODE(MANUAL);
#include <ESP8266WiFi.h>
//WiFi config stuff
char SSID[] = "yourNetwork"; // your network SSID
char passwd[] = "secretPassword"; // your network password
//Static IP stuff
IPAddress ip(192, 168, 0, 70); //your static IP
IPAddress gateway(192, 168, 0, 1); //your gateway IP
IPAddress subnet(255, 255, 255, 0); //your subnet mask
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
//don't save these details
WiFi.persistent(false);
//configure the WiFi to use the custom settings
WiFi.config(ip, gateway, subnet);
//start the WiFi connection process
WiFi.begin_internal(SSID, passwd, 0, NULL);
//wait for WiFi to connect
while (WiFi.status() != WL_CONNECTED)
{
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
}
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}