nodemcu-firmware/app/modules
Caleb Mingle e547c2a094 mqtt: fix connfail callback
I've not been able to get the mqtt `connfail` callback to work.

I'm consistently receiving `method not supported` errors:
```
application.lua:53: method not supported
stack traceback:
        [C]: in function 'on'
        application.lua:53: in main chunk
        [C]: in function 'dofile'
        init.lua:18: in function <init.lua:6>
```

Example code:
```
function on_connection_failed(client, reason)
    print("mqtt connection failed: " .. reason)
end

m:on("connfail", on_connection_failed)
```

I believed this to be caused by the incorrect length comparison for `connfail`
that is updated here.

Once I changed that, the error went away, however the callback was never called.

I believe the callback was never called because of an incorrect assignment.

However, I saw this somewhat confusing description in the docs so this
assignment may be expected?
> The second (failure) callback aliases with the "connfail" callback available through :on(). (The "offline" callback is only called after an already established connection becomes closed. If the connect() call fails to establish a connection, the callback passed to :connect() is called and nothing else.)
2020-08-11 17:20:17 +01:00
..
enduser_setup HTML for Apple devices to mitigate POST fragmentation (#3069) 2020-06-09 22:26:52 +02:00
.gitignore Adds support for verifying the certificate offered by an SSL server. 2016-03-09 21:51:23 -05:00
Makefile Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
adc.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
ads1115.c ads1115 minor cleanup 2020-06-17 23:50:31 +01:00
adxl345.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
am2320.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
apa102.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
bit.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
bloom.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
bme280.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
bme680.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
bme680_defs.h Update sensor driver for BME680 to 3.5.9 (#2969) 2020-06-09 22:26:06 +02:00
bmp085.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
coap.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
color_utils.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
color_utils.h Major cleanup - c_whatever is finally history. (#2838) 2019-07-22 00:58:21 +03:00
cron.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
crypto.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
dcc.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
dht.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
encoder.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
enduser_setup.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
file.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
gdbstub.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
gpio.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
gpio_pulse.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
hdc1080.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
hmc5883l.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
http.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
hx711.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
i2c.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
l3g4200d.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
mcp4725.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
mdns.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
mqtt.c mqtt: fix connfail callback 2020-08-11 17:20:17 +01:00
net.c net_info module - ping function (#2854) 2020-06-09 22:26:52 +02:00
net_ping.c net_info module - ping function (#2854) 2020-06-09 22:26:52 +02:00
net_ping.h net_info module - ping function (#2854) 2020-06-09 22:26:52 +02:00
node.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
ow.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
pcm.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
perf.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
pipe.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
pwm.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
pwm2.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
rfswitch.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
rotary.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
rtcfifo.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
rtcmem.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
rtctime.c Add support to set the clock rate and have sntp use it. (#3236) 2020-08-08 13:32:14 +02:00
si7021.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
sigma_delta.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
sjson.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
sntp.c Add support to set the clock rate and have sntp use it. (#3236) 2020-08-08 13:32:14 +02:00
softuart.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
somfy.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
spi.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
struct.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
switec.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
tcs34725.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
tls.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
tm1829.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
tmr.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
tsl2561.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
u8g2.c u8g2: Fix name of updateDisplay export (#3093) 2020-06-09 22:26:52 +02:00
uart.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
ucg.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
websocket.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
wifi.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
wifi_common.c Major cleanup - c_whatever is finally history. (#2838) 2019-07-22 00:58:21 +03:00
wifi_common.h Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
wifi_eventmon.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
wifi_monitor.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
wps.c Implement panic call handling for all modules (#3163) 2020-06-16 08:19:55 +01:00
ws2801.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00
ws2812.c fix a memory leak in ws2812_buffer_shift by freeing the same amount of bytes we allocated before 2020-06-12 18:23:36 +01:00
ws2812.h Fixes for `ws2812` and `ws2812_effects` (#2953) 2020-06-09 22:26:06 +02:00
ws2812_effects.c ws2812_effects deprecation warning 2020-06-09 22:26:52 +02:00
xpt2046.c Squashed updates do get Lua51 and Lua53 working (#3075) 2020-06-09 22:26:52 +02:00