Post your best Lua script examples here

User avatar
By Suxsem
#8596
tuanpm wrote:fixed

I'm having problems with SSL connection...

i configured my MQTT broker to accept any connections and i can connect to it with something like
Code: Select allmosquitto_sub.exe -h 192.168.1.50 -p 8883 --cafile ca.crt --insecure -t test


but if i try to connect to the broker from nodemcu (with secure enabled)
Code: Select allm:connect("192.168.1.50", 8883, 1)

the esp8266 reboots without errors

all fine without secure connection.

1) Do I have to put ca.crt somewhere on the esp8266?
2) I'm using 1024bit key...it's too much for the esp8266? edit: i tried with 512bit key...same result
User avatar
By sfinx
#9044
axelk wrote:
I guess what we really need here is
1. some kind of queue in C, using less RAM
2. a more peaceful result of mqtt.publish(), e.g. false/true instead of raising a fatal error

Any news on this publish queue? Or has anyone made a working queue implementation in lua?
User avatar
By tuanpm
#9046
sfinx wrote:
axelk wrote:
I guess what we really need here is
1. some kind of queue in C, using less RAM
2. a more peaceful result of mqtt.publish(), e.g. false/true instead of raising a fatal error

Any news on this publish queue? Or has anyone made a working queue implementation in lua?

Please try this: https://github.com/tuanpmt/lua-async ,
I've written this lib to make async process easier, now only waterfall function, you can publish another msg by callback after send msg.
Queue need a lot of RAM, not comfortable for LUA module