USR IOT USR-TCP232-S2 Software Manual
Hide thumbs Also See for USR-TCP232-S2:

Advertisement

USR-TCP232-S2 User Manual
h.usriot.com

USR-TCP232-S2 Software Manual

File version:V1.0.1
1 / 41
Jinan USR IOT Technology Limited
www.usriot.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the USR-TCP232-S2 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for USR IOT USR-TCP232-S2

  • Page 1: Usr-Tcp232-S2 Software Manual

    USR-TCP232-S2 User Manual h.usriot.com USR-TCP232-S2 Software Manual File version:V1.0.1 1 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 2: Table Of Contents

    USR-TCP232-S2 User Manual h.usriot.com USR-TCP232-S2 Software Manual........................... 1 1. Overview..................................4 1.1. Brief Introduction............................4 2. Function..................................4 2.1. Configuration..............................4 2.2. Work mode..............................4 2.2.1. Connection diagram:.........................5 2.2.2. TCP Client mode..........................5 2.2.3. TCP Server mode..........................6 2.2.4. UDP Client mode..........................8 2.2.5.
  • Page 3 AppendixⅠ:Meaning of Port parameter bit....................36 AppendixⅡ:ID type of Independent ID......................36 Appendix Ⅲ:Upper computer Socket programming example..............37 Server Socket code:............................37 Client Socket code:............................39 6. Contact information..............................41 7. Disclaimer................................41 8. Undated History..............................41 3 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 4: Overview

     Module name and password After setting parameter then reset the module . 2.2. Work mode USR-TCP232-S2 work mode : TCP Client, TCP Server, UDP Client, UDP Server, HTTPD Client. Work mode can be changed by webpage or software. 4 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 5: Connection Diagram

    4) It has synchronizing function of baud rate, user should install USR VCOM Software. 5) When local port number is “0” , it means local port is random. 5 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 6: Tcp Server Mode

    16, default value 4. When the Client link is more than 16, the new link will replace the former link from Link 1 If the Client link is more than 4, send and receive data at same time , the data flow should be within 2.5 KB/s 6 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 7 USR-TCP232-S2 User Manual h.usriot.com 7 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 8: Udp Client Mode

    2) In UDP Server Mode, TCP232-S2 records an IP, Once it receives data, it will send data to record IP. TCP232-S2 also works as a server, can receive data from Ethernet and convert target IP to data source IP. 8 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 9 USR-TCP232-S2 User Manual h.usriot.com 9 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 10: Httpd Client

    Transmission interval is accurate; Advantages Not easy to lose data package; No connection mechanism; Reliable connection mechanism; Easy and flexible; Disadvantage Easy to block up Information; Under bad network condition, it is 10 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 11: Configuration Protocol

    From 4th to 9th is TCP232-T2 MAC address. The last 12 byte before check bit is user name and password, both is 6 byte, if not, write 0 (the last byte of user name and password should be 0 , the 11 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 12 Not enabled, reserved protocol uiId 01 00 Device ID bit0(1): send ID when connecting ; bit1(2): send ID when sending data; bit2(4): RS485; ucIdType bit4(16): Reset; bit5(32):Link-state; bit6(64): index function; bit7(128):Similar RFC2217 function, 12 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 13 Factory default : send FF 13 0B 00 71 77 7C 42 2F 61 64 6D 69 6E 00 61 64 6D 69 6E 00 07; Sum check: 07 = 13 + 0B+ ... + 6E + 00 13 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 heartbeat package content heartbeat 00 00 00 00 00 00 00 00 00 00 00 00 00 14 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 15: Network Echo Command

    Return result of read command: return result is all parameters of TCP232-T2 ,264 byte Not include check and protocol ,return parameter directly. Refer to Table 2-4. Return result In 3 package. 130 byte, 50 byte, 84 byte. 15 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 16: Monitor Function

    If user name and password is wrong , it return FF 01 CMD ’P’ Other is wrong ,it returns FF 01 CMD’E’ 2.3.3. Monitor function If user want to monitor message, please do as follows with USR-M0 software. 16 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 17: Serial Port Setting Protocol

    Basic configuration : It includes some serial port parameter configuration. Total 67 byte, check bit xx= 00 + 00 +00+80 ... + 00. Send 55 BE+basic parameter+check bit, If configuration is right ,it returns BE 4B, otherwise ,it returns BE 45. 17 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 18 Table 8 - Port setting command Name Byte Example Instruction ulBaudRate 00 C2 01 00 Serial port baud rate ucDataSize Serial port data bite (0X05/0x06/0x07/0x08) Serial port check bite ucParity 1:no, 2:odd, 3:even, 4:mark, 5:space 18 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 19 Static IP ulGatewayIP C9 00 A8 C0 Gateway ulSubnetMask 00 FF FF FF Subnet mask 55 53 52 2D 4B 32 00 ucModName Module name 00 00 00 00 00 00 00 19 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 20 Write the read data as it is . ucReserved 00 00 00 00 00 Write 00 00 00 00 00. For extension use Current IP 07 00 A8 C0 Current module IP address 20 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 21: Similar T24 Series Setting Protocol

    TCP232-T2 will return 35 bytes data package. 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39. When setting parameter ,it send 40 bytes, returns 35 bytes. 21 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 22 Independent ID (ID type has addition meaning ,refer to appendix 2) 00 FF FF FF Subnet mask,Little Endian Subnet mask Port parameter set : Port parameter set of similar T24 set protocol. 22 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 23 C9 00 A8 C0 Gateway IP Gateway 0:UDP Client, 1:TCP Client Work mode 2:UDP Server, 3:TCP Server 00 C2 01 Port baud rate Baud rate Port parameter Data bit, stop bit, check bit 23 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 24: Uart Framing Mechanism

    M byte data transmission time : If n> 2T ,data won’t overflow, TCP232-T2 work well. 2.5. Special Function 2.5.1. RS485 Function S2 reserved 485 pin, this function can be set by software, won’t effect RS232 communication. 24 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 25: Transparent Transmission Cloud

    When using VCOM software, this function also works, the baud rate of software in PC will match Autonomic with the baud rate of USR-TCP232-S2, don’t need to focus on serial port baud rate. After restart, it is default parameter .
  • Page 26: New Function

    2.6.1. AT Command According to AT Command protocol , TCP232-S2 enter into AT Command mode and set parameter More details ,please refer to 《USR-TCP232-S2 software manual》 When pull low CFG(Reload)Pin firstly, S2 will set parameter by port , AT Command is invalid.
  • Page 27: Httpd Client

    “$” means data length in package head, TCP232-S2 will assign a value, user don’t need to modify. The Parameter can be set in webpage. 2.7. Firmware Upgrade Diagram 17 Firmware upgrade 3. Webpage By default, user name and password : admin . IP :192.168.0.201 27 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 28: Log In

    Open a browser, type 192.168.07 , Name and password:admin User can also log in by software. 3.2. State Configuration Module name , Current IP address , Mac address, Remote IP/TX/RX , TX Count/ RX Count. 28 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 29: Local Ip

    4)Gateway: Router IP address, it should be set correctly when used for domain name resolution. 5)DNS Gateway : Server IP of domain name resolution , by default it is module gateway. Diagram 19 Local IP 29 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 30: Serial Port Parameter

    6) Remote: Remote server port 7) Work mode :TCP Server, TCP Client,UDP Client,UDP Server,HTTPD Client. 8) Remote Server address: it can be IP address or server domain name. 9) HTTPD:HTTPD GET or HTTPD POST. 30 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 31: Expand Function

    USR-TCP232-S2 User Manual h.usriot.com Diagram 21 Serial Port parameter 3.5. Expand Function Diagram 22 Expand Function 3.6. Misc Configuration After setting , click “save” ,then restart the module . Diagram 23 Misc Setting 31 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 32: Reboot

    Enter key ,then into Cloud Mode . 4.2. AT Command command instruction Restart effect Basic command Module AT command echo setting Reset module ENTM Quit AT Command, into transparent mode Query MAC address 32 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 33: At Command Set

    2.off : turn off echo function. 4.3.2. AT +ENTM Function: enter into transparent transmission Format: AT+ENTM<CR> <CR><LF>+OK<CR><LF> Parameter : Null ( when execute this commend, module switch into Cloud mode ) 33 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 34: At+Z

    Function: set/query UART parameter. Format: Query :AT+UART<CR> <CR><LF>+OK=<baudrate,data_bits,stop_bit,parity,flowctrl,uartnum><CR><LF> Set: AT+UART=<baudrate,data_bits,stop_bit,parity,flowctrl,uartnum ><CR><LF> <CR><LF>+OK<CR><LF> Parameter: baud rate: 9600,19200,38400,57600,115200,230400,380400,460800(module can set baud rate randomly ) Data bits :5,6,7,8 Stop bits: 1,1.5,2 ( refer to module ) 34 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 35: At Socka1

    Function: turn on /off DHCP Format: Query: AT+DHCPEN<CR> <CR><LF>+OK=<Type><CR><LF> Set:AT+DHCPGW=<Type><CR> <CR><LF>+OK<CR><LF> Parameter : Type: on means turn on DHCP , off means turn off DHCP. 4.3.10. AT+WANN Function: set/query WAN IP Format: Query: AT+WANN<CR> <CR><LF>+OK=<mode,address,mask,gateway><CR><LF> 35 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 36: Appendix

    Reset; bit5(32) Link-state; bit6(64) tcp server index; bit7(128) baud rate synchronization, similar RFC2217. When each bit is 1, it means related function is invalid. Otherwise, it is valid, default is 36 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 37: Appendix Ⅲ:upper Computer Socket Programming Example

    = AF_INET; hostaddr.sin_port = htons(LISTEN_PORT); hostaddr.sin_addr.s_addr = htonl(INADDR_ANY); listen_sock = socket(AF_INET, SOCK_STREAM, 0); if(listen_sock < 0) syslog(LOG_ERR, "%s:%d, create socket failed", __FILE__, __LINE__); exit(1); if(bind(listen_sock, (struct sockaddr *)&hostaddr, sizeof(hostaddr)) < 0) 37 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 38 -= retlen; ptr += retlen; //receive data recvlen = 0; retlen = 0; ptr = recvbuf; leftlen = RECV_BUF_SIZE -1; //do retlen = recv(app_sock, ptr, leftlen, 0) ; if(retlen < 0) 38 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 39: Client Socket Code

    = 0; int sendlen = 0; int leftlen = 0; char *ptr = NULL; struct sockaddr_in ser_addr; memset(&ser_addr, 0, sizeof(ser_addr)); ser_addr.sin_family = AF_INET; inet_aton("127.0.0.1", (struct in_addr *)&ser_addr.sin_addr); ser_addr.sin_port = htons(SERVER_PORT); 39 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 40 //send data sendlen = strlen(sendbuf) +1; retlen = 0; leftlen = sendlen; ptr = sendbuf; // while(leftlen) retlen = send(sock_fd, ptr, sendlen, 0); if(retlen < 0) if(errno == EINTR) retlen = 0; 40 / 41 Jinan USR IOT Technology Limited www.usriot.com...
  • Page 41: Contact Information

    Email: sales@usr.cn 7. Disclaimer The document provides information about USR-TCP232-S2 module, it doesn’t grant any license to the intellectual property rights. Except the responsibility declared in the product sale clause, USR does not assure any other responsibilities. In addition, USR does not make any warranties for the sale and use of this product, including the suitability of products for a particular purpose, merchant ability or fitness for any patent, copyright or other intellectual property infringement.USR may make changes to specifications and products description...

Table of Contents