I’ve mos config-set debug.level=3
followed by mos console
, and in the mDash UI, set the mqtt1.pass
to 1&2
. I can see that the UI sends the data as expected:
However, in the device console logs, I see this:
[May 20 16:16:46.917] mg_rpc.c:482 0x3fff0ff4 GOT FRAME (96): {"id":4,"method":"Config.Set","params":{"config":{"mqtt1":{"pass":"1\u00262"}}},"src":"$sys/d7"}
Notice the "params":{"config":{"mqtt1":{"pass":"1\u00262"}}},
. The ampersand was marshalled by mDash into \u0026
, and that is the reason why the parser on the device side gets confused. The parser is https://github.com/cesanta/frozen, which croaks on the \u… escapes:
Thus, the solution is either to make frozen recognise at least simple one-byte unicode escapes, or to make the mDash not escaping ASCII range.
Let me follow up further on that.
For now, you can use the mos
command line tool to set the field value:
mos --port wss://YOUR_API_KEY@mdash.net/api/v2/devices/YOUR_DEVICE_ID/rpc config-set mqtt.pass=...