This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
app-hotes:wifi-switcher [2023/10/31 15:27] – [Setup Wifi Networks List] cakir | app-hotes:wifi-switcher [2023/12/12 12:21] (current) – [Goal] cakir | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Wifi Switcher ====== | ====== Wifi Switcher ====== | ||
- | ===== Goal ===== | + | ===== Goal and benefit for the costumer |
- | In this guide we will describe how to setup the WiFi Switcher SDK script on a Netmodule router. This script will take care of automatically connecting to a WiFi Access Point when it is part of a list we defined. The list is in a seperate file and consists of SSIDs and associated Password. | + | In this guide we will describe how to setup the WiFi Switcher SDK script on a Netmodule router. This script will take care of automatically connecting to a WiFi Access Point when it is part of a list we defined. The list is in a seperate file and consists of SSIDs and associated Password. |
===== Application example ===== | ===== Application example ===== | ||
Background for this script is a customer who uses our routers in railway applications. The router in the train is supposed to connect to a WiFi network on each respective train station. Only WiFi access points that can be found in the list are used to connect to. | Background for this script is a customer who uses our routers in railway applications. The router in the train is supposed to connect to a WiFi network on each respective train station. Only WiFi access points that can be found in the list are used to connect to. | ||
| | ||
+ | | ||
+ | <code c application-example> | ||
+ | TRAIN TRAIN TRAIN TRAIN | ||
+ | STATION A STATION B STATION C STATION X | ||
+ | +--------+ | ||
+ | |WIFI AP1| |WIFI AP2| |WIFI AP3| |WIFI APX| | ||
+ | | | | ||
+ | +--------+ | ||
+ | |||
+ | TRAIN WIFI CLIENT | ||
+ | +--------+ | ||
+ | +----------------------------------------------> | ||
+ | </ | ||
+ | |||
===== Setup ===== | ===== Setup ===== | ||
Here we will describe step-by-step how to setup the router with the wifi switcher functionality. | Here we will describe step-by-step how to setup the router with the wifi switcher functionality. | ||
Line 48: | Line 63: | ||
You have the option to set DEBUG=1, this will give you some debug output visible in tail-log. | You have the option to set DEBUG=1, this will give you some debug output visible in tail-log. | ||
- | First the scirpt will import the list of access points it is supposed to connect to. | + | First the scirpt will import the list of access points it is supposed to connect to. Then the scirpt will keep on looking up the state of the WiFi (WLAN1 which is setup as WANLINK2). |
- | + | ||
- | Then the scirpt will keep on looking up the state of the WiFi (WLAN1 which is setup as WANLINK2). | + | |
- | In case of the state being " | + | |
- | In caste the state is " | + | In case of the state being " |
After the scan is finished we take the data and compare it to the list we imported earlier. When a known access point is found and the last WiFi config update is at least 120 seconds in the past, we update the wifi config so we can connect to the now available WiFi AP. | After the scan is finished we take the data and compare it to the list we imported earlier. When a known access point is found and the last WiFi config update is at least 120 seconds in the past, we update the wifi config so we can connect to the now available WiFi AP. |