WeMos D1 mini w/espeasy but no MQTT

#1

I have a Wemos D1 mini with a DHT22 shield all setup with espeasy and I'm reading temperature/humidy in the wemos but can't get it to connect with my mosquitto broker. I have an MQTT node working in node-red and mosquitto debug indicates it's connected.
I am at a loss as to why the WeMos D1 won't connect.


image

0 Likes

#2

Port 1889? is it right? Generally it is 1883.

0 Likes

#3
  1. as @cflurin said port is 1883 unless you have MQTT set for another port
  2. espeasy has a slash at the controller subscribe and publish - delete them to be consistant with the way everything else uses MQTT
  3. make sure tthat you have checked off the Enabled box
0 Likes

#4

MQTT broker is installed l on Raspberry, Windows,...?

0 Likes

#5

Mosquitto is installed on a Raspberry Pi3.
I've reset the port to 1883 and have tested it in node-red. My "hello world" publish and client are working fine in a node-red flow so I know Mosquitto is working. The issue is with the WeMos D1 mini, I'm sure.

0 Likes

#6

I did change the port to 1889 just to see what would change. I've reset it to 1883.
The enable box is checked.
The "/controller/subscribe/publish" thing is a mystery to me. I think it should be "/irrigation_141/DHT22/TempDHT" but since I've not been able to get it to work I'm in the dark.

Is there a way to query Mosquitto as to who's connected?

0 Likes

#7

I am on Windows where firewall blocking port 1883 (default) .
Same situation as yours, when pub/sub on notebook everything is ok, but from wemos not working (of course wemos and notebook are on same lan).
After change firewall rules, wemos mqtt messages are OK.

Can you see what is on wemos serial? Mqtt connect or not?

0 Likes

#8

This is what the setup looks like on my mqtt controller in ESPeasy.
I use the OpenHab protocol as that option seems to work fine with Mosquitto in NR.
I haven't bothered to remove the leading "slash" (like Paul suggested).
When I've got nothing to do on a rainy day, I'll go through all 30-odd Wemos units and remove the slash.

0 Likes

#9

On your Rpi in a console type:

sudo lsof -i TCP:1883
0 Likes

#10

Not sure how to do that.

0 Likes

#11

lsof command not found. I'm using Raspbain Stretch.

0 Likes

#12

Except for the ip address I have the same setup.
I'm wondering what Controller lwl topic is.

Where do I locate sysname, tskname and valname? I think I have them but since it's not working I'm not sure.

0 Likes

#13

first try:

sudo netstat | grep :1883

or install lsof:

sudo apt-get install lsof
0 Likes

#14

The mosquitto broker (192.168.1.140) is there on port 1883 but no sign of WeMos (192.168.1.141).
That's crazy since I can login to espeasy and set parameters.

0 Likes

#15

Ok, so you know mosquitto is running on port 1883!

0 Likes

#16

ScreenShot004 ScreenShot005 ScreenShot006

Here are some screenshots of MQTT in Node-RED that might help getting the settings correct.

0 Likes

#17

I installed lsof:
pi@raspberrypi:~ $ sudo lsof -i TCP:1883
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node-red 296 pi 12u IPv4 13164 0t0 TCP raspberrypi.sugarloaf.local:45334->raspberrypi.sugarloaf.local:1883 (ESTABLISHED)
mosquitto 415 mosquitto 4u IPv4 12568 0t0 TCP *:1883 (LISTEN)
mosquitto 415 mosquitto 5u IPv6 12569 0t0 TCP *:1883 (LISTEN)
mosquitto 415 mosquitto 7u IPv4 13165 0t0 TCP raspberrypi.sugarloaf.local:1883->raspberrypi.sugarloaf.local:45334 (ESTABLISHED)

0 Likes

#18

ok, so you should check your mqtt setting on the espeasy again:

sudo netstat | grep :1883

should list the wemos ip

0 Likes

#19

You could also try stopping Node-RED from a terminal window.
node-red-stop
And then restart it with... node-red-start
On my system it shows when a connection is made to the MQTT broker.

0 Likes

#20

Still not there. I only get the mosquitto broker ip.

0 Likes