Open xorguy opened 2 weeks ago
Having same issue
I have added more logs and a debug bar, @xorguy can you try with the latest release?
Edit: I tried with below broker and it worked fine.
services:
mqtt:
build:
context: ../mqtt
container_name: mqttbroker
restart: always
ports:
- "1883:1883"
Same thing here. I pulled the latest docker image but no messages. Not sure of the others but I require a username and password for connection to my broker.
Can you clarify what you mean by added a debug bar?
I also have a username/password. I dont see any messages or any new debug logs. All I see in the logs is for http requests which I assume is from me loading the website.
I tried with version 1.0.2 with same results and no additional logs at the docker logs others than my connections to the page and I don't see any change at the repo since 1.0.2.
Same thing here. I pulled the latest docker image but no messages. Not sure of the others but I require a username and password for connection to my broker.
I have tested this and it should fail if your broker require username and password and you should see that in the debug bar, can you provide more details about your setup?
Botton right there is a button
Same thing here. I pulled the latest docker image but no messages. Not sure of the others but I require a username and password for connection to my broker.
I have tested this and it should fail if your broker require username and password and you should see that in the debug bar, can you provide more details about your setup?
I realizedI was on the wrong version which would explain why I didnt see the debug button. You should update the readme to either use the latest or use 1.0.2 as the tag.
Anyways even with the debug button I do not see any errors. My mqtt setup is basically the simplest possible. I am running mosquitto broker with a static IP on the default port, with username/password required for authentication. I have multiple other devices connected without any issue.
For sanity sake I also went into the container installed ping and confirmed the container was able to hit the mqtt server as well.
Same thing here. I pulled the latest docker image but no messages. Not sure of the others but I require a username and password for connection to my broker.
I have tested this and it should fail if your broker require username and password and you should see that in the debug bar, can you provide more details about your setup?
I realizedI was on the wrong version which would explain why I didnt see the debug button. You should update the readme to either use the latest or use 1.0.2 as the tag.
Anyways even with the debug button I do not see any errors. My mqtt setup is basically the simplest possible. I am running mosquitto broker with a static IP on the default port, with username/password required for authentication. I have multiple other devices connected without any issue.
For sanity sake I also went into the container installed ping and confirmed the container was able to hit the mqtt server as well.
How are you running the app? Are you using Docker Compose? Have you confirmed that the environment variables are set correctly inside the container?
Same thing here. I pulled the latest docker image but no messages. Not sure of the others but I require a username and password for connection to my broker.
I have tested this and it should fail if your broker require username and password and you should see that in the debug bar, can you provide more details about your setup?
I realizedI was on the wrong version which would explain why I didnt see the debug button. You should update the readme to either use the latest or use 1.0.2 as the tag. Anyways even with the debug button I do not see any errors. My mqtt setup is basically the simplest possible. I am running mosquitto broker with a static IP on the default port, with username/password required for authentication. I have multiple other devices connected without any issue. For sanity sake I also went into the container installed ping and confirmed the container was able to hit the mqtt server as well.
How are you running the app? Are you using Docker Compose? Have you confirmed that the environment variables are set correctly inside the container?
I am using docker and just pulling your existing container on docker hub. And yes just double checked env variables are being set
I have the same issue. Deployed via compose but I see no logging to show it attempting a connection. My MQTT server needs authentication buut even with this commented out in the compose file I see no errors.
Compose:
version: "3.3"
services:
mqttui:
image: terdia07/mqttui:v1.0.2
container_name: mqttui
expose:
- 5000
environment:
- MQTT_BROKER=mosquitto
- MQTT_PORT=1883
#- MQTT_USERNAME=<removed>
#- MQTT_PASSWORD=<removed>
networks:
- proxy_backend
- mqtt_backend
restart: unless-stopped
networks:
proxy_backend:
external: true
mqtt_backend:
external: true
Container logs:
* Serving Flask app 'app.py' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
WARNING:werkzeug: * Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
INFO:werkzeug: * Running on http://172.18.0.3:5000/ (Press CTRL+C to quit)
Debug bar:
The interface opens OK, but I do not see anything to suggest an MQTT connection is being attempted. Happy to provide any further info that may help get to the bottom of this.
Also seeing this behavior on 1.0.2. Cannot connect to broker with username and password env variables set and no debug messages if I make the password incorrect, for example. I'm running mqttui on unraid with my mosquitto server on a separate Home Assistant OS box.
Pulling image: terdia07/mqttui:v1.0.2
IMAGE ID [v1.0.2]: Pulling from terdia07/mqttui.
Status: Image is up to date for terdia07/mqttui:v1.0.2
TOTAL DATA PULLED: 0 B
Stopping container: mqttui
Successfully stopped container 'mqttui'
Removing container: mqttui
Successfully removed container 'mqttui'
Command execution
docker run
-d
--name='mqttui'
--net='cloudflared'
-e TZ="America/Chicago"
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="Tower"
-e HOST_CONTAINERNAME="mqttui"
-e 'MQTT_BROKER'='10.0.0.11'
-e 'MQTT_PORT'='1883'
-e 'MQTT_USERNAME'='mqtt'
-e 'MQTT_PASSWORD'='testing12345'
-l net.unraid.docker.managed=dockerman
-p '5000:5000/tcp' 'terdia07/mqttui:v1.0.2'
2c36cc8268b42f5f6e6f882e137b676a6bdc1903caa0b0578101cb5f30ad77c8
The command finished successfully!
Hello ! Same issue for me.
I tried on unraid to log my mqttt server on home assistant too.
I tried different things like changing networking type (host, bridge, etc), but same issue.
Hi,
Using MQTT with authentication can be tricky, as you can use the same username/password on multiple connection, if you have different clientIDs. Here I don't see any option to set a clientID separated from the username. It can be why no log on happen.
It can also be version of MQTT protocol, V3 vs V5, it should also be and option to test.
Hi,
After testing, problem seems to be that we don't do in the main code as name = "app" and not "main" because application is started by flask.
So in file app.py, line 147, if I replace:
if __name__ == '__main__':
by
if __name__ == 'app':
My installation works.
Also I replace line 25 with :
mqtt_client = mqtt.Client(client_id='mqttui',
transport='tcp',
protocol=mqtt.MQTTv311,
clean_session=True)
to be sure to be compatible with my broker.
Hi.
I tested the changes commented by @errorscript and I can see that the app connects to my MQTT broker and see the messages but in a given moment I got an error and stopped working.
Error I got:
Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 917, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3452, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1779, in loop_forever rc = self.loop(timeout, max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1181, in loop rc = self.loop_read(max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1572, in loop_read rc = self._packet_read() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2310, in _packet_read rc = self._packet_handle() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2936, in _packet_handle return self._handle_publish() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3216, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3444, in _handle_on_message self.on_message(self, self._userdata, message) File "/app/app.py", line 83, in on_message 'payload': msg.payload.decode(), UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
May this be related that some MQTT messages are encoded images and the app cannot decode it?
Despite being able to see logs, until crashed, at the docker logs I still don't see any Debug button at the bottom right.
Hi everyone,
I've released version 1.3.0, which addresses the reported issues with MQTT connections and improves overall configuration flexibility.
Key improvements include:
Please try this latest release and let us know if you still experience any issues. You can pull the new version using:
docker pull terdia07/mqttui:v1.3.0
If problems persist, please provide:
Screenshots for debug bar when wrong credential is used
Successful connection
Just pulled it and it works like a champ!
Works for me too ! Thanks !
Confirmed working now
Hi,
Version 1.3.0 work fine for me. Thanks !
Please update the instructions for docker in README.md to point to version 1.3.0
Hi.
I created an ARM64 image and set with docker compose with environmental variables for mqtt host, port and credentials but I got no MQTT messages at all.
My compose: `mqttui: image: xorguy/mqttui_arm64:1.0.0 container_name: mqttui environment:
Do you have any idea why it seems to not connect to my MQTT broker?