

How to connect to Wi-Fi

## Setting

See [Settings](/reference/obnizos-for-esp32/settings/) for instructions on how to set it up.  
Network settings are stored in non-volatile space on the device.

Up to 5 Wi-Fi connection settings are stored on the device, and the oldest settings are deleted when they are added It is.

## Connection Flow

1. (When the startup and network settings are set to "Wi-Fi")
2. active scan for Wi-Fi
3. try to connect to the Wi-Fi information stored in the scan results, starting with the one with the strongest RSSI.
4. try to connect sequentially to the stored Wi-Fi settings that were not in the rest of the scan results but are saved.
5. waiting for Wi-Fi setting if all connections are not made (if not, the system will time out and restart in about 30 seconds)

#### Connection Flow(obnizOS3.4.0かそれ以前の接続フロー)

1. (When the startup and network settings are set to "Wi-Fi")
2. Active scan for Wi-Fi
3. Try to connect if there is any Wi-Fi information stored in the scan results.
4. If any of the stored Wi-Fi information has a stealth SSID, try to connect to it sequentially.
5. If you can't connect to all of them, you will have to wait for the Wi-Fi setting (if it is not set, it will take about 30 seconds out and restart)

#### Connection Flow for obnizOS 3.3.0 and ealier

1. (When the startup and network settings are set to "Wi-Fi")
2. If there was an SSID that was successfully connected last time
    1. Connect without performing a Scan
    2. If the connection fails, it is recorded as a failure.
3. Active scan for Wi-Fi
4. Try to connect if there is any Wi-Fi information stored in the scan results.
5. If any of the stored Wi-Fi information has a stealth SSID, try to connect to it sequentially.
6. If you can't connect to all of them, you will have to wait for the Wi-Fi setting (if it is not set, it will take about 30 seconds out and restart)