I must have done something to my system about three weeks ago because I can no longer get any of my WeMos devices, with ESPEasy installed, to connect to a MQTT broker running on a Pi.
the broker is fine since NR on a Pi can use it to talk to my Mac or other Pi's
A WeMos with an arduino sketch can use it to talk to my Mac or other Pi's
But that same WeMos flashed with ESPEasy won't connect giving
12723098: MQTT : Intentional reconnect
12723430: MQTT : Failed to connect to broker
However, that same WeMos can connect and use an external broker (BeeBotte in this case).
I remembered flashing my Airport router with new firmware, so I reflashed it and rebooted - no change
I removed the Airport router and replaced it with a brand new TP-Link AC1750 router - no change
Any ideas on what I can look for to resolve this - AND I'm sure it is gong to be something simple and stupid, but I haven't been able to figure it out. Thanks in advance.
Have a look in the mosquito log in case anything useful there.
Have you specified an IP address for the pi in the devices? If so check the address has not changed in the pi.
@colin - I think you have given me a clue. In the mosquitto log I see
1565375291: New connection from 192.168.48.42 on port 1883.
1565375291: Socket error on client <unknown>, disconnecting.
1565375321: New connection from 192.168.48.29 on port 1883.
1565375321: Socket error on client <unknown>, disconnecting.
1565375351: New connection from 192.168.48.23 on port 1883.
1565375351: Socket error on client <unknown>, disconnecting.
All of the WeMos devices are failing with this.
Now to figure out why....(thoughts and suggestions welcome)
I've been emailing with @dynamicdave and he shared his mosquitto config file. With that it started working.
I seem to remember updating mosquitto and rebuilding the config file and must have left someting out and I think it is the allow_anonymous true option.
I'm going to test that and will report back.
@Colin the only thing that had an issue was ESPEasy devices. Everything else used the broker with no problem. Even an arduino sketch worked, but I just looked and it is setup to use an mqtt user and password
@TotallyInformation you're right and I probably should do that, but I have it working again and you must realize it has been (dare I say) three weeks, three weeks, that I haven't been able to grab my phone when I wake up and turn the coffee pot on!! I've had to walk down stairs and manually flip the switch!!
I shall give it a day or two before I attempt to impliment a seperate user ID/password
I believe that allow_anonymous specifies whether to allow connection without user/pwd rather than being to do with client id. I don't see that there is any good reason to require user/pwd on a closed local system.
I am surprised that ESPEasy doesn't generate default client IDs. I use Tasmotta and if an ID is not defined for a device then it autogenerates one based on MAC address or something.