Suchen Sie etwas anderes?
Scenario details:
- We have a device that sends bytes of data, which correspond to a sensor’s readings, via its serial port every 10 seconds. The data will be a maximum of 256 bytes
- Taking readings every 10 seconds can be excessive for the application. MTX must only take one reading every minute (therefore eliminating 5 every minute), and send it to the web platform
- The modem must send the serial data that is collected to a Web platform via a JSON object. A timestamp should be attached
- The serial port configuration is 115200bps, 8 data bits, 1 stop bit and no parity
Solution: MTX-Tunnel firmware + MTX-Java-IoT/MTX-Java-T/MTX-Java-T2
EXAMPLE of settings (file config.txt) for this scenario:
Configuration | Observations |
COMM_baudrate: 115200 COMM_bitsperchar: 8 COMM_autocts: off COMM_autorts: off COMM_stopbits: 1 COMM_parity: none GPRS_apn: movistar.es GPRS_login: MOVISTAR GPRS_password: MOVISTAR GPRS_timeout: 0 MTX_PIN: 0000 MTX_mode: server MTX_model: MTX-4G-JAVA-IOT-STD-N MTX_TPServer: es.pool.ntp.org MTX_TPServer2: 2.europe.pool.ntp.org MTX_TPProtocol: ntp MTX_ping: 35 MTX_pingIP: 8.8.8.8 MTX_ATEmbedded: on MTX_urc: off MTX_ATLimited: off TELNET_enabled: on TELNET_login: user TELNET_password: 1234 TELNET_firewall: off TELNET_port:20023 SMS_allPhones: on SMS_ATEnabled: on SMS_ATResponse: on LOGGER_enabled: on LOGGER_password: ID-12345678 LOGGER_server: 90.166.108.200/json/set.asp?data= LOGGER_registerSize: 600 LOGGER_numRegistersFlash: 200 LOGGER_numRegistersRam: 3 LOGGER_serialFrequency: 6 LOGGER_serverLogin: user LOGGER_serverPassword: 1234 LOGGER_ httpMode: getjson |
Serial port baud rate 8 bit data No flow control No flow control 1 stop bit No parity GPRS APN by the GSM operator GPRS Login GPRS Password MTX-Tunnel is always GPRS connected If SIM card has no PIN security, use 0000 value GPRS/serial gateway in server mode MTX-Terminal modem model used Time server (the MTX must synchronize the time) Backup time server NTP protocol used Ping every 35 minutes without comms IP address to ping To send AT commands from Web platform We don’t need URC info messages To execute any AT command To send remote commands, etc. Telnet Login Telnet Password MTX accepts connections from all IPs Telnet port All phone numbers are authorized AT commands can be sent via SMS SMS replies to AT commands Logger activated Password to be sent to the Web platform Web platform address Size of the record Number of records in flash storage Number of records in RAM memory 1 of 6 pieces of data received is logged Username of the Webserver Password of the Webserver Mode HTTP GET (JSON) |
Details:
- The JSON object received by the server will have the following format:
{“IMEI”:353234028104337,”TS”:”08/06/14 13:39:33”,”P”:”ID-12345678”,”TYPE”:”SERIAL”,”SER”:”313233343536373839300d0a”}
Where:
IMEI | is the modem’s IMEI |
TS | is the Timestamp (the date/time of the modem) |
P | The password of the user |
TYPE | JSON type |
SER | The serial data in hexadecimal format (2 digits per byte) |
This means that for every string logged by MTX-Tunnel, a JSON object will be sent via GPRS or 3G (depending on the model of the modem) in its previous format (received by HTTP GET in the “data” variable, as can be seen in the LOGGER_server parameter).