Tunnel – Data transmission by RS232 via SMS for the control of electronic equipment with proprietary protocols. Use of ALIAS to send nonprintable characters

Scenario details:

  • It is necessary to send a series of commands by SMS to an electronic team, so that it executes actions
  • The communication with the electronic equipment is through a proprietary binary protocol and is done through an RS232 port at 9600.8, n, 1. Therefore, it is necessary to implement an SMS-RS232 gateway
  • The user needs to be able to send two types of messages by SMS. The message “OPEN” sends via serial port of the modem to the electronic equipment the data frame {0x01} {0x02} OPE1 {0x03}. The message “CLOSE” causes the sending by the serial port of the modem to the electronic equipment the data frame {0x01} [0x02} OPE2 {0x03}. Where 0x01, 0x02 and 0x03 are binary characters (not printable), while OPE1 and OPE2 are alphanumeric characters

Solution: MTX-Tunnel firmware + MTX-Java-IoT/MTX-Java-T/MTX-Java-T2 EXAMPLE of configuration (config.txt file) for the indicated scenario. Solution for quick communication via Socket TCP:

Configuration Observations
COMM_baudrate: 9600
COMM_bitsperchar: 8
COMM_autorts: off
COMM_autocts: off
COMM_stopbits: 1
COMM_parity: none
SMS_allPhones: on
SMS_sendIP: on
SMS_ATEnabled: on
SMS_ATResponse: on
MTX_PIN: 0000
MTX_mode: none
MTX_model: 199801145
SMS_alias1: OPEN>AT^MTXTUNNEL=RS232,0,<HEX>0102</HEX>OPE1<HEX>03</HEX>
SMS_alias2: CLOSE>AT^MTXTUNNEL=RS232,0,<HEX>0102</HEX>OPE2<HEX>03</HEX>
SMS_aliasResponse: result

Serial port baud rate
8 bit data
No flow control
No flow control
1 stop bit
No parity
Send SMS with commands from any phone
Modem responds IP to a missed call/SMS
Commands can be sent to the MTX by SMS
MTX responds with an SMS to a command SMS
SIM card PIN
Work mode
MTX model
SMS alias
SMS alias
Response isn’t executed AT command

Details:

  • When the modem receives an SMS message with the text “OPEN” the modem will send by its serial port the bytes 0x01 0x02 followed by the alphanumeric text OPE1 and ending with the 0x03 byte
  • It is possible to put multiple sections with the <HEX> </ HEX> tags. Among them, all hexadecimal values must have 2 digits. That is, the value “1” should be written as “01”