This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
app-notes:ein-mqtt-server-fuer-iot-telemetry-sensoren [2024/03/21 14:00] gray [2.1 Collect telemetry data with the help of SDK scripts] |
app-notes:ein-mqtt-server-fuer-iot-telemetry-sensoren [2024/03/21 14:40] (current) gray [2.1 Collect telemetry data with the help of SDK scripts] |
||
---|---|---|---|
Line 66: | Line 66: | ||
if(DEBUG) printf("%s\n", MESSAGE); | if(DEBUG) printf("%s\n", MESSAGE); | ||
/* publish the message to mqtt broker Temperature */ | /* publish the message to mqtt broker Temperature */ | ||
- | ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE); | + | ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE);; |
- | nb_mqttlib_get_callback_publish(MQTT_HANDLE_DD, 5000); | + | |
if (ret<0){ | if (ret<0){ | ||
nb_syslog("Failed to publish mqtt message"); | nb_syslog("Failed to publish mqtt message"); | ||
Line 76: | Line 75: | ||
/* publish the message to mqtt broker Humidity */ | /* publish the message to mqtt broker Humidity */ | ||
ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE2); | ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE2); | ||
- | nb_mqttlib_get_callback_publish(MQTT_HANDLE_DD, 5000); | ||
if (ret<0){ | if (ret<0){ | ||
nb_syslog("Failed to publish mqtt message"); | nb_syslog("Failed to publish mqtt message"); | ||
Line 85: | Line 83: | ||
/* publish the message to mqtt broker DevicePower */ | /* publish the message to mqtt broker DevicePower */ | ||
ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE3); | ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE3); | ||
- | nb_mqttlib_get_callback_publish(MQTT_HANDLE_DD, 5000); | ||
if (ret<0){ | if (ret<0){ | ||
nb_syslog("Failed to publish mqtt message"); | nb_syslog("Failed to publish mqtt message"); | ||
Line 93: | Line 90: | ||
if(DEBUG) printf("%s\n", MESSAGE4); | if(DEBUG) printf("%s\n", MESSAGE4); | ||
/* publish the message to mqtt broker Sys */ | /* publish the message to mqtt broker Sys */ | ||
- | ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE4); | + | ret = nb_mqtt_publish(HOST, PORT, USERNAME, PASSWORD, TOPIC, QOS, RETAIN, MESSAGE4); |
- | nb_mqttlib_get_callback_publish(MQTT_HANDLE_DD, 5000); | + | |
if (ret<0){ | if (ret<0){ | ||
nb_syslog("Failed to publish mqtt message"); | nb_syslog("Failed to publish mqtt message"); |