background image

                                                  USR-N668 User Manual                                Technical Support: 

h.usriot.com

   

 

Jinan USR IOT Technology Limited                                                                                                                                     

www.usriot.com

 

 

47

 

 

Figure 68 AT command 

 

Figure 69 Time sequence diagram 

Time requirements: 
T1 > serial port packing interval 
T2 < < 300ms 
T3 < < 300ms 
T5 < < 3S 
 
The transition from transmissions mode to temporary instruction mode: 
1. The serial port device sends "++" to the module continuously. When the module receives "++", it sends a "a" to the 
device. No data can be sent before sending "+ + +". 
2. When the device receives "a", it must send a "a" to the module within 3 seconds. 
3. After receiving the "a", module sends the "+OK" to the device and enters the "AT instruction mode". 
4.  When  the  device  receives  "+OK",  it  knows  that  the  module  has  entered  "AT  instruction  mode"  and  can  send  AT 
instructions to it. 
 
Switching from the AT instruction mode to the network pass through sequence: 
1. The serial port sends the instruction "AT+ENTM" to the module. 
2. Module returns the "+OK" after receiving the instruction and returns to the previous mode. 
 

5.3.2.

 

Error code 

Table 10    Error code 

Error code 

Describe 

-1 

Invalid command format 

-2 

Invalid command 

-3 

Invalid operator 

-4 

Invalid parameters 

-5 

operation not permitted 

Summary of Contents for USR-N668

Page 1: ...USR N668 User Manual Technical Support h usriot com Jinan USR IOT Technology Limited 1 USR N668 User Manual File Version V1 0 4 ...

Page 2: ...t mask Gateway 15 4 1 2 DNS 17 4 1 3 VPN PPTP 17 4 1 4 VPN GRE 18 4 1 5 Network diagnosis 19 4 1 6 Restore factory settings 20 4 1 7 Web Server 20 4 1 8 Firmware upgrade 21 4 2 Transtransmission function 22 4 2 1 TCP Client 22 4 2 2 TCP Server 24 4 2 3 UDP Client 26 4 2 4 UDP Server 28 4 2 5 Httpd Client 29 4 2 6 SSL Client 31 4 2 7 V COM 32 4 3 Serial port Functions 33 4 3 1 Serial port framing m...

Page 3: ...ed task 40 5 Parameter setting 41 5 1 Network protocol settings parameters 41 5 1 1 Software setting parameters 41 5 1 2 Setting protocol settings parameters 43 5 2 Web settings parameters 43 5 3 AT command 46 5 3 1 AT command 46 5 3 2 Error code 47 6 Contact Us 48 7 Disclaimer 48 8 Update History 48 ...

Page 4: ...en work as Client It works as TCP client supports to 16 max TCP Client Keep alive Registration package Modbus TCP to Modbus RTU User defined overtime Reload no data reload and overtime connection The modifiable one and only MAC DNS domain name resolution user defined DNS server address Remote monitoring and remote firmware upgrading Network time synchronization RTC real time clock User defined Tas...

Page 5: ... 1 1 Hardware Preparation You need 1 USR N668 for one 2 Power cord 85V 265V for one 3 Female to female serial cable for one 4 DB9 M to RJ45 for one 5 Network line for two 6 PC with RS232 or USB to 232 1 1 2 Hardware Connection For test the communication conversion between serial port and network you should connect the USR N668 to PC with serial cable or USB to serial cable connect the Ethernet por...

Page 6: ...Figure 1 RS232 485 422 smart switch N668 serial port 1 network DB9 M to RJ45 mother to mother serial cable PC serial port Figure 2 serial port connection between N668 and PC The above is the hardware connection diagram of RS232 for transparent transmission when use RS485 RS422 you can connect the corresponding signal line see the details in Hardware introduce Serial port pin definition Note the st...

Page 7: ... test you should 1 Close the firewall of the computer usually found in the control panel and anti virus software 2 Close the network card which is not related to this test only one local connection is reserved 3 For servers to connect directly to PC a static IP address in the same network segment with USR N668 must be set to the PC e g 192 168 0 201 Figure 4 PC local connection settings 1 3 Defaul...

Page 8: ...port and the Ethernet port Communication procedures are as follows 1 Open the testing software USR TCP232 Test exe connected hardware 2 The default mode of operation is TCP Server first port serial port monitor 20001 port So choose TCP client mode at the network setup end of the software IP 192 168 0 7 target port 20001 then click the connect The serial baud rate is 115200 The serial port paramete...

