
MQTT publish/suscript from Script
Script programming can be used to get data from subscribed topics of publish extra topics.
Please go to the script programming manual for more information.
Script - Suscription
You can subscribe to up to 10 topics
The use read_io 1000 to get the messages on the script
read_io 1000,b,0;
b
how may messages are queued waiting to be read
To get the first message in the queue use read_str 1000
read_str 1000,c,z;
z
message text
Script - Publish
You public message straight from the script code
Go to the script programming manual for more information.
Before publishing it's suggest it to check if the broker connection is established
read_io 1001,h,0;
h
=1 connection established
Then set the topic to publish
write_str 1001,'v1/devices/me/telemetry';
And finally set the payload. This operation will also publish the message.
write_str 1002,'{A1:52}';
GRD-MQ User Manual
Scripts - Publish/Subscribe
72 / 84
Содержание GRD-MQ Series
Страница 26: ...Analog inputs GRD MQ User Manual Physical Inputs Outputs 25 84 ...
Страница 33: ...2020 09 28 GRD MQ User Manual Features of power supply and inputs outputs 32 84 ...
Страница 74: ...2020 11 20 GRD MQ User Manual Scripts Publish Subscribe 73 84 ...
Страница 76: ...Wiring Terminal Blocks 2020 10 05 GRD MQ User Manual GRD1620 MQ 3G 75 84 ...
Страница 79: ...2020 10 05 GRD MQ User Manual GRD3621 MQ 3G 78 84 ...
Страница 83: ...Wiring Terminal Blocks 2020 10 05 GRD MQ User Manual GRD3534 MQ 3G 82 84 ...