Page 21 / 30
Running returns:
at+netmode=2 ok
at+WiFi_conf=HI-LINK,wpa2_aes,12345
678 ok
at+dhcpc=1 ok
at+remoteip=192.168.11.245 ok
at+remoteport=8080 ok
at+remotepro=tcp
at+mode=server
at+uart=115200,8,n,1 ok
at+uartpacklen=64 ok
at+uartpacktimeout=10 ok
at+net_commit=1
4.3. Serial port to WiFi server (dynamic IP address)
Code:
char * commands_WiFi_ap = "\
at + netmode = 2 \ r \ n \ // Set to wireless network card mode
at + WiFi_conf = Hi-Link_, wpa2_aes, 0000000000 \ r \ n \ // Set the hotspot name and
password for WiFi connection
at + dhcpc = 1 \ r \ n \ // Using the method of dynamically obtaining IP
at + remoteport = 8080 \ r \ n \ // Set the local monitor port
at + remotepro = tcp \ r \ n \ // Set the socket connection method
at + mode = server \ r \ n \ // socket connects as server
at + uart = 115200,8, n, 1 \ r \ n \ // Set serial port parameters
at + uartpacklen = 64 \ r \ n \ // Set the frame length
at + uartpacktimeout = 10 \ r \ n \ // Set the frame time
at + net_commit = 1 \ r \ n \ // Submit parameters