Page 9: ...m Jinan USR IOT Technology Limited www usriot com 9 Figure 5 data transmission test The USR TCP232 Test exe download links https www usriot com support downloads usr tcp test testing software html 2 Product overview Figure 6 USR N668 hardware interface ...

Page 10: ...ort customize DNS server address User configuration Software configuration Web page configuration AT instruction configuration Simple pass through mode TCP Server TCP Client SSL Client UDP Server UDP Client Http Client Class RFC2217 Support Network cache 10kbyte Serial port cache 10kbyte Average transmission delay 50ms Software kit V COM setup software test program Packaging mechanism 50ms packing...

Page 11: ...m 11 3 Hardware Design 3 1 Hardware Dimensions Figure 7 Hardware dimensions 3 2 Pin definition 3 2 1 Dial switch On the back of the equipment there is a dial up switch setting window You need to use the cross flower screwdriver remove the screws to see The following is the setting of the code switch ...

Page 12: ... usriot com Jinan USR IOT Technology Limited www usriot com 12 Figure 8 RS232 485 422 smart switch A total of 16 8 serial port 2 dial code The device has 8 serial ports and 2 dial numbers per route as shown in the figure Figure 9 RS232 model ...

Page 13: ...ted www usriot com 13 Figure 10 RS485 model Figure 11 RS422 model Table 3 Correspondence communication mode Dial switch L to R 232 0 0 485 1 1 422 1 0 Pay attention The switch position is shown in the figure The dialing sequence form L to R Default is 232 mode the dial switch is 0 0 ...

Page 14: ...mber Name Function 1 232_TX 422_Z 485_B1 232 send 422 signal Z 485 signal B 2 232_RX 422_A1 232 receive 422 signal A 3 422_Y 485_A1 422 signal Y 485 signal A 4 422_B1 422 signal B 5 NC 6 GND 232 signal GND 7 NC 8 NC Pay attention 232 485 422 can t work at one time The position of the dialing switch must be correct The hardware interface is RJ45 you need to use 8 core cable and crystal head to make...

Page 15: ...Red Undefined READY Green On working TXN Red Flicker Serial port sending data RXN Green Flicker Serial port receiving data 4 Product Functions This chapter introduces the functions of USR N668 as the following diagram shown you can get an overall knowledge of it Figure 14 Product 668 Functions diagram 4 1 Basic Functions 4 1 1 IP address Subnet mask Gateway There are two ways for module to get IP ...

Page 16: ...mask is mainly used to determine the IP address of the network number and host number indicating the number of subnets judging whether the module is in the subnet flag Subnet Masks must be set we usually use the C class subnet mask 255 255 255 0 network number for the first 24 bits host number for the last 8 bits the number of subnets For the 255 module IP in 255 scopes the module IP is considered...

Page 17: ...ver users can also set the address of a specific DNS server according to needs 668 need domain name resolution will be set to the DNS server to submit a resolution request In the case of DHCP the domain name server address is automatically acquired Figure 16 DNS server Reference AT command Table 8 DNS AT command AT command Describe AT DNS Set and query DNS server 4 1 3 VPN PPTP Support the VPN lin...

Page 18: ...cryption Data encryption support MPPE MPPE 128 and other encryption methods Authentication support PAP CHAP MSCHAP MSCHAPv2 etc LCP response interval the default heartbeat interaction interval is 300 seconds MTU maximum transmission unit default 1500 can be reduced according to requirements 4 1 4 VPN GRE Support VPN GRE ...

Page 19: ...rameters remote address local address remote tunnel address and local tunnel address After the GRE is established the two sides can interoperate and visit each other on IP 4 1 5 Network diagnosis The network diagnostic function supports Ping instructions for testing the network link e g ping www baidu com w 3 w indicates the duration of Ping ...

Page 20: ...igured erroneous or if you forget to set the password you can use the hardware to restore the factory settings 2 Setting up software setting up the factory s function by setting up the software 3 AT instruction enter AT instruction mode and resume factory by instruction AT RELD 4 Web page restore the factory button 4 1 7 Web Server Built in web server users can set parameters through the web page ...

