AT+MQTTPUB:以字符串形式发布 MQTT 消息

Moderator: ESP_XCGuang

fst202130609
Posts: 171
Joined: Thu Sep 23, 2021 10:03 am

AT+MQTTPUB:以字符串形式发布 MQTT 消息

Postby fst202130609 » Tue Mar 08, 2022 5:40 am

AT+MQTTPUB=0,"maxisense_1/send","\"{\"Power\":\"ON\"}\"",0,0

OK
AT+MQTTPUB=0,"maxisense_1/send","\"{\"Power\":\"On\",\"Message\":\"\"}\"",0,0

ERROR

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: AT+MQTTPUB:以字符串形式发布 MQTT 消息

Postby ESP_Sun » Tue Mar 08, 2022 7:10 am

这是因为特殊字符在 AT 命令中需要转移,逗号也是特殊字符的,你的逗号没有进行转义。
企业微信截图_164672327363.png
企业微信截图_164672327363.png (10.59 KiB) Viewed 3690 times

Who is online

Users browsing this forum: No registered users and 17 guests