This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
sdk:mqtt_simple_status [2018/08/07 15:45] preisig created |
sdk:mqtt_simple_status [2018/08/08 13:57] preisig [Script Summary] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Send Router Status Informations to an MQTT Broker ====== | ====== Send Router Status Informations to an MQTT Broker ====== | ||
+ | |||
+ | ===== Script Summary ===== | ||
+ | |||
+ | This script reads some defined values from the router via the nb_status() function. For a demo purpose the routers temperature, the service type and signal level from the modem as well as gps longitude and latitude get queried. Then nb_mqtt_publish() is used to publish the message to a given topic on the specified mqtt broker (see variables at the beginning of the script). Interessting setttings are QOS and RETAIN. | ||
+ | |||
+ | If you are interessted in other status values, please refer to the API manual and read about the nb_status() function. You can use dump() to get all the fields (ex: GNSS1_LATITUDE) of the struct returned by nb_status. | ||
+ | |||
+ | With default settings the script publishes 10 mqtt messages to a given topic and waits 60 secs between every new status query and message publish. | ||
+ | |||
+ | |||
+ | |||
<code c mqtt_simple_status.are> | <code c mqtt_simple_status.are> | ||
/* DESC: This script will publish router status informations to | /* DESC: This script will publish router status informations to |