TCP Server + softAP
This application uses three ZentriOS devices. Module 1 is a TCP server configured to start its softap interface and its TCP server feature on bootup. Module 2 and Module 3 are TCP clients configured to use their wlan interface and TCP client feature to connect to the Module 1 softap and TCP server.
Once module 2 and module 3 are connected, data is sent to module 1 first from module 2, and then from module 3. Module 1 reads the received data.
The stream_list command is used to list open streams, and stream_poll is used on the server to check for data received by clients. Two GPIOs are configured to toggle high when a client connects, and also when data is received and waiting.
In this example, the TCP server is configured to use the softAP interface, but it can also easily be configured to use the wlan client interface.
Module 1 - TCP Server Settings
|ZentriOS Commands (Module 1)||Description|
Example TCP Session with Module 2
|Module 2: Wi-Fi + TCP Client||Module 1: softAP + TCP Server|
Example TCP Session adding Module 3
|Module 3: Wi-Fi + TCP Client||Module 1: softAP + TCP Server|
Supporting ZentriOS Editions and Versions
|2015-02-13||Added second client example|