
第
22
页 共
34
页
4.2. Serial port to wifi client(static ip address)
code
:
char *commands_wifi_client_static="\\
at+netmode=2\r\n\
//Set to wireless network card sta mode
at+wifi_conf=HI-LINK,none,12345678\r\n\
//Set wifi, encryption method and password
at+dhcpc=0\r\n\
//Use static ip
at+net_ip=192.168.11.254,255.255.255.0,192.168.11.1\r\n\
//Set the ip of module
at+remoteip=192.168.11.245\r\n\
//Set the IP address for remote connection
at+remoteport=8080\r\n\
//Set the remote port to be connected
at+remotepro=tcp\r\n\
//Set the socket connection method
at+mode=client\r\n\
//Connect to the remote server in client mode
at+uart=115200,8,n,1\r\n\
//Set serial port parameters
at+uartpacklen=64\r\n\
//Set the framing length
at+uartpacktimeout=10\r\n\
//Set framing time
at+net_commit=1\r\n\
//Submit parameters
at+reconn=1\r\n\";
//Restart the module
Com_send(commands_wifi_client_static);
//
Send these data out from the serial port
feedback
:
at+netmode=2 ok
at+wifi_conf=HI-LINK,none,123456
78 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