![]() |
Back to main page |
---|
1. CLI Presentation
These applications aim to evaluate and to test the ST67W611M1 Wi-Fi® solution via a command line interface (CLI).
Two CLIs are available in the project directory:
Project name | Description |
---|---|
ST67W6X_CLI | It exercises the network co-processor (ST67W611M1) capabilities embedding the LwIP, Wi-Fi® stack and Bluetooth® LE stack. |
ST67W6X_CLI_LWIP | It exercises the network co-processor (ST67W611M1) capabilities embedding the Wi-Fi® stack and Bluetooth® LE stack. The LwIP is offloaded and present in the host code. |
Both projects rely on the FreeRTOS RealTime operating system to manage the ST67W611M1 expansion board.
The application enables basic Wi-Fi® operations, such as scanning available local access points (APs) and connecting to an AP. It also supports testing LwIP functionalities such as DHCP, pinging URLs or specific IP addresses, MQTT, and IPerf.
The application enables basic Bluetooth® LE functionalities like scanning, connecting and advertising.
2. Requirements
2.1. Software and system requirements
The software requirements are the following (minimum IDEs version):
- STM32CubeIDE toolchain V1.19.0 [1].
- IAR Embedded Workbench for ARM (EWARM) toolchain V9.30.1
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.39
Programmer:
- STM32CubeProgrammer [2] to program the board with a pre-generated binary file
HyperTerminal:
- Use the application through the serial link
- Open a HyperTerminal client connected to the host ST-LINK COM port
The serial COM port must be configured as shown below:
Baudrate | 921600 |
Data | 8b |
Stopbit | 1b |
Parity | None |
Flow control | None |
Rx | LF |
Tx | LF |
Local Echo | Off |
For further details, refer to the HyperTerminal setup page.
2.2. Hardware requirements
This project is available on NUCLEO-U575ZI-Q, NUCLEO-H563ZI, NUCLEO-H7S3L8 or NUCLEO-N657X0-Q host boards combined with the X-NUCLEO-67W61M1 board.
The X-NUCLEO-67W61M1 board is connected to the NUCLEO host board via the Arduino® connectors:
- The 5V, 3V3, GND through the CN6
- The SPI (CLK, MOSI, MISO), SPI_CS and USER_BUTTON signals through the CN5
- The BOOT, CHIP_EN, SPI_RDY and UART TX/RX signals through the CN9
3. ST67W6X_CLI application description
3.1. Project directory
The ST67W6X_CLI and ST67W6X_CLI_LWIP applications are available by downloading the X-CUBE-ST67W61 Package.
Refer to the Project directory wiki page for more information on the project directory.
3.2. Project description
3.2.1. Topology structure
The ST67W6X_CLI project can operate in station or in both station and soft-access point (soft-AP) mode.
The ST67W6X_CLI_LWIP project can only operate in station mode.
The STA mode can be described with the following scheme:
Station and soft-AP modes can be described with the following scheme:
3.2.2. Project initialization
The different steps of the application initialization are described below:
3.3. Build and Install
Refer to the build and install chapter for detailed instructions on how to build and download the software onto the device.
3.3.1. ST67W6X default configuration
The default system configuration can be modified in "ST67W6X/Target/w6x_config.h":
/** ST67W611M will go by default in low power mode when ST67W611M is in idle mode */ #define W6X_POWER_SAVE_AUTO 1 /* DEFINE TO 0 IN ST67W6X_CLI_LWIP PROJECT */ /** ST67W611M clock mode : 1: Internal RC oscillator, 2: External passive crystal, 3: External active crystal */ #define W6X_CLOCK_MODE 1
Note: External clock oscillator must be used to support Bluetooth® LE in low power mode, if W6X_POWER_SAVE_AUTO is set to 1 but clock mode is not correct W6X_Ble_Init() API disable the low power.
The default Wi-Fi® configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** Boolean to enable/disable autoconnect functionality */ #define W6X_WIFI_AUTOCONNECT 1 /* DEFINE TO 0 IN ST67W6X_CLI_LWIP PROJECT */ /** Define the max number of stations that can connect to the Soft-AP */ #define W6X_WIFI_SAP_MAX_CONNECTED_STATIONS 4 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Define the region code, supported values : [CN, JP, US, EU, 00] */ #define W6X_WIFI_COUNTRY_CODE "00" /** Define if the country code will match AP's one. * 0: match AP's country code, * 1: static country code */ #define W6X_WIFI_ADAPTIVE_COUNTRY_CODE 0
The default Bluetooth® LE configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** String defining BLE hostname */ #define W6X_BLE_HOSTNAME "ST67W61_BLE"
The default Net configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** Define the DHCP configuration : 0: NO DHCP, 1: DHCP CLIENT STA, 2:DHCP SERVER AP, 3: DHCP STA+AP */ #define W6X_NET_DHCP 3 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** String defining Soft-AP subnet to use. * Last digit of IP address automatically set to 1 */ #define W6X_NET_SAP_IP_SUBNET {10, 19, 96} /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** String defining Wi-Fi hostname */ #define W6X_NET_HOSTNAME "ST67W61_WiFi" /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Timeout in ticks when calling W6X_Net_Recv() */ #define W6X_NET_RECV_TIMEOUT 10000 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Timeout in ticks when calling W6X_Net_Send() */ #define W6X_NET_SEND_TIMEOUT 10000 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */
The default HTTP configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** HTTP Client thread stack size */ #define W6X_HTTP_CLIENT_THREAD_STACK_SIZE 1536 /** HTTP Client thread priority */ #define W6X_HTTP_CLIENT_THREAD_PRIO 30 /** Timeout value in millisecond for receiving data via TCP socket used by the HTTP client. * This value is set to compensate for when the NCP get stuck for a long time (1 second or more) * when retrieving data from an HTTP server for example */ #define W6X_HTTP_CLIENT_TCP_SOCK_RECV_TIMEOUT 1000 /** Size of the TCP socket used by the HTTP client, recommended to be at least 0x2000 when fetching lots of data. * 0x2000 is the value used in the SPI host project for OTA update, which retrieves around 1 mega bytes of data. */ #define W6X_HTTP_CLIENT_TCP_SOCKET_SIZE 12288
The default utilities configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** Enable Iperf feature */ #define IPERF_ENABLE 1 /** Enable IPv6 for Iperf */ #define IPERF_V6 1 /* DEFINE NOT PRESENT IN ST67W6X_CLI PROJECT */ /** Enable memory performance measurement */ #define MEM_PERF_ENABLE 0 /** Enable task performance measurement */ #define TASK_PERF_ENABLE 1 /** Enable LittleFS */ #define LFS_ENABLE 0 /** Enable Wi-Fi Alliance Traffic Generator */ #define WFA_TG_ENABLE 1
The shell can be configured in the "ST67W6X/Target/shell_config.h" file:
/** Enable the shell component */ #define SHELL_ENABLE 1 /** Default shell commands list level (0: Minimal, 1: Full) */ #define SHELL_CMD_LEVEL 0 /** Shell command maximum size */ #define SHELL_CMD_SIZE 256 /** Shell using color */ #define SHELL_USING_COLOR 1 /** Print an additional status message at the end of the command execution */ #define SHELL_PRINT_STATUS 0 /** Shell receive buffer size */ #define SHELL_FREERTOS_RX_BUFF_SIZE 256
The AT driver can be configured in "ST67W6X/Target/w61_driver_config.h":
/** Maximum number of detected AP during the scan. Cannot be greater than 50 */ #define W61_WIFI_MAX_DETECTED_AP 20 /** Enable/Disable Wi-Fi module logging */ #define WIFI_LOG_ENABLE 1 /** Enable/Disable Network module logging */ #define NET_LOG_ENABLE 1 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Maximum number of detected peripheral during the scan. Cannot be greater than 50 */ #define W61_BLE_MAX_DETECTED_PERIPHERAL 10 /** Enable/Disable BLE module logging */ #define BLE_LOG_ENABLE 1 /** Enable/Disable MQTT module logging */ #define MQTT_LOG_ENABLE 1 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Maximum SPI buffer size */ #define W61_MAX_SPI_XFER 6000 /* DEFINE to 1520 IN ST67W6X_CLI_LWIP PROJECT */ /** Debugging only: Enable AT log, i.e. logs the AT commands incoming/outcoming from/to the NCP */ #define W61_AT_LOG_ENABLE 0 /** Enable/Disable System module logging */ #define SYS_LOG_ENABLE 1
Additionally, some other options can be modified in the "ST67W6X/Target" directory with different configuration files, as outlined below:
- logging_config.h: This file provides configuration for the logging component, enabling the setting of the log level
- shell_config.h: This file provides configuration for Shell component.
- w6x_config.h: This file provides configuration for the W6X APIs (used during init).
- w61_driver_config.h: This file provides configuration for the W61 configuration module.
All available defines are available in template directory "Middlewares/ST/ST67W6X_Network_Driver/Conf"
3.3.2. Application configuration
- The three below sections are common between ST67W6X_CLI and ST67W6X_CLI_LWIP projects.
The logging output mode can be modified in "Appli/App/app_config.h":
/** Select output log mode [0: printf / 1: UART / 2: ITM] */ #define LOG_OUTPUT_MODE LOG_OUTPUT_UART
The host low-power mode can be modified in "Appli/App/app_config.h":
/** Low power configuration [0: disable / 1: sleep / 2: stop / 3: standby] */ #define LOW_POWER_MODE LOW_POWER_DISABLE
The host debugger pins can be modified in "Appli/App/app_config.h":
/** * Enable/Disable MCU Debugger pins (dbg serial wires) * @note by HW serial wires are ON by default, need to put them OFF to save power */ #define DEBUGGER_ENABLED 1
- The below sections concern only the ST67W6X_CLI project.
The echo client configuration can be modified in "Appli/App/echo.h":
/** URL of Echo TCP remote server */ #define ECHO_SERVER_URL "tcpbin.com" /** Port of Echo TCP remote server */ #define ECHO_SERVER_PORT 4242 #endif /* NET_USE_IPV6 */ /** Minimal size of a packet */ #define ECHO_TRANSFER_SIZE_START 1000 /** Maximal size of a packet */ #define ECHO_TRANSFER_SIZE_MAX 2000 /** To increment the size of a group of packets */ #define ECHO_TRANSFER_SIZE_ITER 250 /** Number of packets to be sent */ #define ECHO_ITERATION_COUNT 10
The FOTA client configuration can be modified in "Appli/App/fota.h":
/** Timeout value to set the FOTA timer to when the FOTA application encountered an error for the first time. * This allows to tune the timeout value before doing a retry attempt. (not applicable if FOTA timer is not used)*/ #define FOTA_TIMEOUT 20000 /** Delay to wait before rebooting the host device, waiting for NCP device to finish update */ #define FOTA_DELAY_BEFORE_REBOOT 16000 /** Stack size of the FOTA application, this value needs to take into account the HTTP client * and NCP OTA static data allocation */ #define FOTA_TASK_STACK_SIZE 1800 /** The max size of the URI supported, this because the buffer * that will receive this info is allocated at compile time (static) */ #define FOTA_URI_MAX_SIZE 256 /** Default HTTP server address */ #define FOTA_HTTP_SERVER_ADDR "192.168.8.105" /** Default HTTP port */ #define FOTA_HTTP_SERVER_PORT 8000 /** The folder containing the FOTA header, ST67 binary and the STM32 binary */ #define FOTA_HTTP_URI_TARGET "/STM32U575ZI_NUCLEO" /** Root folder of interest on the HTTP server */ #define FOTA_HTTP_COMMON_URI "/download" FOTA_HTTP_URI_TARGET /** Default URI for the ST67 binary, should be smaller in bytes size than the value defined by FOTA_URI_MAX_SIZE */ #define FOTA_HTTP_URI FOTA_HTTP_COMMON_URI "/st67w611m_mission_t01_v2.0.89.bin.ota" /** Default URI for the STM32 binary, should be smaller in bytes size than the value defined by FOTA_URI_MAX_SIZE */ #define FOTA_HTTP_URI_STM32 FOTA_HTTP_COMMON_URI "/fota_ST67W6X_CLI.bin" /** Default URI for the FOTA header */ #define FOTA_HTTP_URI_HEADER FOTA_HTTP_COMMON_URI "/ST67W611_STM32U575ZI_NUCLEO.json"
3.4. How it works
Once the application is started, it enters a state where it waits for commands to be executed via the terminal. To list all the available commands, their descriptions and parameters, type "help". To display the help of a specific command, simply type "help <your command>".
w61/>help
3.4.1. Available commands
Below is the description of the commands available on the two projects ST67W6X_CLI (CLI) and ST67W6X_CLI_LWIP (CLI_LWIP).
By default, CLI projects are configured in a Minimal configuration, exposing only a subset of all available commands. To have all available commands in the shell, the define SHELL_CMD_LEVEL
must be set to one in "ST67W6X/Target/shell_config.h" file.
System Commands
Command | Description | CLI | CLI_LWIP | Minimal Shell |
---|---|---|---|---|
help | help [ command ]. Display all available commands and the relative help message | ✔ | ✔ | ✔ |
powersave | powersave [ 0: disable; 1: enable ] | ✔ | ✔ | ✔ |
fs_list | fs_list. List all files in the file system | ✔ | ✔ | |
fs_delete | fs_delete < filename >. Delete file from the ST67W611M1 file system | ✔ | ✔ | |
fs_read | fs_read < filename >. Read file content | ✔ | ✔ | |
fs_write | fs_write < filename >. Write file content from the Host to the ST67W611M1 | ✔ | ✔ | |
reset | reset < 0: HAL_Reset; 1: NCP_Restore; 2: NCP_Reset >. Reset the system | ✔ | ✔ | ✔ |
info | info. Display ST67W6X module info | ✔ | ✔ | ✔ |
atcmd | atcmd < AT+CMD? >. Execute AT command | ✔ | ✔ |
Wi-Fi® Commands
Command | Description | CLI | CLI_LWIP | Minimal Shell |
---|---|---|---|---|
wifi_antenna | wifi_antenna [ mode [0: disabled; 1: static; 2: dynamic ] ] | ✔ | ✔ | |
wifi_twt_teardown | wifi_twt_teardown | ✔ | ||
wifi_twt_status | wifi_twt_status | ✔ | ||
wifi_twt_setup | wifi_twt_setup < setup_type(0: request; 1: suggest; 2: demand) > < flow_type(0: announced; 1: unannounced) > < wake_int_exp > < min_wake_duration > < wake_int_mantissa > | ✔ | ||
wifi_dtim | wifi_dtim < value [greater than 0] > | ✔ | ✔ | |
wifi_ap_mac | wifi_ap_mac | ✔ | ||
wifi_ap_disconnect_sta | wifi_ap_disconnect_sta < MAC > | ✔ | ✔ | |
wifi_ap_list_sta | wifi_ap_list_sta | ✔ | ✔ | |
wifi_ap_stop | wifi_ap_stop | ✔ | ✔ | |
wifi_ap_start | wifi_ap_start [ -s SSID ] [ -p Password ] [ -c channel [1; 13] ] [ -e security [0:Open; 2:WPA; 3:WPA2; 4:WPA3] ] [ -h hidden [0; 1] ] [ -m protocol [1: 802 11 b; 2: 802 11 g; 3: 802 11 n; 4: 802 11 ax] ] | ✔ | ✔ | |
wifi_country_code | wifi_country_code [ 0:AP aligned country code; 1:User country code ] [ Country code [CN; JP; US; EU; 00] ] | ✔ | ✔ | |
wifi_sta_state | wifi_sta_state | ✔ | ✔ | ✔ |
wifi_sta_mac | wifi_sta_mac | ✔ | ✔ | |
wifi_auto_connect | wifi_auto_connect | ✔ | ✔ | |
wifi_sta_disconnect | wifi_sta_disconnect [ -r ] | ✔ | ✔ | ✔ |
wifi_sta_connect | wifi_sta_connect < SSID > [ Password ] [ -b BSSID ] [ -i interval [0; 7200] ] [ -n nb_attempts [0; 1000] ] [ -wps ] [ -wep ] | ✔ | ✔ | ✔ |
wifi_scan | wifi_scan [ -p ] [ -s SSID ] [ -b BSSID ] [ -c channel [1; 13] ] [ -n max_count [1; 50] ] | ✔ | ✔ | ✔ |
Bluetooth® LE Commands
Command | Description | CLI | CLI_LWIP | Minimal Shell |
---|---|---|---|---|
ble_init | ble_init [ 1: client mode; 2: server mode ] | ✔ | ✔ | ✔ |
ble_deinit | ble_deinit | ✔ | ✔ | |
ble_adv | ble_adv [ -a abort adv ] | ✔ | ✔ | ✔ |
ble_scan | ble_scan [ -a abort scan ] | ✔ | ✔ | ✔ |
ble_connect | ble_connect < Conn Handle [0; 1] > < BD Addr > | ✔ | ✔ | ✔ |
ble_disconnect | ble_disconnect < Conn Handle [0; 1] > | ✔ | ✔ | ✔ |
ble_tx_power | ble_tx_power [ Tx Power [0; 20] ] | ✔ | ✔ | |
ble_bd_addr | ble_bd_addr [ BD Addr ] | ✔ | ✔ | |
ble_device_name | ble_device_name [ Device Name ] | ✔ | ✔ | |
ble_adv_data | ble_adv_data < Advertising Data > | ✔ | ✔ | |
ble_adv_param | ble_adv_param [ AdvIntMin [32; 16384] ] [ AdvIntMax [32; 16384] ] [ Adv Type [0; 2] ] [ Adv Channel [1: chan 37; 2: chan 38; 3: chan 39; 7: all] ] | ✔ | ✔ | |
ble_scan_param | ble_scan_param [ Scan Type [0; 1] ] [ OwnAddr Type [0; 3] ] [ Filter Policy [0; 3] ] [ Scan Interval [4; 16384] ] [ Scan Window [4; 16384] ] | ✔ | ✔ | |
ble_scanrespdata | ble_scanrespdata < Scan Response Data > | ✔ | ✔ | |
ble_conn_param | ble_conn_param [ Conn Handle [0; 1] ] [ ConnIntMin [6; 3200] ] [ ConnIntMax [6; 3200] ] [ Latency [0; 499] ] [ Timeout [10; 3200] ] | ✔ | ✔ | |
ble_get_conn | ble_get_conn | ✔ | ✔ | |
ble_exchange_mtu | ble_exchange_mtu < Conn Handle [0; 1] > | ✔ | ✔ | |
ble_data_length | ble_data_length < Conn Handle [0; 1] > < TxBytes [27; 251] > < TxTransTime > | ✔ | ✔ | |
ble_srv_create | ble_srv_create < Service Index [0; 2] > < UUID > < UUID type > | ✔ | ✔ | ✔ |
ble_srv_delete | ble_srv_delete < Service Index [0; 2] > | ✔ | ✔ | |
ble_char_create | ble_char_create < Service Index [0; 2] > < Charac Index : [0; 4] > < UUID > < UUID type > < Charac Property > < Charac Permission: read 1; write 2 > | ✔ | ✔ | ✔ |
ble_srv_list | ble_srv_list | ✔ | ✔ | |
ble_srv_reg | ble_srv_reg | ✔ | ✔ | ✔ |
ble_rem_srv_list | ble_rem_srv_list < Conn Handle [0; 1] > | ✔ | ✔ | ✔ |
ble_rem_char_list | ble_rem_char_list < Conn Handle [0; 1] > < Service Index [1; 4] > | ✔ | ✔ | ✔ |
ble_send_notif | ble_send_notif < Service Index [0; 1] > < Char Index [0; 4] > < Timeout > < Data > | ✔ | ✔ | ✔ |
ble_send_indication | ble_send_indication < Service Index [0; 1] > < Char Index [0; 4] > < Timeout > < Data > | ✔ | ✔ | ✔ |
ble_read_data | ble_read_data < Service Index [0; 1] > < Char Index [0; 4] > < Timeout > < Data > | ✔ | ✔ | ✔ |
ble_client_write_data | ble_client_write_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] > < Timeout > < Data > | ✔ | ✔ | ✔ |
ble_client_read_data | ble_client_read_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] > | ✔ | ✔ | ✔ |
ble_client_subscribe_char | ble_client_subscribe_char < Conn Handle [0; 1] > < CharValue Handle > < Char Prop [1; 2] > | ✔ | ✔ | ✔ |
ble_client_unsubscribe_char | ble_client_unsubscribe_char < Conn Handle [0; 1] > < CharValue Handle > | ✔ | ✔ | |
ble_sec_param | ble_sec_param [ Security Parameter [0; 4] ] | ✔ | ✔ | |
ble_sec_start | ble_sec_start < Conn Handle [0; 1] > < Security Level [1; 4] > | ✔ | ✔ | |
ble_sec_set_passkey | ble_sec_set_passkey < Conn Handle [0; 1] > < PassKey [0; 999999] > | ✔ | ✔ | |
ble_sec_passkey_confirm | ble_sec_passkey_confirm < Conn Handle [0; 1] > | ✔ | ✔ | |
ble_sec_pairing_confirm | ble_sec_pairing_confirm < Conn Handle [0; 1] > | ✔ | ✔ | |
ble_sec_pairing_cancel | ble_sec_pairing_cancel < Conn Handle [0; 1] > | ✔ | ✔ | |
ble_sec_unpair | ble_sec_unpair < Remote BD Addr > < Addr Type [0; 3] > | ✔ | ✔ | |
ble_bonded_device_list | ble_bonded_device_list | ✔ | ✔ |
Net Commands
Command | Description | CLI | CLI_LWIP | Minimal Shell |
---|---|---|---|---|
dnslookup | dnslookup <hostname> | ✔ | ✔ | |
time | time < timezone : UTC format : range [-12; 14] or HHmm format : with HH in range [-12; +14] and mm in range [00; 59] > | ✔ | ||
ping | ping <hostname> [ -c count [1; max(uint16_t) - 1] ] [ -s size [1; 10000] ] [ -i interval [100; 3500] ] | ✔ | ✔ | ✔ |
net_dhcp | net_dhcp [ 0:DHCP disabled; 1:DHCP enabled ] [ 1:STA only; 2:AP only; 3:STA + AP ] [ lease_time [1; 2880] ] | ✔ | ✔ | |
net_ap_ip | net_ap_ip | ✔ | ✔ | |
net_sta_dns | net_sta_dns [ DNS1 addr ] [ DNS2 addr ] [ DNS3 addr ] | ✔ | ||
net_sta_ip | net_sta_ip [ IP addr ] [ Gateway addr ] [ Netmask addr ] | ✔ | ✔ | ✔ |
net_hostname | net_hostname [ hostname ] | ✔ | ✔ |
MQTT Commands
Command | Description | CLI | CLI_LWIP | Minimal Shell |
---|---|---|---|---|
mqtt_publish | mqtt_publish < Topic > < Message > [ -q Qos ] [ -r ] | ✔ | ✔ | |
mqtt_unsubscribe | mqtt_unsubscribe < Topic > | ✔ | ||
mqtt_subscribe | mqtt_subscribe < Topic > | ✔ | ✔ | |
mqtt_disconnect | mqtt_disconnect | ✔ | ✔ | |
mqtt_connect | mqtt_connect < -h Host > < -p Port > | ✔ | ✔ | |
mqtt_configure | mqtt_configure < -s Scheme > < -i ClientId > [ -u <Username> ] [ -pw <Password> ] [ -c <Certificate> ] [ -k <PrivateKey> ] [ -ca <CACertificate> ] [ -sni ] [ -ka <KeepAlive> ] [ -q <LWT_QoS> ] [ -cs ] [ -r ] | ✔ | ✔ |
FOTA Commands
Command | Description | CLI | CLI_LWIP | Minimal Shell |
---|---|---|---|---|
fota_http | fota_http < server IP > < server port > < ST67 resource URI > [ STM32 resource URI ] [ FOTA header resource URI ]. Run firmware update over HTTP | ✔ | ✔ |
Applicative Commands
Command | Description | CLI | CLI_LWIP | Minimal Shell |
---|---|---|---|---|
info_app | info_app. Display application info | ✔ | ✔ | ✔ |
quit | quit. Stop application execution | ✔ | ✔ | ✔ |
echo | echo [iteration] | ✔ | ✔ | |
iperf | iperf [options]. Iperf command line tool for network performance measurement. [-h] for help | ✔ | ✔ | ✔ |
task_report | task_report. Display task performance report | ✔ | ✔ | ✔ |
task_perf | task_perf [-s]. Start or stop [-s] task performance measurement | ✔ | ✔ | ✔ |
echostop | echostop. WFA - Stops the UDP echo server. | ✔ | ✔ | ✔ |
echostart | echostart <port>. WFA - Starts the UDP echo server on the specified port. | ✔ | ✔ | ✔ |
Commands description:
In this project, the following convention is used for getting and setting values. When a command is issued without a parameter, it acts as a "get" operation. Adding a parameter makes it a "set" operation. This applies to all commands capable of "get" functionality. For example:
w61/>net_sta_ip
Return the station, gateway, and netmask IPs.
w61/>net_sta_ip 192.168.1.2
Sets the Station IP value to 192.168.1.2.
Convention:
The parameters which are between < > are mandatory, while those in [ ] are optional and not required in all cases.
3.4.2. System commands
- help [ command ]
This command is used to display the global help message describing all the available commands and their summary if no argument is given.
To print the help of a unique command, type:
w61/> help help help - help [ command ]. Display all available commands and the relative help message
- reset < 0: HAL_Reset; 1: NCP_Restore; 2: NCP_Reset >
This command is used to hardware reboot the system, to restore the ST67W611M1 and restore the initial configuration or to reset it.
- info
This command prints different information of the system:
- ST67W6X info: ST67W6X MW, AT, SDK and Mac SW versions
- Module and BOM IDs
- Trim values for Wi-Fi®, Bluetooth® LE and XTAL
- MAC address of the device
- Anti-rollback values (values increased at each release to ensure firmware/hardware compatibility)
w61/>info --------------- ST67W6X info ------------ ST67W6X MW Version: 1.1.1 AT Version: 1.0.0 SDK Version: 2.0.89 Wi-Fi MAC Version: 1.6.44 BT Controller Version: 1.6.112 BT Stack Version: 1.9.56 Build Date: Sep 4 2025 11:32:47 Module ID: C6AFDBD111400004 (-B) BOM ID: 1 Manufacturing Year: 2024 Manufacturing Week: 47 Battery Voltage: 3.304 V Trim Wi-Fi hp: 2,2,2,2,2,2,2,2,2,2,2,2,1,2 Trim Wi-Fi lp: 2,3,3,4,4,5,5,5,5,5,6,6,6,6 Trim BLE: 1,2,1,0,1 Trim XTAL: 43 MAC Address: 40:82:7b:00:11:e2 Anti-rollback Bootloader: 0 Anti-rollback App: 0 -----------------------------------------
- fs_list
This command lists the different files stored in the host and in the ST67W611M1.
Example:
w61/>fs_list NCP Files: ca_1.crt ca_1.key ca_2.crt ca_2.key client_1.crt client_1.key client_2.crt client_2.key google_fr.crt isrgrootx1.pem server_1.crt server_1.key server_2.crt server_2.key weather.crt
- fs_read < filename >
This command displays the content of the files listed by the fs_list command.
- fs_write < filename >
This command stores the file specified in the parameter into the ST67W611M1 memory.
- fs_delete < filename >
This command deletes the file specified in the parameter from the ST67W611M1 memory.
- powersave [ 0: disable; 1: enable ]
This command specifies if the ST67W611M1 enters in low power whenever it can, typically after sending the response to a command.
Example:
w61/>powersave powersave mode is disabled w61/>powersave 1 w61/>powersave powersave mode is enabled
- atcmd < AT+CMD >
This command sends direct AT commands to the ST67W611M1. This command cannot be used to send commands implying data transfer.
Example:
w61/>atcmd AT+CWMODE? AT+CWMODE? +CWMODE:1 OK
3.4.3. Wi-Fi® management commands
- wifi_sta_state
This command displays the station state.
States | Description |
---|---|
NO STARTED CONNECTION |
The station is in active state but without previous connection. |
CONNECTING |
The station try to connect with a BSS/SSID. |
CONNECTED |
The station is connected. |
GOTIP |
The station has received an IP address through DHCP protocol. |
DISCONNECTED |
The station is disconnected from the previous BSS/SSID. |
OFF |
The station is OFF. |
Expected results:
Station is not connected to an access point (AP):
w61/>wifi_sta_state STA state : STA DISCONNECTED
Station is connected:
w61/>wifi_sta_state STA state : STA CONNECTED Connected to following Access Point : [62:5d:b8:7a:b0:ba] Channel: 1 | RSSI: -43 | SSID: ASUS
Station is connected and has an IP:
w61/>wifi_sta_state STA state : STA GOT IP Connected to following Access Point : [62:5d:b8:7a:b0:ba] Channel: 1 | RSSI: -43 | SSID: ASUS
- wifi_country_code [ 0: AP aligned country code; 1: User country code ] [ Country code [CN; JP; US; EU; 00] ]
This command sets/reads the country code for regulatory domains. The available country codes in Alpha2 format include US, EU, JP, CN, and 00 (World).
Example:
w61/>wifi_country_code Country policy : 0 Country code : 00 w61/>wifi_country_code 1 JP Country code configuration succeeds w61/>wifi_country_code Country policy : 1 Country code : JP
- wifi_scan [ -p ][ -s SSID ][ -b BSSID ][ -c channel [1; 13] ][ -n max_count [1; 50] ]
This command launches a scan command on the interface given in parameter. Different options can be added to the command:
Option | Description |
---|---|
-p |
This option is used to start a passive scan. |
-s <ssid> |
This option is used to scan only the beacon of the given SSID. |
-b <bssid> |
This option is used to scan only the beacon of the given BSSID. |
-c <channel> |
This option is used to limit the scan to a specific channel of the 2.4GHz frequency band. |
-n <max_count> |
This option is used to limit the number of access points to be displayed in the scan result. |
Example:
w61/>wifi_scan -c 1 Scan results : [30:de:4b:d3:b9:4d] Channel: 1 | WPA2 | N | RSSI: -48 | SSID: TP-Link_B94D [32:de:4b:d3:b9:4d] Channel: 1 | WPA2 | N | RSSI: -48 | SSID: ASUS
w61/>wifi_scan -s STWLAN2 Scan results : [78:0c:f0:6c:b4:a0] Channel: 6 | WPA-EAP | N | RSSI: -56 | SSID: STWLAN2 [78:0c:f0:74:45:80] Channel: 1 | WPA-EAP | N | RSSI: -60 | SSID: STWLAN2 [78:0c:f0:79:02:20] Channel: 6 | WPA-EAP | N | RSSI: -66 | SSID: STWLAN2
w61/>wifi_scan -b 78:0c:f0:79:02:20 Scan results : [78:0c:f0:79:02:20] Channel: 6 | WPA-EAP | N | RSSI: -66 | SSID: STWLAN2
- wifi_sta_connect < SSID > [ Password ] [ -b BSSID ][ -i interval [0; 7200] ] [ -n nb_attempts [0; 1000] ]
This command connects a station to a local access point with a specific interface.
Option | Description |
---|---|
Mandatory | |
ssid |
The SSID of the local access point to connect to. Maximum length 32 char. |
Optional | |
Password |
This option is needed only if the local access point uses WPA, WPA2 or WPA3 security. Maximum length 63 char. |
-b <BSSID> |
This option specifies the BSSID of the access point to connect if there are multiple access points with the same name. |
-i <interval> | This option specifies the reconnection interval between connection/reconnection attempts if the first one does not pass. Default value 0: the station does not reconnect to the AP when disconnected, range: [0;7200]. The value is expressed in seconds. |
-n <nb_attempts> | This option specifies the number of reconnection attempts in case the initial connection or reconnection fails. Default value: 0 (always try to reconnect), range: [0;1000] |
This command executes a scan to retrieve the information needed for the connection, including the security of the access point.
Warning: the SSID and/or Password should not include any of the following char : , \ " (in case it is mandatory, it can be used but preceded by a \. Those extra \ will reduce the maximum size of the SSID / Password. This is not recommended.)
Example:
w61/>wifi_sta_connect ASUS chocolat NCP is treating the connection request DHCP client start, this may take few seconds Connected to following Access Point : [62:5d:b8:7a:b0:ba] Channel: 11 | RSSI: -41 | SSID: ASUS Connection success w61/>Station got a new IP address : 192.168.3.101
- wifi_sta_autoconnect
This command is used to get the auto-connect mode. This command cannot change the auto-connect mode, as this is managed via a define at compile time.
w61/>wifi_auto_connect Get auto-connect state succeed. Auto-connect state : 1
- wifi_sta_disconnect [ -r ]
This command disconnects the station from a network.
The -r option removes the registered SSID and password of the previously connected access point.
Example:
w61/>wifi_sta_disconnect Reason: WLAN_FW_DISCONNECT_BY_USER_WITH_DEAUTH Station disconnected from Access Point
The "reason" of the disconnection is returned after each disconnection. Below is a list of the different reasons:
- 1: Failure to allocate memory for transmitting an authentication frame.
- 2: Authentication process failed.
- 3: The authentication algorithm was not accepted or failed.
- 4: Failure to allocate memory for transmitting an association frame.
- 5: Association process with the access point failed.
- 6: De-authentication by the access point occurred when not connected.
- 7: De-authentication by the access point occurred while connected.
- 8: A timeout occurred during the 4-way handshake, likely due to PSK (pre-shared key) issues.
- 9: Failed to transmit a de-authentication frame during the 4-way handshake.
- 10: Failed to allocate memory for a de-authentication frame during the 4-way handshake.
- 11: Timeout waiting for authentication or association response.
- 12: No BSSID or channel found during the scan process.
- 13: Failed to create a channel context when attempting to join a network.
- 14: Failure to join a network.
- 15: Failed to add a station (STA) to the network.
- 16: Beacon loss occurred, potentially leading to disconnection.
- 17: The network security settings do not match.
- 18: An error occurred due to an incorrect WEP key length.
- 19: User-initiated disconnection with de-authentication.
- 20: User-initiated disconnection without sending a de-authentication frame.
- 21: Disconnection occurred because the firmware failed to send a power-save null frame.
- 22: Traffic loss was detected.
- 23: Switching to a new channel failed.
- 24: Confirmation of authentication or association response failed.
- 25: Reassociation process is starting.
- wifi_sta_mac
This command prints the MAC address of the station interface.
Example:
w61/>wifi_sta_mac STA MAC : 40:82:7b:00:11:e2
- wifi_ap_start [ -s SSID ] [ -p Password ] [ -c channel [1; 13] ] [ -e security [0:Open; 2:WPA; 3:WPA2; 4:WPA3] ] [ -h hidden [0; 1] ] [ -m protocol [1: 802 11 b; 2: 802 11 g; 3: 802 11 n; 4: 802 11 ax] ]
This command starts the soft-access point (soft-AP), enabling an additional interface dedicated to the soft-AP in addition to the station interface.
Option | Description |
---|---|
Mandatory | |
-s <SSID> |
This option specifies the SSID name of the soft-AP |
-p <Password> |
This option specifies the password of the SSID. Mandatory only if security is not OPEN |
-c <channel> |
This option specifies the channel used by the soft-AP. |
-e <security> |
This option specifies the security of the soft-AP [0: OPEN, 2: WPA, 3: WPA2] |
-h <hidden> | This option specifies is the SSID is broadcasted or not [0: broadcasting SSID (default); 1: not broadcasting SSID] |
-m <protocol> | This option specifies the 802.11 protocol of the access point. [1: 802 11 b; 2: 802 11 g; 3: 802 11 n; 4: 802 11 ax] ]. Default is 802.11ax |
Warning:
The channel option might be overridden by the channel number used by the station (when connected to an AP).
Example:
w61/>wifi_ap_start -s MyAP -p 12345678 -c 1 -e 3 Soft-AP configuration done
Get command:
w61/>wifi_ap_start AP SSID : MyAP AP Channel : 10 AP Security : WPA2 AP Hidden : 0 AP Protocol : AX
- wifi_ap_stop
This command stops the soft-AP.
- wifi_ap_list_sta
This command prints all the remote stations connected to the soft-AP.
Example:
w61/>wifi_ap_list_sta Connected stations : MAC : 7a:2e:95:96:b0:1f | IP : 192.168.8.2
- wifi_ap_disconnect_sta < MAC >
This command disconnects the remote stations connected to the soft-AP. The MAC address of the remote station must be passed in parameter.
Example:
w61/>wifi_ap_disconnect_sta 7a:2e:95:96:b0:1f Station disconnected from soft-AP : [7a:2e:95:96:b0:1f] WIFI CLIENT DISCONNECTED SUCCESSFULLY
- wifi_ap_mac
This command prints the MAC address of the soft-AP interface.
Example:
w61/>wifi_ap_mac AP MAC : 42:82:7b:00:0e:af
- wifi_dtim < value [greater than 0] >
This command sets or gets the DTIM interval.
Note 1: powersave 1
must be sent to enable DTIM feature.
Note 2: For more information, refer to WiFi DTIM wiki page.
Example:
w61/>wifi_dtim 10
- wifi_twt_teardown
This command teardown the TWT configuration in use.
- wifi_twt_setup < setup_type(0: request; 1: suggest; 2: demand) > < flow_type(0: announced; 1: unannounced) > < wake_int_exp > < min_wake_duration > < wake_int_mantissa >
This command sets the TWT parameters.
Note 1: Commands powersave 1
must be sent before to enable TWT feature.
Note 2: For more information, refer to the WiFi_TWT wiki page.
Note 3: Only one TWT configuration is possible with v1.1.0 release.
To calculate the TWT (Target Wake Time) wake interval, the following equation is used: TWT Wake Interval =μseconds
- wifi_twt_status
This command returns the status of the current TWT configuration.
- wifi_antenna [ mode [0: disabled; 1: static; 2: dynamic ] ]
This command sets or gets the mode and the antenna (get only) used by the ST67W611M1.
Mode | Description |
---|---|
0 |
This mode uses the default antenna. |
1 |
This mode lets the ST67W611M1 run a static algorithm to choose the best antenna to use after the first connexion. |
2 |
This mode is not available for the moment. |
Note: The change from one mode to another implies a reset of the ST67W611M1.
Note2: The static and dynamic modes are only available on the revision -U and -P of the ST67W611M1.
3.4.4. Bluetooth® LE commands
- ble_init [ 1: client mode; 2: server mode ]
This command initializes the module in Bluetooth® LE client or server mode depending on parameter value.
It also sets the Bluetooth® LE device name to : "ST67W61_BLE".
Calling this function without parameter returns the current mode initialized.
- ble_deinit
This command de-initialize Bluetooth® LE device.
- ble_adv [ -a abort adv ]
This command starts or stops a Bluetooth® LE advertising.
Calling this function without parameter starts the advertising, while calling the function with -a parameter stops it.
- ble_scan [ -a abort scan ]
This command starts or stops a Bluetooth® LE scan.
Calling this function without parameter starts the scan, while calling the function with -a parameter stops it.
- ble_connect < conn handle: 0 or 1 > < BD addr >
This command connects to a remote device.
The connection handle to use and the BD Address of the remote device must be passed in parameter.
Example:
w61/>ble_connect 0 40:82:7b:00:0b:bc BLE connected -> BLE CONNECTED: Conn_Handle: 0 BLE Connection OK
- ble_disconnect < conn handle: 0 or 1 >
This command disconnects the device from a remove device.
The connection handle of the connection with this remote device must be passed as parameter.
- ble_tx_power [ Tx Power [0; 20] ]
This command sets the Tx Power.
Without argument this command gets the actual TX Power.
- ble_bd_addr [ BD Addr ]
This command sets a new Bluetooth® LE BD address.
Without argument this command gets the actual Bluetooth® LE BD address.
Example:
w61/>ble_bd_addr 11:22:33:44:55:66 Set BD_ADDR OK w61/>ble_bd_addr BD Addr: 11:22:33:44:55:66
- ble_device_name [ Device Name ]
This command sets a new Bluetooth® LE device name.
Maximum name size is 26.
Without argument this command gets the actual Bluetooth® LE device name.
Warning: the device name should not include any of the following char : , \ " (in case it is mandatory, it can be used but preceded by a \. This will reduce the maximum name size. This is not recommended.)
Example:
w61/>ble_device_name Hello_BLE Set Device Name OK: Hello_BLE w61/>ble_device_name Get Device Name OK: Hello_BLE
- ble_adv_data < Advertising Data >
This command sets the Bluetooth® LE advertising data.
Advertising data must follow below format:
Advertising data | |||||||
---|---|---|---|---|---|---|---|
|
Example:
w61/>ble_adv_data 0809703270535F32320FFF3000028B830000000008E12C1122020106 Set Advertising Data OK
- ble_adv_param [ AdvIntMin [32; 16384] ] [ AdvIntMax [32; 16384] ] [ Adv Type [0; 2] ] [Adv Channel [1: chan 37; 2: chan 38; 3: chan 39; 7: all] ]
This command sets the Bluetooth® LE advertising parameters.
Without argument this command gets the actual Bluetooth® LE advertising parameters.
Adv type values are:
- 0: Connectable Undirected Advertising (ADV_TYPE_IND)
- 1: Scannable Undirected Advertising (ADV_TYPE_SCAN_IND)
- 2: Non-Connectable Undirected Advertising (ADV_TYPE_NONCONN_IND)
AdvIntMin and AdvIntMax are in ms.
- ble_scan_param [ Scan Type [0; 1] ] [ OwnAddr Type [0; 3] ] [ Filter Policy [0; 3] ] [ Scan Interval [4; 16384] ] [ Scan Window [4; 16384] ]
This command sets the Bluetooth® LE scan parameters.
Without argument this command gets the actual Bluetooth® LE scan parameters.
Scan type values are:
- 0: Passive scan
- 1: Active scan
OwnAddr type values are:
- 0: Public address
- 1: Random address
- 2: Public Resolvable Private address
- 3: Random Resolvable Private address
Filter policy values are:
- 0: All
- 1: Only White listed address
- 2: Resolvable Private Address
- 3: Resolvable Private Address white listed
Scan Interval and Scan Window are in ms.
- ble_scanrespdata < Scan Response Data >
This command sets the Bluetooth® LE scan response data.
Scan Response data must follow below format:
Scan response data | |||||||
---|---|---|---|---|---|---|---|
|
Example:
w61/>ble_scanrespdata 02010606095757575757 Set Scan Response Data OK: 02010606095757575757
- ble_conn_param [ Conn Handle [0; 1] ] [ ConnIntMin [6; 3200] ] [ConnIntMax [6; 3200] ] [ Latency [0; 499] ] [ Timeout [10; 3200] ]
This command sets the Bluetooth® LE connection parameters.
With only Conn Handle argument, this command gets the actual Bluetooth® LE connection parameters for the specified connection.
ConnIntMin, ConnIntMax, Latency, Timeout are in ms.
- ble_get_conn
This command gets the Bluetooth® LE connections information.
- ble_exchange_mtu < Conn Handle [0; 1] >
This command launches Maximum Transmission Unit (MTU) exchange on selected connection.
- ble_data_length < Conn Handle [0; 1] > < TxBytes [27; 251] > < TxTransTime >
This command sets the Bluetooth® LE data length on selected connection. TxTransTime is in ms and must be in range [328, 17040].
- ble_srv_create < Service Index [0; 2] > < UUID > < UUID type >
This command creates a Bluetooth® LE service with specified UUID on 16 or 128 bits.
To set a 16-bit UUID, UUID type must be equals to 0.
To set a 128-bit UUID, UUID type must be equals to 2.
Example:
w61/>ble_srv_create 0 180a 0
- ble_srv_delete < Service Index [0; 2] >
This command deletes an existing Bluetooth® LE service.
- ble_char_create < Service Index [0; 2] > < Charac Index : [0; 4] > < UUID > < UUID type > < Charac Property > < Charac Permission: read 1 write 2 >
This command creates a Bluetooth® LE characteristic for an existing Bluetooth® LE service with specified UUID on 16 or 128 bits.
To set a 16-bit UUID, UUID type must be equals to 0.
To set a 128-bit UUID, UUID type must be equals to 2.
Characteristic property values are:
- 2: Characteristic read property
- 4: Characteristic write without response property
- 8: Characteristic write with response property
- 16: Characteristic notify property
- 32: Characteristic indicate property
Characteristic permission values are:
- 1: Read permissions
- 2: Write permissions
Example:
w61/>ble_char_create 0 0 2a29 0 2 2
- ble_srv_list
This command lists all Bluetooth® LE services and characteristics created.
- ble_srv_reg
This command registers all Bluetooth® LE services and characteristics created, in order to make them discoverable by remote devices.
- ble_rem_srv_list < Conn Handle [0; 1] >
This command discovers all Bluetooth® LE services of a remote server. Example:
w61/>ble_rem_srv_list 0 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 1, UUID = 18010000 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 2, UUID = 18000000 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 3, UUID = 180a0000 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 4, UUID = 0000fe40cc7a482a984a7f2ed5b3e58f Remote Service Discovery OK: Connection Handle 0
- ble_rem_char_list < Conn Handle [0; 1] > < Service Index [1; 4] >
This command discovers all Bluetooth® LE characteristics of the specified service of remote server.
Service must be discovered using ble_rem_srv_list before launching this command.
Example:
w61/>ble_rem_char_list 0 1 BLE characteristic discovered -> BLE CHARACTERISTIC DISCOVERED: Service idx = 1, Charac idx = 1, UUID = 2a050000, Char Handle = 2,Char Value Handle = 3 Remote Characteristic Discovery OK: Connection Handle 0 and Service Index 1
- ble_send_notif < Service Index [0; 2] > < Char Index [0; 4] > < Timeout > < Data >
This command sends a notification from a Bluetooth® LE characteristic to a the remote client,
with Service Index and Char Index, the indexes of Services and Characteristics previously created using
ble_srv_create and ble_char_create.
- ble_send_indication < Service Index [0; 2] > < Char Index [0; 4] > < Timeout > < Data >
This command sends an indication from a Bluetooth® LE characteristic to a the remote client,
with Service Index and Char Index, the indexes of Services and Characteristics previously created using
ble_srv_create and ble_char_create.
Example:
w61/>ble_send_indication 1 1 0 32333435 ble_send_indication 1 1 0 32333435 Send Indication OK: Service Index: 1 Char Index: 1 Data: 2345 Requested Length: 4 Sent Length: 4 Timeout: 0 ms
- ble_read_data < Service Index [0; 2] > < Char Index [0; 4] > < Timeout > < Data >
This command sets Bluetooth® LE characteristic data that can be read by the remote client,
with Service Index and Char Index, the indexes of Services and Characteristics previously created using
ble_srv_create and ble_char_create.
- ble_client_write_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] > < Timeout > < Data >
This command writes data to a remote server Bluetooth® LE characteristic,
with Service Index and Char Index, the indexes of the remote server Services and Characteristics discovered using
ble_rem_srv_list and ble_rem_char_list .
- ble_client_read_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] >
This command reads data from a remote server Bluetooth® LE characteristic,
with Service Index and Char Index, the indexes of the remote server Services and Characteristics discovered using
ble_rem_srv_list and ble_rem_char_list .
- ble_client_subscribe_char < Conn Handle [0; 1] > < CharValue Handle > < Char Prop [1; 2] >
This command subscribes to a remote server Bluetooth® LE characteristic.
Characteristic value handle discovered must be passed as parameter.
Characteristic property values are:
- 1: Notification
- 2: Indication
Example:
w61/>ble_client_subscribe_char 0 3 1 Client Subscribe Charac OK: Conn Handle: 0 CharValue Handle: 3 Char Prop: 1
- ble_client_unsubscribe_char < Conn Handle [0; 1] > < CharValue Handle >
This command unsubscribes to a remote server Bluetooth® LE characteristic.
Characteristic value handle discovered must be passed as parameter.
- ble_sec_param [ Security Parameter [0; 4] ]
This command sets Bluetooth® LE security parameters.
Without argument this command gets the actual security parameters.
Security parameter values are:
- 0: IO display only
- 1: IO display Yes No
- 2: IO keyboard only
- 3: IO No Input Output
- 4: IO keyboard display
- ble_sec_start < Conn Handle [0; 1] < < Security Level [1; 4] >
This command initiates Bluetooth® LE pairing to selected connection.
Security level values are:
- 1: No encryption and no authentication
- 2: Encryption and no authentication (no MITM)
- 3: Encryption and authentication (MITM)
- 4: Authenticated Secure Connections and 128-bit key
- ble_sec_set_passkey < Conn Handle [0; 1] > < PassKey [0; 999999]>
This command sets Bluetooth® LE security passkey.
- ble_sec_passkey_confirm < Conn Handle [0; 1] >
This command confirms received Bluetooth® LE security passkey.
- ble_sec_pairing_confirm < Conn Handle [0; 1] >
This command confirms Bluetooth® LE security pairing request.
- ble_sec_pairing_cancel < Conn Handle [0; 1] >
This command cancels Bluetooth® LE security pairing request.
- ble_sec_unpair < Remote BD Addr > < Addr Type [0; 3] >
This command unpairs from remote Bluetooth® LE paired device.
Address type values are:
- 0: Public address
- 1: Random address
- 2: Public Resolvable Private address
- 3: Random Resolvable Private address
Example:
w61/>ble_sec_unpair 40:82:7b:00:0b:bc 0 Unpair Device OK: Remote BD Addr: 40:82:7B:00:0B:BC Addr Type: 0 BLE disconnected -> BLE DISCONNECTED.
- ble_bonded_device_list
This command lists the remote Bluetooth® LE paired device.
Example:
w61/>ble_bonded_device_list Get Bonded Device List: Device 1: BD Addr: 40:82:7B:00:0B:BC BD Addr type: 0 LTK: ca4d4e744ce760bb313175091af03052
3.4.5. Network commands
- ping < hostname > [ -c count [1; max(uint16_t) - 1] ] [ -s size [1;10000] ] [ -i interval [100;3500] ]
This command pings the specified IP or URL.
Option | Description |
---|---|
Mandatory | |
hostname |
The IP address, in format x.x.x.x or a valid URL to ping. |
Optional | |
-c count |
This option specifies the number of ping iteration to execute. If no value is set, the default value is 4. Valid range [1; max(uint16_t) - 1] |
-s size |
This option specifies the size (in bytes) of the ping to send. The default value is 64 bytes. Valid range: [1;10000] |
-i interval |
This option specifies the interval (in milliseconds) of the ping to send. The default value is 1000 ms. Valid range: [100;3500] |
Example:
w61/>ping www.google.com -c 5 5 packets transmitted, 5 received, 0% packet loss, time 65ms
w61/>ping www.google.com -c 5 -s 256 -i 200 5 packets transmitted, 5 received, 0% packet loss, time 111ms
- net_dhcp [ 0:DHCP disabled; 1:DHCP enabled ] [ 1:STA only; 2:AP only; 3:STA + AP ] [ lease_time [1; 2880] ]
This command starts or stops the DHCP client (for the station) and/or the DHCP server for the soft-AP.
The lease time parameter specifies the duration for which an IP address is reserved for the station by the DHCP server. The default value of the lease time is 120 minutes, range: [1;2880]
Example:
w61/>net_dhcp DHCP STA STATE : 1 DHCP AP STATE : 0 DHCP AP RANGE : [192.168.8.2 - 192.168.8.101] DHCP AP LEASE TIME : 120
Enable DHCP server for soft-AP and specify new lease time.
w61/>net_dhcp 1 3 150 DHCP configuration succeed w61/>net_dhcp DHCP STA STATE : 1 DHCP AP STATE : 1 DHCP AP RANGE : [192.168.8.2 - 192.168.8.101] DHCP AP LEASE TIME : 150
- net_ap_ip
This command displays the soft-AP, IP address and netmask address. The IP address can only be modified via define in the "ST67W6X/Target/w6x_config.h" file. The netmask value is hardcoded.
Example:
w61/>net_ap_ip Soft-AP IP address : 10.19.96.1 Netmask : 255.255.255.0
- net_sta_dns [ DNS1 addr ] [ DNS2 addr ] [ DNS3 addr ]
This command sets or reads the DNS configuration of the station.
Example:
w61/>net_sta_dns 1.2.3.4 5.6.7.8 12.23.34.45 DNS configuration set successfully w61/>net_sta_dns DNS1 IP : 1.2.3.4 DNS2 IP : 5.6.7.8 DNS3 IP : 12.23.34.45
Note:
If the DNS IP is set manually ONCE, a reset 1 (Restore NCP to its default configuration) is mandatory to retrieve default DNS IP address from the DHCP process.
- net_sta_ip [ IP addr ] [ Gateway addr ] [ Netmask addr ]
This command sets or reads the IP address of the station. The accepted value format for the IP address value is : x.x.x.x
Examples:
w61/>net_sta_ip STA IP address : 192.168.8.138 Gateway : 192.168.8.1 Netmask : 255.255.255.0
Set only the device IP address:
w61/>net_sta_ip 192.168.235.9 [WARN] [1945368] [shell_task] (w61_at_net.c:322) Gateway IP NULL or invalid. Previous one will be use. [WARN] [1945368] [shell_task] (w61_at_net.c:322) Netmask IP NULL or invalid. Previous one will be use. STA IP configuration set successfully
Set device and gateway IP addresses:
w61/>net_sta_ip192.168.235.9 192.168.235.13 [WARN] [1945368] [shell_task] (w61_at_net.c:322) Netmask IP NULL or invalid. Previous one will be use. STA IP configuration set successfully
Set device, gateway and netmask IP addresses:
w61/>net_sta_ip192.168.235.9 192.168.235.13 255.255.255.0 STA IP configuration set successfully
The gateway and netmask addresses cannot be modified alone.
If the device is not connected to any AP:
w61/>net_sta_ip [ERROR] [2035708] [shell_task] (w6x_net.c:442) Station is not connected. Connect to an Access Point before querying IPs Get STA IP error
- time < timezone : UTC format : range [-12; 14] or HHmm format : with HH in range [-12; +14] and mm in range [00; 59] >
This command returns the time from a predefined SNTP server. The <timezone> parameter of the command is used to configure the time zone.
The time zone must be set in one of the two formats:
- With UTC format: range [-12,14]: marks most of the time zones by offset from UTC in whole hours
- With HHmm format: with HH in range [-12, +14] and mm in range [00,59]
Example: ↵After a successful connection to an access point connected to internet:
w61/>time 1 Time: Tue Oct 29 17:52:40 2024
or
w61/>time 100 Time: Tue Oct 29 17:52:40 2024
- dnslookup < hostname >
This command returns the IP address related to the hostname using the DNS service.
Example:
w61/>dnslookup www.google.com IP address: 142.250.185.132
- net_hostname [ hostname ]
This command sets/reads the name of the station, which is displayed on the terminal of the access point (AP) to which the station is connected.
Example:
w61/>net_hostname ST67W61_WiFi_device Host name set successfully w61/>net_hostname Host name : ST67W61_WiFi_device
3.4.6. MQTT commands
- mqtt_configure < -s Scheme > < -i ClientId > [ -u <Username> ] [ -pw <Password> ] [ -c <Certificate> ] [ -k <PrivateKey> ] [ -ca <CACertificate> ] [ -sni ] [ -ka <KeepAlive> ] [ -q <LWT_QoS> ] [ -cs ] [ -r ]
This command configures the user setup with the chosen MQTT broker.
Option | Description |
---|---|
Mandatory | |
-s Scheme | Set the security level: 0: MQTT over TCP 1: MQTT over TLS with password 2: MQTT over TLS with server certificate (CA) 3: MQTT over TLS with client certificate 4: MQTT over TLS with server/client certificate. |
-i ClientId | The client ID must be unique on the broker. |
Optional | |
-u Username | This option specifies the username. Must be defined in the MQTT broker configuration. |
-pw Password | This option specifies the password related to the username. |
-c Certificate | This option specifies the client certificate filename. (*) |
-k PrivateKey | This option specifies the client key filename. (*) |
-ca CaCertificate | This option specifies the certificate authority filename of the server. (*) |
-sni | This option configures the server name indication with the host name during the connection. |
-ka <KeepAlive> | This option specifies the timeout of MQTT ping range[1;2700] (**) |
-q <LWT_QoS> | This option specifies QoS of the published message, which can be set to 0, 1, or 2. Default is 0. (**) |
-cs | This option specifies if the session must be clean. (**) |
-r | This option specifies if data must be retained by the broker. (**) |
(*) The file must exist in the file system of the host or the ST67W611M1.
(**) For more information about those parameters, refer to the WiFi MQTT wiki page.
Warning: the userame and password should not include any of the following char : , \ " (in case it is mandatory, it can be used but preceded by a \. This will reduce the maximum parameter size. This is not recommended.)
- mqtt_connect < -h Host > < -p Port >
This command connects to a MQTT broker or displays the connection status.
Option | Description |
---|---|
Mandatory | |
-h Host | The address of the MQTT broker to connect. |
-p Port | The port number of the MQTT broker. |
Example:
w61/>mqtt_configure -s 0 -i ST67W6X_772 MQTT Configure OK w61/>mqtt_connect -h "broker.hivemq.com" -p 1883 MQTT Connect OK w61/>mqtt_connect MQTT Connect State: Connected MQTT Connect Host: broker.hivemq.com MQTT Connect Port: 1883 MQTT Connect ClientId: ST67W6X_772
- mqtt_disconnect
This command disconnects from the MQTT broker.
Example:
w61/>mqtt_disconnect MQTT Disconnect OK
- mqtt_publish < Topic > < Message > [ -q Qos ] [ -r ]
This command publishes the <Message> on the <Topic> to which the MQTT client is connected.
The topic format must be defined as below (maximum 100 characters):
"/topic_level1/topic_level2"
The message format must be defined as below (json structure recommended):
"{\"timestamp\": \"20201121085253\", \"temperature\": 20.0, \"humidity\": 50.0, \"pressure\": 1000.0}"
Example:
w61/>mqtt_publish "/sensors/mySTM32_772" "\"{\"timestamp\": \"20201121085253\", \"other_field\": \"hello world\" }\"" MQTT Publish OK
The two options -q <Qos> and -r refer respectively to the QoS of the published message, which can be set to 0, 1, or 2. Default is 0. and to the retain flag.
- mqtt_subscribe < Topic >
This command subscribes to a specific <Topic> or prints the list of subscribed topics.
Example:
w61/>mqtt_subscribe "/sensors/mySTM32_772" MQTT Subscribe OK
When a message from a subscribed topic is received
<INF> 93230 [AtRxParser] MQTT Subscription Received on topic: "/sensors/mySTM32_772" : \"{\"timestamp\":\"20201121085253\",\"other_field\":\"hello world\"}\ (main_app.c:225)
- mqtt_unsubscribe < Topic >
This command unsubscribes from a specific <Topic>.
Example:
w61/>mqtt_unsubscribe "/sensors/mySTM32_772" MQTT Unsubscribe OK
3.4.7. FOTA commands
- fota_http < server IP > < server port > < ST67 resource URI > [ STM32 resource URI ] [ FOTA header resource URI ]
This command downloads a binary to update the network co-processor (ST67W611M1) firmware. This binary must be uploaded on an HTTP server.
Option | Description |
---|---|
Mandatory | |
<server IP> | The IP address of the server to connect, can be a domain name in www.something.com format.
|
<server port> | The port number of the server. |
<ST67 resource URI> | The URI of the ST67 binary file to download. |
Optionnal | |
[STM32 resource URI] | The URI of the STM32 binary file to download (only applies to NUCLEO-U575ZI-Q project) |
[FOTA header resource URI] | The URI of the FOTA header file in JSON format to download (only applies to NUCLEO-U575ZI-Q project) |
Example:
w61/>fota_http 192.168.8.104 8000 /download/STM32U575ZI_NUCLEO/st67.bin.ota /download/STM32U575ZI_NUCLEO/fota_ST67W6X_CLI.bin /download/STM32U575ZI_NUCLEO/ST67W611_STM32U575ZI_NUCLEO.json
3.4.8. Applicative commands
- info_app
This command returns the host firmware name and version.
Example:
w61/>info_app --------------- Host info --------------- Host FW Version: 1.1.0 Host FW Name: ST67W6X CLI
- quit
This command is used to exit the console, return in the main and terminate the code.
- iperf [ options ]
Option | Description |
---|---|
Mandatory | |
-c <server_addr> |
Run in client mode (to test TX) |
-s | Run in server mode (to test RX) |
Optional | |
-u |
This option specifies if UDP should be used. If not used, TCP is used for the test. |
-p <Port> |
This option specifies the port to connect to (if -c is used) or to open (if -s is used). Default is 5001 |
-i <Interval> |
This option specifies the interval (in seconds) between bandwidth reports. |
-l <Length> |
This option specifies the read/write buffer size. |
-t <Time> |
This option specifies the duration of the test. Default is 10 seconds. |
-b <Bandwidth> | Bandwidth to send in Mbps (for UDP only) |
-S <TOS> | TOS |
-n <MB> | Number of Mbyte to send and receive |
-P <Priority> | Traffic task priority |
-d <Dual Mode> | Dual mode |
-a | Abort running iperf |
For detailed information on the throughput evaluation, refer to How to measure Wifi throughput.
- echo [ iteration ]
This command launches an echo sequence in front of an echo server at IP address 45.79.112.203, repeating the sequence the number of times specified by the [iteration] parameter.
- echostart < port >
This command starts the UDP echo server on the specified port.
- echostop
This command stops the UDP echo server.
- task_perf [ -s ]
This command starts and stops the task cycles counter using the [ -s ]
option. The counter results can be displayed with the task_report command.
- task_report
This command displays two arrays.
The first array is enabled by the task_perf command, which displays the number of cycles registered since the last "task_perf" command was submitted, unless it has been stopped.
The second array, always present, displays the status of the different tasks including their state (running, stopped, blocked), priority, available memory free in the stack of the task and their index.
Example:
w61/>task_report ### Task Performance report CPU Freq 160 Mhz thread id name cycles time (ms) ------------------------------------------------------- thread #0 shell_task 432508 2 thread #1 OutputTask 192507 1 thread #2 IDLE 3463043985 21644 thread #3 defaultTas 12949220 80 thread #4 spi_xfer_e 135437 0 thread #5 Tmr Svc 105065 0 thread #6 Modem_Proc 525646 3 ------------------------------------------------------- Total 3477384368 21733 ### Task Performance report end Task State Prio Free(u32) Index ******************************************** shell_task X 5 184 6 IDLE R 0 107 3 defaultTask B 24 98 2 Tmr Svc B 55 93 4 Modem_Process B 54 300 8 spi_xfer_engine B 53 120 7 OutputTask S 25 22 5 ST67W6XTask B 24 676 1 FOTA task B 24 318 9
3.5. Memory footprint
Module | Description |
---|---|
[Driver] HAL/CMSIS/BSP | STM32 CMSIS Cortex, HAL and LL, Board Specific Package drivers |
[Project] Core | Native STM32 core components |
[Project] App | Main part of the application |
[Project] Target | Configuration files for ST67W6X_Network_Driver component |
[MW] ST67W6X_Network_Driver | Core and API System, Wi-Fi®, Bluetooth® LE, Network, HTTP and MQTT components Util/Shell: Utility to manage the API through the serial interface Util/Logging: Utility to process shell and trace messages onto the UART interface (can be changed by ITM) Util/Performance: iperf, memory allocation report, task usage utilities |
[MW] FreeRTOS | FreeRTOS kernel source |
[MW] LittleFS | LittleFS file system |
[Utility] lpm | Tiny low-power management |
[Toolchain] Startup | Int_vect, init routines, init table, CSTACK and HEAP |
[Toolchain] EWARM Libraries | Native compiler libraries |
These values depend on the chosen toolset, and they can change in next releases.
3.5.1. ROM/flash memory footprint
The picture below shows the total read-only memory (flash) used by ST67W6X_CLI application.
The picture below shows the middleware ST67W6X_Network_Driver read-only memory (flash) used by ST67W6X_CLI application.
The picture below shows the total read-only memory (flash) used by ST67W6X_CLI_LWIP application.
The picture below shows the middleware ST67W6X_Network_Driver read-only memory (flash) used by ST67W6X_CLI_LWIP application.
3.5.2. Read-write (RW) memory footprint
The picture below shows only the sum of the static read/write memory (static RAM) of the ST67W6X_CLI application.
The picture below shows only the sum of the static read/write memory (static RAM) of the ST67W6X_CLI_LWIP application.
4. References