(03.12.2018, 08:43)admin Wrote: Upgrade firmware to 2018 RC1. It has built-in MQTT library support and some other features required for this script.
Create resident script with 0 sleep interval. Change broker IP address and mapping tables as needed.
mqtt_to_object maps topic to a group address, object_to_mqtt maps group address to atopic.
Do full script restart via disable/enable when changing any mapping tables and/or broker address.
I'm trying to do this but it doesn't works. I supose that when I send a value to the broker, automatically the script must receive the value?
I've just upgrade the firmware. Here's the actual version:
Here's my code where I put the mosquitto test broker and the topic "arqueta/humedad" I'm testing. the object 32/1/1 is a "05. 1 byte unsigned integer".
As I say, it doesn't works and I don't know what I'm doing wroing.
The correct line to broker is without "http://"
broker = 'test.mosquitto.org'
Now it works the suscribe.