Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOT2050 - Node-red to Adafruit (MQQT not connecting) #527

Open
davidstuart97 opened this issue Mar 1, 2024 · 5 comments
Open

IOT2050 - Node-red to Adafruit (MQQT not connecting) #527

davidstuart97 opened this issue Mar 1, 2024 · 5 comments

Comments

@davidstuart97
Copy link

Hi,

I'm in need of assistance in resolving why I can't connect to Adafruit through Node-RED. I've successfully connected to Adafruit using the same flows on Node-RED from another computer.

On my IOT2050 device:

Node-RED is operational, successfully retrieving data from a PLC.
Mosquitto: I've added a listener and checked its status, which seems okay.
However, I keep encountering this error message: '26 Feb 18:15:29 - [info] [mqtt-broker:Adafruit] Connection failed to broker: mqtt://io.adafruit.com:1883'

The password and username for Adafruit is correct as used on another computer.

What could I be missing?

@jan-kiszka
Copy link
Collaborator

Can you do telnet io.adafruit.com 1883 on the IOT2050, i.e. reach that broker at all via its Internet connection?

@davidstuart97
Copy link
Author

I've tried this:-
2 Mar 10:37:27 - [info] [mqtt-broker:Adafruit] Connection failed to broker: mqtt://io.adafruit.com:1883
2 Mar 10:37:42 - [info] [mqtt-broker:Adafruit] Connection failed to broker: mqtt://io.adafruit.com:1883
^C2 Mar 10:37:43 - [info] Stopping flows
2 Mar 10:37:43 - [info] Stopped flows
root@iot2050-dave://# sudo telnet io.adafruit.com1883
sudo: unable to resolve host iot2050-dave: Temporary failure in name resolution
sudo: telnet: command not found
root@iot2050-dave://# ^C
root@iot2050-dave://# sudo apt-get install telnet
sudo: unable to resolve host iot2050-dave: Temporary failure in name resolution
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package telnet
root@iot2050-dave://# root@iot2050-dave://# sudo apt-get install telnet
sudo: unable to resolve host iot2050-dave: Temporary failure in name resolution
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package telnet
root@iot2050-dave://#

@rFond
Copy link

rFond commented Mar 5, 2024

Hello, check your internet connection.
If you use the 2 ethernet port you can check the box "Never use this network for default route" into iot2050setup / Networking / Edit a connection / "your network interface"
Reboot

@davidstuart97
Copy link
Author

Hi rFord,

On initial Setup I changed the network address to give access to the unit. I've managed to connect the unit by using Mobaxterm (like putty) and have established a connection. I also changed the default port address and still I can't seem to connect with Adafruit using Mqqt protcol.

root@iot2050-dave://etc/mosquitto# Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1534 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.173:22 192.168.1.55:60057 ESTABLISHED
tcp 0 0 192.168.1.170:22 192.168.1.55:60050 ESTABLISHED
tcp 0 0 192.168.1.173:22 192.168.1.55:60054 ESTABLISHED
tcp 0 4240 192.168.1.170:22 192.168.1.55:60049 ESTABLISHED
tcp6 0 0 :::22 :::* LISTEN
udp 0 0 0.0.0.0:1534 0.0.0.0:*
raw6 0 0 :::58 :::* 7
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ] DGRAM 1829 /run/user/0/systemd/notify
unix 2 [ ACC ] STREAM LISTENING 1832 /run/user/0/systemd/private
unix 3 [ ] DGRAM 1409 /run/systemd/notify
unix 2 [ ACC ] STREAM LISTENING 1412 /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 1414 /run/systemd/userdb/io.systemd.DynamicUser
unix 2 [ ACC ] STREAM LISTENING 1415 /run/systemd/io.system.ManagedOOM
unix 2 [ ] DGRAM 1419 /run/systemd/journal/syslog
unix 12 [ ] DGRAM 1423 /run/systemd/journal/dev-log
unix 7 [ ] DGRAM 1425 /run/systemd/journal/socket
unix 2 [ ACC ] STREAM LISTENING 1427 /run/systemd/journal/stdout
unix 2 [ ACC ] SEQPACKET LISTENING 1429 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 2302 /run/systemd/journal/io.systemd.journal
unix 2 [ ACC ] STREAM LISTENING 6607 /run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 1532 /run/uuidd/request
unix 3 [ ] STREAM CONNECTED 1834
unix 2 [ ] DGRAM 2391
unix 2 [ ] STREAM CONNECTED 1796
unix 2 [ ] DGRAM 1675
unix 3 [ ] DGRAM 1411
unix 3 [ ] DGRAM 1830
unix 3 [ ] DGRAM 1410
unix 2 [ ] DGRAM 7125
unix 3 [ ] DGRAM 1831
unix 3 [ ] DGRAM 2398
unix 2 [ ] STREAM CONNECTED 8341
unix 3 [ ] STREAM CONNECTED 1453
unix 3 [ ] DGRAM 2397
unix 3 [ ] STREAM CONNECTED 1478 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 2823 /run/dbus/system_bus_socket
unix 2 [ ] DGRAM 1462
unix 3 [ ] DGRAM 1465
unix 3 [ ] STREAM CONNECTED 1541
unix 3 [ ] DGRAM 1466
unix 2 [ ] DGRAM 2307
unix 2 [ ] STREAM CONNECTED 7118
unix 3 [ ] STREAM CONNECTED 6639 /run/dbus/system_bus_socket
unix 3 [ ] DGRAM 2396
unix 3 [ ] STREAM CONNECTED 1545
unix 3 [ ] DGRAM 2395
unix 3 [ ] STREAM CONNECTED 6613 /run/systemd/journal/stdout
unix 2 [ ] DGRAM 2493
unix 3 [ ] STREAM CONNECTED 472
unix 3 [ ] STREAM CONNECTED 6636
unix 3 [ ] STREAM CONNECTED 2377 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 7187 /run/dbus/system_bus_socket

I've ordered up a UART to usb but will keep looking for a solution.
Thanks for your support

@davidstuart97
Copy link
Author

davidstuart97 commented Mar 19, 2024

It looks like I have an issue with mosquito as it will only operate locally. see below: -
I have followed the above that was discussed but still not getting joy. Please can someone assist
Please see configuration below :-
Mosquitto.config

Place your local configuration in /etc/mosquitto/conf.d/

A full description of the configuration file is at

/usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /run/mosquitto/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

listener 1883
allow_anonymous true

Reboot IOT2050:-
root@iot2050-dave://etc/mosquitto# mosquitto
1710843904: mosquitto version 2.0.11 starting
1710843904: Using default config.
1710843904: Starting in local only mode. Connections will only be possible from clients running on this machine.
1710843904: Create a configuration file which defines a listener to allow remote access.
1710843904: For more details see https://mosquitto.org/documentation/authentication-methods/
1710843904: Opening ipv4 listen socket on port 1883.
1710843904: Opening ipv6 listen socket on port 1883.
1710843904: mosquitto version 2.0.11 running

I've added : -
listener 1883
allowed anonymous

But it still doesn't connect
IOT2050 has been configured to connect to my by LAN router -
C:\Users\david>ping 192.168.1.170

Pinging 192.168.1.170 with 32 bytes of data:
Reply from 192.168.1.170: bytes=32 time=1ms TTL=64
Reply from 192.168.1.170: bytes=32 time=1ms TTL=64
Reply from 192.168.1.170: bytes=32 time=1ms TTL=64
Reply from 192.168.1.170: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.1.170:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
I can connect putty through this address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants