AP Hotspot Mode

AP Hotspot ModeRoutine explanationIntroductionComplete codeflow chartA brief introduction to WLAN related APIs

 

Routine explanation

Introduction

In the previous tutorial, we successfully connected to a nearby network through the WIFI chip. When we connect to an existing wireless network, we use the STA mode. In fact, this chip can also be used as an AP, that is, as a device that sends out WIFI signals and builds a local area network. In this section, we will try to use the K230 AP mode to start a WIFI hotspot.

image-20250218212631249

The AP activation status is False here, which does not affect subsequent operations and can be ignored.

After creation, we can use a mobile phone or computer to connect to this WIFI. After the connection is successful, we can see the following WIFI configuration details

(The picture takes Windows 10 as an example. For other versions of the system, you can search for how to view network information by yourself)

image-20250218213007599

Complete code

The complete code file is in [Source Code/11.Network/02.hotspot/ap.py]

flow chart

image-20250218213833076

Possible BUGs:

In the code, we use clients = ap.status('stations') and len(clients) to determine the number of connections. If the program ends abnormally, it may cause abnormal counting. In this case, you can press and hold the reset button of K230 or turn off the power for a while and then reconnect K230.

A brief introduction to WLAN related APIs

AP Mode (Access Point):