Is it possible to switch the Wifi mode in the program between AP/STA ?
Greating
Monki
Change WIFI Mode
- cicciocb
- Site Admin
- Posts: 2056
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 439 times
- Been thanked: 1354 times
- Contact:
Re: Change WIFI Mode
Yes, with these 2 commands :
and
Code: [Local Link Removed for Guests]
WIFI.APMODE SSID$, password$ [, channel] [, IP$ , MASK$]
Put the module in AP-Mode using the given SSID and Password.
Optionally it is possible to define the Radio Channel, the IP and the MASK address
Code: [Local Link Removed for Guests]
WIFI.CONNECT SSID$, password$ [, BSSID$] [, IP$ , MASK$ [, GATEWAY$]]
Connect the module to a WiFi network using the given SSID and password.
Using the optional parameter BSSID$ will start the connection to a specific WiFi access point.
It is possible to gather the connection status using the function WIFI.STATUS
The IP address configuration set in the config page will be used for the new connection; this may cause the module to fall outside the WIFI network IP range.
This can be avoided leaving the IP address blank in the config page relying on DHCP to assign them.
Optionally it is possible to define the IP, the MASK and the GATEWAY using the optional string parameters.