Udp Communication Between Devices - Ebyte NA611 User Manual

Table of Contents

Advertisement

Chengdu Ebyte Electronic Technology Co.,Ltd.
STA:
AT+SOCKET=0,4001,101.145.45.1
After the configuration is complete, restart the device, wait for the connection to be completed, and then send data.
Special attention is needed: Before starting the STA, the IP address of the AP connected to it must be passed in.
Otherwise, a normal network connection cannot be established.
If the AP starts the protocol transmission mode at this time, it can support the connection of 4 STAs, and the
configuration of the remaining STAs is the same.
For STA-STA communication, two devices need to be connected to the same router. Here, the SSID of the target AP
is E103-W06 for demonstration.
STA1 configuration process
Mode: AT+MODE=2,1,1
Target: AT+STACON=E103-W06,2,12345678
Configure the local port: AT+SVRPORTIP=4001
Get IP address: AT+SVRPORTIP? Get back: AT+SVRPORTIP=4001,192.168.0.189
STA2 configuration process
Mode: AT+MODE=2,1,2
Target: AT+STACON=E103-W06,2,12345678
Set the remote IP and port, here the IP and port obtained by STA1 are passed in:
AT+SOCKET=0,4001, 192.168.0.189
Restart the device and wait for the connection to complete before communicating.

5.1.5 UDP communication between devices

UDP is a communication that does not establish a connection, and the core is the IP address and port. In this way,
one serves as AP and the other serves as STA.
(1) Configure AP equipment:
Setting mode: AT+MODE=1,1,3
Set SSID: AT+SSID=0,E103-W06,2,12345678
Set the local port: AT+SVRPORTIP=4001
Get the local IP of the local port: AT+SVRPORTIP?. Get back: AT+SVRPORTIP=4001,10.145.45.1
Set remote port Set remote IP: AT+SOCKET=0,4002,10.145.45.2
Copyright ©2012–2021,Chengdu Ebyte Electronic Technology Co.,Ltd.
【RS485⇌ WiFi】NA611 User Manual
21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Na611a

Table of Contents