Im using a BG96 modem to connect to AWS iot over MQTT.
I'm trying to set my MQTT Last Will and Testament with the following AT-command:
+QMTCFG:"will",(0-5),(0,1),(0-2),(0,1),"willtopic","willmessage"
Which works great.
But now I'm trying to add a JSON formatted string to "willmessage"
, so I need to add ""
(double quotes) in there, which means I need to escape them in my command. But I have no clue if I can escape them or what the escape character is.
Things I tried: \"
(backslash) and ""
(double double quotes)
I looked in all of the BG96 datasheets, and I don't see it mentioned anywhere.
Some special characters have different values between the ASCII character set and the GSM character set.
i.e.
\
= 0x5C.Ö
= 0x5C.Beyond this point, some special characters must be entered using a specific way, such as a 2-byte representation. I suggest you check the standard/version of AT commands implemented on your hardware (i.e. GSM 07.07, GSM 07.05, manufacturer specific set...).
i.e. I'm using a GPS+GPRS modem from Ai-Thinker called A9G. In this one, to use the AT+MQTTPUB command with data formatted in JSON style, I need to append
\x5c\x32\x32
. So the module will interpret this as\22
and the server as\"
.i.g.
at the cloud it will be: