Page 1 of 1

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

Posted: Tue Mar 08, 2022 5:40 am
by fst202130609
AT+MQTTPUB=0,"maxisense_1/send","\"{\"Power\":\"ON\"}\"",0,0

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

ERROR

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

Posted: Tue Mar 08, 2022 7:10 am
by ESP_Sun
这是因为特殊字符在 AT 命令中需要转移,逗号也是特殊字符的,你的逗号没有进行转义。
企业微信截图_164672327363.png
企业微信截图_164672327363.png (10.59 KiB) Viewed 3673 times