Page 21: ...al Support h usriot com Jinan USR IOT Technology Limited www usriot com 21 Figure 21 668 working status 4 1 8 Firmware upgrade The specific upgrading methods are as follows Figure 22 668 firmware upgrade 1 Choose the firmware path ...

Page 22: ...n No power failure during the process of firmware brush writing The process of writing and restarting is expected to be 100 seconds see page timing and then the device can be revisited You can choose whether to retain parameters and don t retain them by default The official firmware must be used 4 2 Transtransmission function 668 Socket work mode TCP Client TCP Server UDP Client UDP Server Httpd C...

Page 23: ...er 60 seconds of no data for the first time If the connection is abnormal interruption it will be immediately detected and prompted 668 to disconnect the original connection and reconnect The formula is 60 5 3 75 s 3 This model supports synchronous baud rate function USR cloud function and short connection function 4 In the same LAN if 668 is set to static IP keep 668 IP and gateway in the same ne...

Page 24: ... Client transmission test 4 2 2 TCP Server Figure 29 TCP Server 1 when 668 work as TCP Server there are Keep Alive functions for real time monitoring 2 Use for TCP client communication to LAN It is suitable for the scenario where there is no server in the LAN and multiple computers or mobile phones request data from the server Like TCP Client there are differences between connection and disconnect...

Page 25: ... up to 16 Client connections and the local port number can t be set to 0 6 668 work as TCP Server When the number of connections Client exceeds the maximum set it will no longer be accessible 7 668 work as TCP Server local port 20001 The default is from 20001 20008 make sure that the local ports of each path are different then save There are two ways to set up use web pages or software Figure 30 T...

Page 26: ...l provides simple and unreliable communication services No connection connected disconnected 2 When work at UDP Client 668 only communication with target IP 3 Target IP 255 255 255 255 it can achieve the effect of UDP full segment broadcast 4015 and later firmware supports broadcast in the network segment such as xxx xxx xxx 255 s broadcast mode 4 Can t support multicast 5 Set up UDP Client target...

Page 27: ...e software is set to UDP the local IP is set to the PC IP and the local port number is the target port number of 668 Click Connect Open the serial port First click the serial port to send receive the data test software target IP and target port number to 668 IP and port number and then click the network to send data to the serial port ...

Page 28: ...the data source IP and port number When sending data the IP and port number are sent to the nearest communication 2 This mode is usually used in data transmission scenarios where multiple network devices need to communicate with modules and do not want to use TCP because of their high speed and frequency 3 Set up UDP Server target port 20108 Open the USR TCP232 Test exe set up UDP mode the local I...

Page 29: ...method is the same as UDP Client Figure 36 UDP Server testing 4 2 5 Httpd Client 1 In this mode the user s terminal device can send the request data to the specified HTTP server through 668 and then 668 receives the data from the HTTP server parses the data and sends the result to the serial port device 2 Simple parameter settings can transmission data from serial device to HTTP server 3 Each time...

Page 30: ...Client web set 1 set up Httpd Client target IP domain name and target port 2 Set up Httpd request mode through web page and request URL and packet header information of package 3 Httpd server recovery information packet header default removed 4 Save and reload 5 Now can send data after open serial port 6 Reference below ...

Page 31: ...port h usriot com Jinan USR IOT Technology Limited www usriot com 31 Figure 38 Httpd Client mode 4 2 6 SSL Client Does not support in the current firmware Support SSL encryption on TCP links Target address www alipay com target port 443 ...

Page 32: ...zilla 4 0 Host www alipay com Figure 40 SSL Client test 4 2 7 V COM Figure 41 V COM User can download VCOM software from http www usriot com usr vcom virtual serial software Through this software user can set up connection between N668 and virtual serial to solve the problem that traditional equipment PC software used in serial port communication way 1 set 668 TCP Server 2 open V COM and add seria...

Page 33: ...2 V COM setting 4 3 Serial port Functions 4 3 1 Serial port framing mechanism Because the data on the network side are transmitted in data frames it is necessary to send the frame data through the serial port to the network side so that the data can be transmitted more efficiently and quickly 4 3 2 RFC2217 like ...

Page 34: ...SR N668 For example in the running process the serial port baud rate of the 668 server is changed from 115200bps to 9600bps RFC2217 like functions are mainly used in conjunction with VCOM The default is the open state 4 4 Characteristic function 4 4 1 Socket B Implement a simple TCP UDP Client function the data received by the serial port and send to Socket A and Socket B and vice versa It can be ...

