Installation & Configuration manual GSM/GPRS OpenAT application V1.1
2012 / 07 / 17 2
! CAUTION! ELECTRIC SHOCK HAZARD IF COVER REMOVED SERVICE BY QUALIFIED PERSONEL ONLY Document History Date Version OpenAT Auteur 19/01/12 V1.0 V2.0_7.44 Filip Lavaerts Creation 16/07/12 V1.1 V2.2_7.44 Imre Leber Addition 'How to switch between 5 modes' Introduction Generic version RSA encryption 2012 / 07 / 17 3
2012 / 07 / 17 4
Table of Contents 1. Introduction 2. General description 3. Basic setup 4. Working mode description 5. How to switch between the 5 working modes via SMS 6. SMS requests 7. SMS commands 8. Additional at commands 9. NTP 10. Periodical RESET configuration 11. DOTA upgrade 2012 / 07 / 17 5
Serial flow as used in this manual : DTE Data Terminal Equipment TxD RxD DTR DSR RTS CTS RI DCD GND IN OUT DCE Data Communication Equipment PC POS PLC Application Modem InduBox GSM DinBox GPRS Communication device 2012 / 07 / 17 6
1. Introduction This manual is the reference manual for configuring the GSM-GPRS OpenAT(*) application. This application is created for the Bausch Datacom NV InduBox GSM VIII GSM/GPRS modem. This modem is using the Sierra Wireless Q2686 quad band GSM/GPRS module and is using both UART interfaces : Q26.UART1 to the RS-232 interfaces and Q26.UART2 to RS-485 interface. Thanks to the GSM-GPRS OpenAT(*) application, 2 non IP enabled devices, connected to the Indubox modem, can be accessible over a GPRS link. (*) OpenAT is a trademark of Sierra Wireless 2012 / 07 / 17 7
2. General Description CSD (Circuit Switched Data) data communication with GSM modems has a similar behavior as connections with standard PSTN modems over a POTS (Plain Old Telephone System) line. In CSD answering mode (auto answer active s0=1), the Indubox modem will sent the unsolicited CONNECT 9600 responds after a successful connection is established with a remote originating modem. When the remote modem is disconnecting the connection, the responds NO CARRIER will be transmitted. When using GPRS the situation is complete different. TCP/IP is used, all data will be sent in packets and routed over an IP packet switched network. Thanks to the GSM-GPRS OpenAT application a CSD answering mode will be simulated when using communication over a GPRS link. When the OpenAT application is started in a socket server mode, a GPRS/APN connection will be automatically established and maintained. After a successful GPRS/APN connection the InduBox modem will be part of an IP network (Internet or Intranet) and will have an IP number. The OpenAT application will start a TCP socket server (listener) service and will listen to a predefined PORT. When a remote TCP client establishes a connection with the InduBox modem, the unsolicited responds CONNECT 9600 will be transmitted. When the TCP client is disconnecting the connection, the responds NO CARRIER will be transmitted. More information about the different modes of the Socket Server OpenAT are described in the following sections. 3. Basic Setup When using the GSM-GPRS OpenAT application is initial started, the serial ports of the InduBox modem will work with the following parameters : Speed : 9600 bps Async format : 8N1 Flow control : not used (no RTS needed from DTE) V.24 DTR signal : not used (no DTR needed from DTE) Basically only RXD/TXD and GND are needed to use the OpenAT application. It s possible to use the isolated 3-wire RS-232 and 2-wire RS-485 interfaces of the InduBox GSM VIII modem. 2012 / 07 / 17 8
4. Possible Working Modes There are 5 possible working modes into the Socket Server Open AT application : 4.1 CSD The modem is acting like a normal GSM CSD data modem in auto answer mode (s0=1). During CSD data mode both RS-232 and RS-485 interfaces can be used in parallel and the modem will be 100% transparent in data mode. When a remote modem dials-in the unsolicited responds CONNECT 9600 is sent. When the connection is disconnected NO CARRIER will be sent. During idle state mode the modem is able to receive a SMS message and check the message content. More info on the SMS message content info below. 4.2 GPRS Same function as CSD described above, but the modem has received APN GPRS parameters via a SMS message. APN server name, user name, password and DNS info is entered, but there is no GPRS attachment or APN connection. This mode is implemented to allow DOTA (Download Over The Air) upgrade via a FTP host. This function is described below. During idle state mode the modem is able to receive a SMS message and check the message content. More info on the SMS message content info below. 4.3 SCKdual In this mode, the modem will automatically be connected to GPRS/APN and a TCP socket server (listen) service will be started. The APN connection and the socket listen mode will be checked regularly (60 seconds) so that the modem is always ready to answer a TCP socket client request. During SCKdual mode both RS-232 (Q26.UART1) and RS-485 (Q26.UART2) interfaces can be used in parallel. When a remote TCP client establishes a connection with the InduBox modem, the unsolicited responds CONNECT 9600 will be transmitted. When the TCP client is disconnecting the connection, the responds NO CARRIER will be transmitted. During data mode the modem is 100% transparent. When a remote modem dials-in (CSD) during an active TCP connection, the socket connection will be terminated and the CSD call will be answered. 2012 / 07 / 17 9
During idle state mode the modem is able to receive a SMS message and check the message content. More info on the SMS message content info below. 4.4 SCKserv In this mode, the modem will automatically be connected to GPRS/APN and a TCP socket server (listen) service will be started. The APN connection and the socket listen mode will be checked regularly (60 seconds) so that the modem is always ready to answer a TCP socket client request. During SCKserv mode both RS-232 and RS-485 interfaces are listening to another IP PORT. PORT1 for the RS-232 interface (Q26.UART1) and PORT2 for the RS-485 interface (Q26.UART2). When a remote TCP client establishes a connection with the InduBox modem, the unsolicited responds CONNECT 9600 will be transmitted. When the TCP client is disconnecting the connection, the responds NO CARRIER will be transmitted. During data mode the modem is 100% transparent. When a remote modem dials-in (CSD) during active TCP connections, the socket connection on the RS-232 interface (Q26.UART1) will be disconnected and the CSD call will be answered. Data to/from the RS-485 interface (Q26.UART2) will be stalled (connection, but no data) until the CSD connection is disconnected. During idle state mode the modem is able to receive a SMS message and check the message content. More info on the SMS message content info below. 4.5 SCKclient In this mode, the modem will automatically be connected to GPRS/APN and two TCP socket client services will be started. Both TCP clients, PORT1 for the RS-232 interface (Q26.UART1) and PORT2 for the RS-485 interface (Q26.UART2), will try to establish a connection with the remote TCP/IP server:port. When connection is established the InduBox modem is sending it's unique IMEI code to the TCP server. The server must respond with a 16 bytes data. The InduBox modem is generating and sending back a HASH to the server. Server has to encrypt (private key) the same 16 bytes and compare it with the received HASH. If not equal, the server needs to close the connection. More information about this validating process is available in a separate document. When the client establishes a connection, the unsolicited responds CONNECT 9600 will be transmitted. When the connection is disconnected, the responds NO CARRIER will be transmitted. During data mode the modem is 100% transparent. When a remote modem dials-in during active TCP connections, the socket connection on the RS-232 interface (Q26.UART1) will be disconnected and the CSD call will be answered. Data to/from the 2012 / 07 / 17 10
RS-485 interface (Q26.UART2) will be stalled (connection, but no data) until the CSD connection is disconnected. During idle state mode the modem is able to receive a SMS message and check the message content. More info on the SMS message content info below. 5. How to switch between the 5 modes via SMS Switching between the modes described above is done via (text) SMS messages. Note: Each line must be terminated with a <CR><LF>, excluding the last () line, which should be alone on the last line. The syntax of a line in the configuration is: Keyword : Value There should be one space between Keyword and : and one space between : and Value. Each character is case sensitive. In a default state CSD mode is selected. No GPRS parameters are saved. 5.1 Switch to GPRS mode A SMS with the following content must be sent to the modem; InduBox startup.ini Link : GPRS APN : proximus.internet.be APNUN : username APNPW : password DNS1 : DNS2 : When the modem receives the SMS message as described above, the modem will save all the received parameters, restart and enter the GPRS mode. As explained above; this mode acts the same as CSD but all APN parameters are know and programmed. This mode exists to do an FTP upgrade as explained in next chapter. 2012 / 07 / 17 11
5.2 Switch to SCKdual mode A SMS with the following content must be sent to the modem; InduBox startup.ini Link : SCKdual APN : proximus.internet.be APNUN : username APNPW : password DNS1 : DNS2 : Port : 404 When the modem receives an SMS message as described above, the modem will save all the received parameters, restart and enter the SCKdual mode. After the GSM registration the modem will automatically establish a connection to the GPRS network and the APN. The received IP address will be sent onto the RS-232 port (Q26.UART1) as an unsolicited responds and the socket server service will start automatically. 5.3 Switch to SCKserv mode A SMS with the following content must be sent to the modem; InduBox startup.ini Link : SCKserv APN : proximus.internet.be APNUN : username APNPW : password DNS1 : DNS2 : Port1 : 1024 Port2 : 1025 When the modem receives an SMS message as described above, the modem will save all the received parameters, restart and enter the SCKserv mode. After the GSM registration the modem will automatically establish a connection to the GPRS network and the APN. The received IP address will be sent onto the RS-232 port (Q26.UART1) as an unsolicited responds and the socket server service will start automatically. 2012 / 07 / 17 12
5.4 Switch to SCKclient mode A SMS with the following content must be sent to the modem; InduBox startup.ini Link : SCKclient APN : proximus.internet.be APNUN : username APNPW : password DNS1 : DNS2 : Server1 : 214.220.183.111 Port1 : 1024 Server2 : 214.220.183.111 Port2 : 1025 When the modem receives an SMS message as described above, the modem will save all the received parameters, restart and enter the SCKclient mode. After the GSM registration the modem will automatically establish a connection to the GPRS network and the APN. The received IP address will be sent onto the RS-232 port (Q26.UART1) as an unsolicited responds and the socket server service will start automatically. The TCP/IP client(s) will start to establish a connection with the remote server(s):port. 5.5 Switch to CSD mode It s always possible to go back to the default CSD mode via the following SMS; InduBox startup.ini Link : CSD When the modem receives an SMS message as described above, the modem will restart, and enter the CSD mode. 2012 / 07 / 17 13
6. SMS Requests Note: Each line must be terminated with a <CR><LF>, also the last () line Each character is case sensitive. Number = telephone number for Responds SMS 6.1 Baud Rate request Message: Responds: InduBox request InduBox response Request : Baud Rate 1 Response : 9600 Number : +32495123456 Port 1 : RS-232 (Q26.UART1) interfaces Possible Responses : 2400, 9600, 19200, 38400, 57600, 115200 Message: Responds: InduBox request InduBox response Request : Baud Rate 2 Response : 9600 Number : +32495123456 Port 2 : RS-485 (Q26.UART2) interface Possible Responses : 2400, 9600, 19200, 38400, 57600, 115200 6.2 RSSI request Message: Responds: InduBox request InduBox response Request : RSSI Response : 30 Number : +32495123456 Possible Response : RSSI value after +CSQ, ref. Sierra Wireless 6.3 Working Mode request Message: Responds: InduBox request InduBox response Request : Mode Response : CSD Number : +32495123456 Possible Response : CSD, GPRS, SCKdual, SCKserv, SCKclient 2012 / 07 / 17 14
6.4 Config request Message: Responds: InduBox request Link: SCKdual Request : Config Version: V5.1 Number : +32495123456 APN: proximus.internet.be APNUN: APNPW: DNS1: DNS2: SCKserv TCP Port: 1000 FTP Address: FTP Port: FTP File: FTP Size: 7. SMS Commands Note: Each line must be terminated with a <CR><LF>, also the last () line Each character is case sensitive. Number = telephone number for Responds SMS 7.1 Baud Rate command Message: Responds: InduBox command InduBox response Command : Baud Rate 1 Response : 9600 Value : 9600 Number : +32495123456 Port 1 : RS-232 (Q26.UART1) interface Possible Value : 2400, 9600, 19200, 38400, 57600, 115200 Message: Responds: InduBox command InduBox response Command : Baud Rate 2 Response : 9600 Value : 9600 Number : +32495123456 Port 2 : RS-485 (Q26.UART2) interface Possible Value : 2400, 9600, 19200, 38400, 57600, 115200 2012 / 07 / 17 15
8. Additional AT Commands Switching between the working modes as described above can also be done locally, via additional at commands. Connect the InduBox modem, via the Bausch RJ-45 to DB-9 serial cable, to a standard COM port of a PC. Use a standard serial communication program like Windows Hyperterminal, configured onto the correct COM port / 9600 bps / 8N1 / no flowcontrol (default InduBox modem settings). Additional mode switching command AT/LINK = CSD GPRS SCKdual SCKserv SCKclient Additional GPRS parameters commands AT/APN= proximus.internet.be AT/APNUN= username AT/APNPW= password AT/DNS1= AT/DNS2= Additional SCKdual / SCKserv / SCKclient parameters commands AT/TCPPORT1 = 111 AT/TCPPORT2 = 222 AT/TCPSERVER1 = 101.102.103.104 AT/TCPSERVER2 = 102.103.104.105 Additional DOTA parameters commands AT/FTPADDRESS= 12.15.15.62 AT/FTPPORT= 21 AT/FTPFILE= file.ext AT/FTPSIZE= 262 AT/DOTAPWD= xxyyzz Additional NTP parameters commands AT/NTPSEVER = at.pool.ntp.org AT/NTPPORT= 123 AT/NTPINTERVAL=1440 [minutes] Additional Reset parameter commands AT/RESETTIME= 12:34 AT/RESETTIMEON AT/RESETTOMEOFF [HH:MM] Additional configuration overview command AT/CONFIG? 2012 / 07 / 17 16
9. NTP At interval [NTP interval in minutes] the GSM-GPRS application will try to make a connection to the [NTP Server] on port [NTP Port] to synchronize the internal Sierra Wireless Q26 clock. The clock can be managed and verified via the standard +CCLK clock command. 9.1 SMS configuration Note: Each line must be terminated with a <CR><LF>, also the last () line Each character is case sensitive. Number = telephone number for Responds SMS Message: InduBox NTP Server : nl.pool.ntp.org Port : 123 Number : +32495123456 Responds: InduBox response Response : NTP(nl.pool.ntp.org, 123,20) 9.2 AT commands AT/NTPSEVER = at.pool.ntp.org AT/NTPPORT= 123 AT/NTPINTERVAL=1440 [minutes] 2012 / 07 / 17 17
10. Periodical RESET configuration Periodical reset is provided via a GPIO connection between the Q2686 GSM/GPRS module and the XMEGA reset control processor. Note : If this software control reset is used, the hardware reset (menu accessible via the push bottom onto the InduBox GSM VIII PCB) must be disabled by selecting 0 as 'Reset period time'. 10.1 SMS configuration Note: Each line must be terminated with a <CR><LF>, also the last () line Each character is case sensitive. Number = telephone number for Responds SMS Message: InduBox Reset Time : 12:34 Enabled : true Number : +32495123456 Responds: InduBox response Response : Resettime(12:34, true) 10.2 AT commands AT/RESETTIME= 12:34 AT/RESETTIMEON AT/RESETTOMEOFF [HH:MM] 2012 / 07 / 17 18
11. DOTA upgrade DOTA upgrade is done via FTP. A SMS with the following content must be sent to the modem; InduBox FTP upgreade FTP : 213.219.182.110:21 User : username Pwd : password File : filename.dwl Size : 104500 Key : xxyyzz should match the saved DOTA password After receiving the SMS the modem will try to make a connection to a FTP server:port. When in CSD mode: nothing will be done (no GPRS parameters) GPRS mode: the modem will do a GPRS attach, APN connection, SCKdual mode: stop socket listen service, the modem was already connected to GPRS, APN, SCKserv mode: stop socket listen service, the modem was already connected to GPRS, APN, SCKclient mode:stop socket client service, the modem was already connected to GPRS, APN, The received Key should match the locally saved Dota password, if OK download will start. After downloading the file, the size will be verified. If not equal The upgrade process stops and the modem will restart as nothing has happened. If equal The new OpenAT application will be loaded and the modem will restart. 2012 / 07 / 17 19