...
Function | Description | Comments |
| ||
Initialize WiFi ESP Click |
| |
| ||
De-initialise WiFi ESP Click |
| |
| ||
Enable WiFi ESP Click |
| |
| ||
Disable WiFi ESP Click |
| |
| ||
Send an amount of data |
| |
| ||
Receive an amount of data |
| |
| ||
Send a command |
|
...
Macro | Instruction | Description |
| AT | Test AT startup |
| AT+RESTORE | Factory reset. |
| AT+RST | Restart module |
| AT+GMR | View version info |
| AT+CWMODE | Set WiFi mode without writing to Flash |
| AT+CWJAP_CUR | Connect to AP without writing the SSID and passphrase to Flash |
| AT+CWLAP | List available APs |
| AT+CWQAP | Disconnect from AP |
| AT+CWSAP_CUR | Configuration of softAP mode without writing to Flash |
| AT+CWLIF | Get station’s IP which is connected to the soft-AP |
| AT+CIPSTATUS | Check network connection status |
| AT+CIPSTART | Establish TCP connection, UDP transmission or SSL connection |
| AT+CIPMODE | Set transfer mode |
| AT+CIPSEND | Send data |
| AT+CIPCLOSE | Close TCP, UDP or SSL connection |
| AT+CIFSR | Get local IP address |
| AT+CWDHCP_CUR | Enable/Disable DHCP |
| AT+CIPSTA_CUR | Set IP address of station |
| AT+CIPSTA_CUR? | Get IP address of station |
| AT+CIPMUX | Enable multiple connections for server |
| AT+CIPSERVER | Configure as TCP server |
| AT+CIPSTO | Set TCP server timeout in seconds |
| AT+CIPSTO? | Get TCP server timeout |
| AT+PING | Function Ping |
...
Example | Description | Comments |
| ||
Enable/disable multiple connections | The module responds OK if the mode set successfully and | |
| ||
Start a TCP server with given port | The module responds OK if the server started successfully and | |
| ||
Connect to a TCP server | The module responds OK if the server started successfully and | |
| ||
Register UDP ports | The module responds | |
| ||
Send data to the remote host via TCP or UDP | The module responds | |
| ||
Close TCP connection or end UDP transmission | The module responds |
...
Read the SSID and passphrase from the U-Boot Environment variables
wifi_ssid
andwifi_passwd
.Initialize the WiFi ESP Click driver and start communications with the WiFi ESP Click board via UART.
Attempt to connect to the assigned AP (Access Point) and obtain an IP address via DCHCP.
Start the TCP server with the port 80, on the IP address obtained in the previous step, and run the endless loop that waits for connections. Having established a connection, it prints the received messages to the console and sends received data back to the connected client.
...
Connect the WiFi ESP Click module to the CLICK interface of the STM32H7-BSB Rev 2A board.
Power cycle the board and let it boot to the U-Boot command line.
Set the
wifi_ssid
andwifi_passwd
variables in the U-Boot environment:Code Block STM32H7-SOM U-Boot > setenv wifi_ssid testssid STM32H7-SOM U-Boot > setenv wifi_passwd testpass STM32H7-SOM U-Boot > saveenv
Power cycle the board and let it boot to the FreeRTOS CLI.
Validate that the FreeRTOS BSP prints out the following message with the correct SSID and
passphrase
:Code Block Starting kernel ... STM32H7 SOM FreeRTOS CLI, http://www.emcraft.com Type help to view a list of available commands. Connecting to WiFi AP testssid with passphrase testpass
Validate that the FreeRTOS BSP prints out the following message after several seconds:
Code Block CLI> AT+CWJAP_CUR="testssid","testpass" WIFI DISCONNECT WIFI CONNECTED WIFI GOT IP OK WiFi connected Starting TCP Server AT+CIFSR +CIFSR:STAIP,"192.168.0.252" +CIFSR:STAMAC,"8c:aa:b5:14:89:d2" OK TCP Server started Please connect to the IP address listed above
From a Linux PC machine, connect to the TCP server via
telnet
ornc
:Code Block $ telnet 192.168.0.252 80 Trying 192.168.0.252... Connected to 192.168.0.252. Escape character is '^]'.
Send a message to the target and validate that the server sends the received message back:
Code Block $ telnet 192.168.0.252 80 Trying 192.168.0.252... Connected to 192.168.0.252. Escape character is '^]'. HELLO HELLO TEST TEST 12345 12345
The server will close the connection if it does not receive any data in several seconds:
Code Block Connection closed by foreign host.