Not able to connect to Mosquitto Broker(version 2.0.7updated) which running in Termux

Hi,
I am Running my Mosquitto broker on android through TERMUX .Previously (old version) is working fine with connection with Node mcu .But after updation i am not able to connect to the broker

It showing like this

1616485604: mosquitto version 2.0.7 starting
1616485604: Using default config.
1616485604: Starting in local only mode. Connections will only be possible from clients running on this machine.
1616485604: Create a configuration file which defines a listener to allow remote access.
1616485604: Opening ipv4 listen socket on port 1883.
1616485604: Opening ipv6 listen socket on port 1883.
1616485604: mosquitto version 2.0.7 running

please guide me to achieve the goal

thank you

OH2 or OH3?

Config files or Main UI?

Log Files from openHAB connection?

There are breaking changes in Mosquitto V2. Check this post and included links:

Hi
its config file configuration
thank you

Thank you . Honestly its not useful for me .And one more think can i downgrade my mosquitto version ,is it possible in termux? if yes! How???

Hi @kiran - did you read the links for Mosquitto migration to 2.0?

In fact, it should be pretty simple to set up if you are using a simple, non-secured MQTT network. All you’ll need to do is add 2 lines to the end of your mosquitto.conf file (I don’t know where this is in a Termux install, it’s normally in /etc/mosquitto.

Assuming you want to listen on port 1883, and allow any client to connect:

listener 1883
allow_anonymous true

Hi
Yes , I went for those steps tried it by adding
listener 1883
allow_anonymous true

at the end of the config file but still it showing same thing

1616485604: mosquitto version 2.0.7 starting
1616485604: Using default config.
1616485604: Starting in local only mode. Connections will only be possible from clients running on this machine.
1616485604: Create a configuration file which defines a listener to allow remote access.
1616485604: Opening ipv4 listen socket on port 1883.
1616485604: Opening ipv6 listen socket on port 1883.
1616485604: mosquitto version 2.0.7 running

i am not able achieve the things…

Bad thing is every article give solution for mosquitto which is running on Linux(terminal) not for ANDROID (Termux) :joy:

1 Like

I wouldn’t think it should matter too much whether it’s in Termux or in Linux directly, but I’m not certain - I’ve never used Termux.

@stefaanbolle noted that he also had to add

user root

As the default permissions have changed in MQTT 2.0.x. You could also try adding your own username instead of root.

Also, I’m not sure, but your output shows Mosquitto is starting with default config (maybe this refers to the default config file, or maybe it means it didn’t find any config file, which would explain why adding the two lines didn’t work). To be very sure you are starting Mosquitto with the configuration file you intend, stop it, then start it manually with the syntax below, using the actual location of your config file:

mosquitto [-c config file] [ -d | --daemon ]

Maybe try the first time without the -d option, so you can stop it with Ctrl+C while you experiment.

More info from: https://mosquitto.org/man/mosquitto-8.html

Thank you for Your response :star_struck: :star_struck:
Still i got same problem . May be i am not doing right in “user root”

Literally termux is sucks , i cant even install some other broker also …
Please guide if u have any other solution

In this case, if you’re confident it’s related to the implementation in Termux, the right thing to do would be to submit a bug report (“New Issue” button) on the Termux-packages github - they may be able to guide you further with this one.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.