Page 35: ...tbeat data to serial or network periodic User can configure the heartbeat data and time interval Serial heartbeat data can be used for polling Modbus data Network heartbeat data can be used for showing connection status and keep the connection only take effect in TCP UDP Client mode The longest for Custom heartbeat package content is 40 bytes the heartbeat time is 30 seconds the range is 1 65535 s...

Page 36: ...m 36 Figure 45 heartbeat packet function Heartbeat packet can set through the web Figure 46 heartbeat packet function 4 4 3 Registration package There are three kinds of registration packages Custom registration package transparent cloud MAC registration package Here is a custom registration package ...

Page 37: ...to send a registry packet After the connection is established send the registry packet immediately the main purpose is to enable the server to identify the data source device or as a password to obtain server function authorization Figure 47 send registration package after connection Data portability put the registration packet in the front of data which is mainly used for protocol transmission Fi...

Page 38: ...8 User Manual Technical Support h usriot com Jinan USR IOT Technology Limited www usriot com 38 Figure 50 modbus TCP data flow Figure 51 modbus TCP setting Figure 52 modbus TCP test 4 4 5 No data reconnection ...

Page 39: ...d of time the device disconnects and reconnects the current link note that only the TCP Client does This eliminates the existence of some dead links to facilitate the stability of PC software Figure 53 no data reconnection setting 4 4 6 DDNS Support dynamic DNS Figure 54 DDNS setting Figure 55 DDNS test 4 4 7 Remote management and remote monitoring Remote monitoring realizes remote device state ma...

Page 40: ...grade can upgrade firmware by server The default is not opened Figure 57 Remote firmware upgrade Attention This function and remote server are all trial run Remote server login address https ycsj1 usr cn index php Public login 4 4 8 Scheduled task This function can carry out instructions to the device by way of dividing time day month and week Syntax is shell instruction ...

Page 41: ...ial Port Parameters 668 Working Mode Work parameters In order to ensure the normal use of the software we need to take the following steps 1 When setting parameters with settings software it is necessary to ensure that all device in the same LAN 2 turn off the anti virus software and firewall on the computer 3 close the NIC that has nothing to do with this test 5 1 Network protocol settings parame...

Page 42: ...the main parameter IP address type static and DHCP The static IP 668 is set up in the same network segment as router IP Subnet mask General default 255 255 255 0 Gateway generally routers IP set up correctly in order to cross network segment communication and domain name resolution Device name the name can be customized Webpage port port number when accessing web page is default 80 3 Serial port p...

Page 43: ...n using the software to set parameters through the network the display will be forced to open Configure parameters through serial port As follows the steps are to operate through the serial port open the serial port enter the configuration state and then click read reference Figure 63 software Modify PC s IP and module in the same network segment or use serial configuration parameters 5 1 2 Settin...

Page 44: ...tatus page shows some basic information about 668 668 name Current IP address MAC address 2 Local IP settings Modify the parameters that need to be set on this page click Save Settings and then modify the parameters of the next page If no other parameters need to be changed Click Restart IP address acquisition mode IP Subnet mask gateway address DNS server ...

Page 45: ... Support h usriot com Jinan USR IOT Technology Limited www usriot com 45 Figure 66 IP setting 3 Port parameters Baud rate Data bits Check digit Stop bits The way of work Remote server address Local port Remote port Special functions ...

Page 46: ... page content customization up to 40 bytes the use of custom registration package USR Cloud number and password Synchronization baud rate 2217 the function of synchronous baud rate can be opened through webpage 5 3 AT command 5 3 1 AT command The UART port baud rate 115200 no check 8 bit data bits 1 bit stop bits Input on UART the module will return a confirmation code a after receiving Enter the ...

Page 47: ...eceives a it must send a a to the module within 3 seconds 3 After receiving the a module sends the OK to the device and enters the AT instruction mode 4 When the device receives OK it knows that the module has entered AT instruction mode and can send AT instructions to it Switching from the AT instruction mode to the network pass through sequence 1 The serial port sends the instruction AT ENTM to ...

Page 48: ...perty license by forbidding speak or other ways either explicitly or implicitly Except the duty declared in sales terms and conditions we don t take any other responsibilities We don t warrant the products sales and use explicitly or implicitly including particular purpose merchantability and marketability the tort liability of any other patent right copyright intellectual property right We may mo...

Reviews: