Skip to content

WLAN Basic Function Usage Guide


1. WLAN Function Introduction

The basic components of a WiFi network include wireless access points AP (Access Point) and stations STA (Station). In WiFi networks, the AP is the creator and coordinator of the wireless network, responsible for managing and coordinating data transmission of the entire network, while STA represents terminal devices connected to the network. Each terminal device such as a PC or mobile phone can be considered as a STA.

AP Mode: Access Point, provides wireless access service, allows other wireless devices to connect, and provides data access. General wireless routers/bridges work in this mode. APs can be interconnected with each other.

STA Mode: Station, similar to a wireless terminal. The STA itself does not accept wireless connections. It can connect to an AP. General wireless network cards work in this mode.


2. Module Introduction

The D2 development board uses the SSW118GE module to provide WiFi functionality. Related drivers and software are packaged by default on the board. The following introduces how to use it.

Detailed documentation for the software used by the WiFi module: SSW118GE_SSTAR_IOT_SUPPLICANT_Manual_en.pdf


3. Loading Driver

3.1. Command Execution

Enter the command line interface and type

cd /customer/sample_code/bin/wifi
./insmod_wifi.sh

to load the WiFi driver. After input, the following log will be displayed:

/ # ./customer/sample_code/bin/wifi/insmod_wifi.sh
SDMMC1 >> [Hal_CARD_SetBustiming] LS mode. <<
SDMMC1 >> [Hal_CARD_SetBustiming] DEFS mode. <<
Fail to get pad(0x0) ip(0x1_8)  form padmux !
SDMMC1 >> [Hal_CARD_SetBustiming] DEFS mode. <<
SDMMC1 >> [Hal_CARD_SetBustiming] LS mode. <<
/ # SDMMC1 >> [Hal_CARD_SetBustiming] HS mode. <<
*** Welcome to use Sstar_iot_supplicant ***

VER: 2025-0415-1100.


DRIVER VER: 2025-0415-1100.
[Sstar_log]:Sstar_init_firmware
[Sstar_log]:----drvier support chip RHEA
[Sstar_log]:Probe called
[Sstar_log]:Sstar_sdio_probe:v12
[Sstar_log]:Sstar_after_load_firmware++
[Sstar_log]:Sstar_sdio_rx_thread
[Sstar_log]:set_block_size=256
[Sstar_log]:mdelay wait wsm_startup_done  !!
[Sstar_log]:firmwareCap c03d
[Sstar_log]:firmwareCap2 0
CAPABLITIES_SDIO_TX_LIST_CHECK  4
CAPABLITIES_TX_CONFIRM_NOTIFY   8
CAPABLITIES_HOST_CONFIG         16
CAPABLITIES_HOST_BA_PARAM       32
[Sstar_log]:wsm_caps.firmwareCap c03d
[Sstar_log]:apollo wifi WSM init done.
   Input buffers: 24 x 1632 bytes
   Hardware: 0.25697
   WSM firmware [=IOT=RF=Ares_AX e641e7a8 2GHZ Nov  3 2025 11:22:46], ver: 25697, build: 0, api: 59304, cap: 0xC03D Config[30004]  expection 9007094, tx prog 24
[Sstar_log]:rx timeout
[Sstar_log]:Sstar_sdio_tx_thread
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(23),used(1)
[Sstar_log]:Sstar_get_mac_address.7b:91:c9:69:ea
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(22),used(1)
[Sstar_log]:wifi mode:AP
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(21),used(1)
[Sstar_log]:Sstar_configure_wifi_mode:aes
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(20),used(1)
sync hera ba parames ok.
[Sstar_log]:[Sstar_wtd]:set wtd_probe = 1
[Sstar_log]:Sstar: mmc2 is not found.
Sstar_ioctl_open cost time: 0 ms
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(19),used(1)
[WIFI_MODE] AP
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(18),used(1)
[Sstar_log]:Sstar_get_mac_address.7b:91:c9:69:ea
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(17),used(1)
[Sstar_log]:tcp_port_filter addcnt.2:
[Sstar_log]:Sstar_open

Seeing "Sstar_open" indicates that the WiFi module driver has been loaded successfully.

At the same time, you can input

./Sstar_iot_cli status

to check the WiFi connection status. By default, it will be shown as below:

After the driver is loaded, WiFi will enter AP mode by default with the name AI_GLASSES, which is configured for the ai_glasses demo. For AP mode usage introduction, please see below.

3.2. Function Introduction

The driver and driver loading scripts are packaged by default in the /customer/sample_code/bin/wifi path.

  • ssw118ge_wifi_sdio.ko: WiFi module driver

  • insmod_wifi.sh: WiFi module driver loading script

  • rmmod_wifi.sh: WiFi module driver unloading script

Please use the configured insmod_wifi.sh and rmmod_wifi.sh scripts for insmod and rmmod operations here.


4. AP Mode

4.1. Command Execution

After driver insmod, AP mode will run by default, but the configured name will be ai_glasses, which is configured by default for the ai_glasses demo.

If you need to reset the AP mode name and password, you need to execute commands.

In the /customer/sample_code/bin/wifi path, you can use the Sstar_iot_cli command to configure and start AP mode.

The following is a simple AP startup script example. Please input the following commands to execute:

/customer/sample_code/bin/wifi/Sstar_iot_cli wifi_mode AP
/customer/sample_code/bin/wifi/Sstar_iot_cli clear_ap_cfg
/customer/sample_code/bin/wifi/Sstar_iot_cli set_ap_cfg ssid sstest
/customer/sample_code/bin/wifi/Sstar_iot_cli set_ap_cfg key 12345678
/customer/sample_code/bin/wifi/Sstar_iot_cli set_ap_cfg key_mgmt WPA2
/customer/sample_code/bin/wifi/Sstar_iot_cli enable_ap_cfg
  • wifi_mode: Set WiFi working mode to AP mode

  • set_ap_cfg ssid: The name of the created hotspot

  • set_ap_cfg key: Hotspot password

The following log will appear:

/customer/sample_code/bin/wifi # ./Sstar_iot_cli enable_ap_cfg
cmd_line: enable_ap_cfg
[Sstar_log]:Sstar_wsm_set_ap_cfg:aes
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(16),used(1)
/customer/sample_code/bin/wifi # hostevent->bssid 00:00:00:00:00:00 ipaddr 12ba8c0
[WAKEUP] IO wakeup
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(15),used(1)
[Sstar_log]:wifi mode:AP
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(14),used(1)
[Sstar_log]:Sstar_configure_wifi_mode:aes
[Sstar_log]:Sstar_stop
AP Mode.
ip addr:192.168.43.1
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(13),used(1)
[Sstar_log]:Sstar_get_mac_address.7b:91:c9:6d:c4
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(12),used(1)
[Sstar_log]:tcp_port_filter addcnt.2:
[Sstar_log]:Sstar_open
OK

Seeing "Sstar_open" indicates that AP mode has been started successfully.

You can use the following command to check AP status:

./Sstar_iot_cli status


5. STA Mode

5.1. Command Execution

After the driver is loaded, you can input

cd /customer/sample_code/bin/wifi
./sta.sh

For modifying the hotspot name and password connected in STA mode, please see the function introduction section below.

The following log will appear:

/customer/sample_code/bin/wifi # ./sta.sh
cmd_line: set_network ssid TP-LINK_C8D7
OK
cmd_line: set_network key SigmaStar30
OK
cmd_line: set_network key_mgmt WPA2
OK
cmd_line: wifi_mode STA
[Sstar_log]:Sstar_wsm_set_wifi_mode:[2][0][ef2a4c48]
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(15),used(1)
OK
cmd_line: enable_network
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(14),used(1)
OK
/customer/sample_code/bin/wifi # [WAKEUP] IO wakeup
CTRL-EVENT-STATE-DISCONNECTED
[Sstar_log]:Sstar_stop
CTRL-EVENT-STATE-DISCONNECTED
CTRL-EVENT-STATE-DISCONNECTED
sync hera ba parames ok.
sync hera ba parames ok.
sync hera ba parames ok.
hostevent->bssid 4c:10:d5:ae:c8:d7 ipaddr 6501a8c0
[Sstar_log]:Sstar_sta_connect_event: associated
update ba params idx=0.
ba_tid_params:action1,linkid1,tid0,ssn8.
CTRL-EVENT-STATE-CONNECTED - Connection to 4c:10:d5:ae:c8:d7 completed
ip addr:192.168.1.101
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(12),used(1)
[Sstar_log]:Sstar_get_mac_address.7b:91:c9:69:ea
[Sstar_log]:Sstar_sdio_tx_bh:cmd free(11),used(1)
[Sstar_log]:tcp_port_filter addcnt.2:
[Sstar_log]:Sstar_open

Seeing "Sstar_open" indicates successful connection.

5.2. Function Introduction

In the /customer/sample_code/bin/wifi path, there is sta.sh, with the following content:

/customer/sample_code/bin/wifi/Sstar_iot_cli set_network ssid sstest_STA
/customer/sample_code/bin/wifi/Sstar_iot_cli set_network key 12345678
/customer/sample_code/bin/wifi/Sstar_iot_cli set_network key_mgmt WPA2
/customer/sample_code/bin/wifi/Sstar_iot_cli wifi_mode STA
/customer/sample_code/bin/wifi/Sstar_iot_cli enable_network
  • ssid: The hotspot name to be connected

  • key: Hotspot password

Sstar_iot_cli is also used here to control WiFi. Please modify the name and password yourself to test connection with mobile phone hotspots.

Other commands will not be explained in detail. For more details, please refer to the software detailed documentation at the beginning of this article.


6. DNS Configuration

6.1. Command Execution

Input

cd /customer/sample_code/bin/wifi
source dns_setup.sh

to configure DNS service successfully (source must be used here because it needs to export required libraries).

The connected hotspot can access the external network. After completion, you can try to ping Baidu. Normal ping connection indicates success.

6.2. Function Introduction

There is dns_setup.sh in the /customer/sample_code/bin/wifi path with the following content:

export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/customer/sample_code/bin/wifi/libdns

touch /etc/resolv.conf
echo nameserver 8.8.8.8 > /etc/resolv.conf

GATEWAY="192.168.1.1"
route add default gw $GATEWAY dev wlan0
echo "Route added with gateway: $GATEWAY"

Here the GATEWAY ip needs to be modified manually according to the actual situation. First input

./Sstar_iot_cli status

Here you can see the gateway address of the connected hotspot. Fill this address into the GATEWAY in dns_setup.sh.