Attempts to connect to the Wi-Fi network. If there are no credentials stored, this will enter listening mode (see below for how to avoid this.). If there are credentials stored, this will try the available credentials until connection is successful. When this function returns, the device may not have an IP address on the LAN; use
WiFi.ready() to determine the connection status.
// SYNTAX WiFi.connect();
It's possible to call
WiFi.connect() without entering listening mode in the case where no credentials are stored:
// SYNTAX WiFi.connect(WIFI_CONNECT_SKIP_LISTEN);
If there are no credentials then the call does nothing other than turn on the Wi-Fi module.
On Gen 3 devices (Argon, Boron, B Series SoM, and Tracker), prior to Device OS 2.0.0, you needed to call
Cellular.on() before calling
Particle.connect(). This is not necessary on Gen 2 devices (any Device OS version) or with 2.0.0 and later.