MQTT(No Security) – Without Checking UTF8 Coding
MQTT (Message Queuing Telemetry Transport) is a lightweight broker-based publish/subscribe messaging protocol.
It is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol.
It was designed as an extremely lightweight publish/subscribe messaging transport.
It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.
1. 통신시스템: MQTT(No Security) – Without Checking UTF8 Coding
2. 명령시퀀스: MQTT(No Security) – Without Checking UTF8 Coding
No | Command | Response | Description |
1 | PDP Context 설정 | ||
2 | AT+CMQTTSTART |
+CMQTTSTART: 0 OK |
Start MQTT service, activate PDP context |
3 | AT+CMQTTACCQ=0, “client test0” | OK |
Acquire one client which will connect to a MQTT server without SSL/TLS. |
4 | AT+CMQTTCFG=”checkUTF8″,0,0 | OK | Set the topic of the will |
5 |
AT+CMQTTCONNECT=0, “tcp://test.mosquitto.org:1883”,60,1 |
OK +CMQTTCONNECT: 0,0 |
Connect to a MQTT server |
6.1 | AT+CMQTTSUB=0,9,1 | > |
Subscribe one topic which is not UTF8 coding. The data can input by hexadecimal fo |
6.2 | >Hi,모모 |
OK +CMQTTSUB: 0,0 |
Input topic to subscribe |
7.1 | AT+CMQTTTOPIC=0,10 | > | Set the topic for the PUBLISH message |
7.2 | >Hi,모모 | OK | Input topic to publish |
– | AT+CMQTTPAYLOAD=0,9 | > | 메시지 설정 |
– | >Hi,안녕 | 메시지 입력 | |
8 | AT+CMQTTPUB=0,1,60 |
+CMQTTRXSTART: 0,9,9 +CMQTTRXTOPIC: 0,9 Hi,모모 +CMQTTRXPAYLOAD: 0,9 Hi,안녕 +CMQTTRXEND: 0 +CMQTTPUB: 0,0 |
PUBLISH message
파랑색은 메시지를 설정한 경우로 자신이 발송한 메시지를 자신이 수신한 것임. |
9 | AT+CMQTTDISC=0,120 |
OK +CMQTTDISC: 0,0 |
Disconnect from server |
10 | AT+CMQTTREL=0 | OK | Release the client |
11 | AT+CMQTTSTOP |
+CMQTTSTOP: 0 OK +CMQTTNONET |
Stop MQTT Service |