Closed piebat closed 6 years ago
It works fine - but the documentation seems to be outdated. Try this:
client = mqtt.client("testclient","iot.eclipse.org", 1883, false, "", true, "var/mqtt")
client:connect("","")
client:publish("testclient","mytopic",mqtt.QOS1)
Line 1 creates a mqtt client with no security, but with persistence. The parameters are as follows:
After you have connected to the broker you can use QOS1 or QOS2 as well.
@bytebang,
Thanks for the documentation issue. It has been updated.
@bytebang Thanks Ghunter, work fine.
MQTT publish with QoS > 0 seems doesn't work. I tried to publish the message with QoS = 1 and 2, but this message raise:
I couldn't find documentation about how to change the persistence and seems that default is: MQTTCLIENT_PERSISTENCE_NONE instead than MQTTCLIENT_PERSISTENCE_DEFAULT.
The environment is: Lua RTOS beta 0.1. build 1523007799 commit 5d9b98a49aeb0a799c3949ba9bf904f591963756 Running from factory partition board type ESP32COREBOARD cpu ESP32 rev 1 at 240 Mhz spiffs0 start address at 0x310000, size 512 Kb, partition spiffs spiffs0 mounted
With QOS0 work fine.