How can I create a TCP Server with SoftAP mode using WiConnect?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

TCP Server + softAP

This application uses two ACKme modules each running WiConnect, a serial API that sits on top of WICED, to demonstrate how to create a TCP server + softAP.

Module 1 is a server configured to start the softAP interface and the TCP server feature on boot up.

Module 2 is a client configured to use the wlan interface and the TCP client feature to connect to the Module 1 softAP and TCP server.

Note: The full article and others can be found here: ACKme | How can I create a TCP Server with SoftAP mode?


Module 1 - TCP Server Settings

WiConnect Commands (Module 1)Description
set softap.auto_start           true 
set softap.dhcp_server          true 
set softap.ssid        tcp_server_ap  
set tcp.server.auto_interface softap 
set tcp.server.auto_start       true 
set tcp.server.idle_timeout      300 
set tcp.server.connected_gpio     22 
set tcp.server.data_gpio          21  
save 
reboot
<- softap auto starts on reboot 
<- DHCP server is enabled 
<- Set softAP name  
<- TCP server uses softAP interface 
<- TCP server auto starts on reboot 
<- Don't disconnect clients quickly 
<- GPIO indicates client connection 
<- GPIO indicates data is available  
<- Save settings to flash 
<- Reboot the module

Example TCP Session

Module 2: Wi-Fi + TCP ClientModule 1: softAP + TCP Server
> set wlan.ssid tcp_server_ap 
Set OK > 
save 
Success 
> tcp_client 10.10.10.1 3000 
[Associating to tcp_server_ap] 
[Associated] 
[Connecting: 10.10.10.1:3000] 
[Connected: 0] 0 
> write 0 13 
<hello server!> 
Success      
> stream_poll 0 1 
> read 0 100 
hello server! 
> stream_poll 0 
0@@
0 Replies