![Hi-Link HLK-RM58S User Manual Download Page 20](http://html1.mh-extra.com/html/hi-link/hlk-rm58s/hlk-rm58s_user-manual_2128955020.webp)
17
4.2 Serial 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,wpa2_aes,12345678\r\n\ //Set wifi, encryption and password
at+dhcpc=0\r\n\ //Use static ip mode
at+net_ip=192.168.11.254,255.255.255.0,192.168.11.1\r\n\ // Set mode ip
at+remoteip=192.168.11.245\r\n\ // Set the remote ip to be connected
at+remoteport=8080\r\n\ // Set the remote port to be connected
at+remotepro=tcp\r\n\ // Set socket’s connection methods
at+mode=client\r\n\ //Use client mode to connect to the remote server
at+uart=115200,8,n,1\r\n\ // Set the serial port parameter
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
at+reconn=1\r\n\"; // Restart the module
Com_send(commands_wifi_client_static); //Send parameters out of the serial port
Run back:
at+netmode=2 ok
at+wifi_conf=HI-LINK,wpa2_aes,12345678 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