Skip to content

NodeMCU won't connect to MQTT "Broker" #22

@eayoungs

Description

@eayoungs

Setup:

Client

  • NodeMCU Board
  • TSL2591 sensor: Adafruit

Broker

  • Lenovo ThinkPad X61 ~2006
  • Ubuntu 14.04 LTS
  • Mosquitto: MQTT v3.1

When I connect to the network, using mpfshell, I get the following response:
"Wifi connect successful, network config: ('192.168.43.87', '255.255.255.0', '192.168.43.1', '192.168.43.1')"

I check that port 1883 is open with this command:
netstat -ntlp | grep 1883
...and I get this response:
tcp 0 0 0.0.0.0:1883 0.0.0.0: LISTEN -
tcp6 0 0 :::1883 :::* LISTEN -*

I check the mosquitto MQTT broker (my X61 Thinkpad) with two terminals as described on Read the Docs and get the response, as expected.

When I try to connect to the the Broker, with this command:
m = MQTTWriter('esp8266', 'IP_VERIFIED_WITH-WHAT_IS_MY_IP', 1883, 'sensor-data')

I get the following response.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "mqtt_writer.py", line 13, in __init__
  File "mqtt_writer.py", line 17, in _connect
  File "umqtt/simple.py", line 56, in connect
OSError: [Errno 103] ECONNABORTED

I've tried different networks, making sure each time that both devices are on the same network. I've searched the web for the error but can't find any help online.

I'm so close and I have so many projects that I want to use this with. Any advice would be greatly appreciated!

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions