Testers invited to try out new version of the MQTT blocks

I maintain the MQTT library extension and I've made a few changes in my dev enviroment

  1. If you publish a list to a topic- it is sent to the broker as JSON (always has been). But now , if you subscribe to the same topic , the extension detects that the payload is JSON and automatically converts it back to a Snap! list

  2. In current version, you can set subscribe option 1 to true and the payload will be returned as binary byte data but presented as a text string. But now, if you set option 1 to true, it will be returned as a list of values in the range 0-255

  3. Publish has a 3rd option - if set to true, then the payload should be a single column list of values in range or 0-255 (i.e. byte values) and will be sent as a buffer instead of a text string. This then matches up with point 2 above

My test site is at
https://cymplecy.gitlab.io/Snap/snap.html
It doesn't have access to the Snap! cloud so any projects will have to be saved/loaded from your own computer/network

Ad.1 I've got the same results (a list)
untitled script pic - 2023-10-17T013410.938
untitled script pic - 2023-10-17T013404.758

So it works as intended.

2,3 is unclear.
I've got the byte array without any extra parameters
untitled script pic - 2023-10-17T021847.660

Thanks for testing :slight_smile:

The buffer option sets whether the payload list is published as JSON or as a series of bytes

So this
mqttTutorial script pic (1)

ends up as JSON, length 73

whereas this
mqttTutorial script pic (3)

ends up on the broker as just 10 bytes

Node-RED used to show the difference