This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Linking Multiple LM's
#20
Hi,

I've been testing this code using one LM as broker+publisher and a second one as publisher.
I realized that when rebooting the LM that is not the broker, it can't reconnect until I disable and enable the script...


This is the log:

* arg: 1
  * string: mqtt disconnect
* arg: 2
  * bool: false
* arg: 3
  * number: 14
* arg: 4
  * string: unexpected disconnect
* arg: 5
  * nil

I've added the line "broker = nil" here and now it's working, but i'm not sure that it is the best way to solve it...


Code:
  mclient.ON_DISCONNECT = function(...)
    log('mqtt disconnect', ...)
    mclientfd = nil
    broker = nil
  end

Is it correct?
Thanks!
Reply


Messages In This Thread
Linking Multiple LM's - by sjfp - 05.05.2020, 18:30
RE: Linking Multiple LM's - by Daniel - 06.05.2020, 10:49
RE: Linking Multiple LM's - by sjfp - 06.05.2020, 13:43
RE: Linking Multiple LM's - by sjfp - 11.05.2020, 10:15
RE: Linking Multiple LM's - by Daniel - 11.05.2020, 10:23
RE: Linking Multiple LM's - by sjfp - 11.05.2020, 11:01
RE: Linking Multiple LM's - by Daniel - 11.05.2020, 12:41
RE: Linking Multiple LM's - by sjfp - 11.05.2020, 13:44
RE: Linking Multiple LM's - by Daniel - 11.05.2020, 13:50
RE: Linking Multiple LM's - by admin - 11.05.2020, 13:51
RE: Linking Multiple LM's - by sjfp - 11.05.2020, 15:20
RE: Linking Multiple LM's - by sjfp - 13.05.2020, 09:06
RE: Linking Multiple LM's - by Daniel - 13.05.2020, 09:28
RE: Linking Multiple LM's - by Daniel - 13.05.2020, 13:57
RE: Linking Multiple LM's - by Daniel - 16.05.2020, 16:16
RE: Linking Multiple LM's - by admin - 19.05.2020, 09:17
RE: Linking Multiple LM's - by jmir - 13.08.2021, 16:11

Forum Jump: