ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
441 stars 62 forks source link

MQTT connection error. Please check your settings in the configuration file "config.ini" #110

Open Boxersteavee opened 10 months ago

Boxersteavee commented 10 months ago

Checklist:

Release with the issue: 1.8.5 Last working release (if known): N/A Hardware, Operating System, Python version: Orange Pi 3 LTS, Debian, Python 3.10.12

Error: NOTIFY: MQTT connection error. Please check your settings in the configuration file "config.ini" upon running the python file Description of problem: I don't really understand all of the information i'm supposed to configure. I have configured and am confident the following is correct:

bsimmo commented 10 months ago

What's homeassistant saying in the various logs, mqtt logs etc.

What do any monitor tools see of the mqtt server.

I assume it's not encrypted.

On Sat, 2 Sep 2023, 5:51 pm Boxersteavee, @.***> wrote:

Checklist:

  • [how do these work, yes] I updated to the latest version available
  • [how do these work, yes] I checked that my MQTT broker is otherwise working

Release with the issue: 1.8.5 Last working release (if known): N/A Hardware, Operating System, Python version: Orange Pi 3 LTS, Debian, Python 3.10.12

Error: NOTIFY: MQTT connection error. Please check your settings in the configuration file "config.ini" upon running the python file Description of problem: I don't really understand all of the information i'm supposed to configure. I have configured and am confident the following is correct:

  • hostname
  • Left discovery_prefix alone
  • username
  • password - The username and password are the same as they are in the config file of another instance of this running on the same pi running HA, and it works fine. But running the script with an almost identical config file (just changed hostname) isn't working. The below image is a screenshot of the config file for what i think is the stuff i'm supposed to configure, and i don't know what i'm supposed to do with base_topic.

I don't know why it isn't working, i want it to work, and i don't know how to fix it. Please help [image: image] https://user-images.githubusercontent.com/76684157/265218977-b23a14b0-cdcd-4f43-94ca-cad4aa5b0d1e.png

— Reply to this email directly, view it on GitHub https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/110, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXNYCFSRGSF25DWXP7OLXYNPZ7ANCNFSM6AAAAAA4IWQKZU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Boxersteavee commented 10 months ago

As i said, i don't really knw what i'm doing. I haven't setup any monitor tools for the mqtt server, but i have got this tool working fine on the same machine hosting the mqtt server, and it has been successfully picked up and connected to home assistant fine, just this other device isn't working. Where would i find those logs?

bsimmo commented 10 months ago

In home assistant. Are you using mosquitto from HA itself, if so life is usually easier. (it has a log). But given you have the monitor it, you may not be using that setup.

Hence try a monitoring tool from you phone or a browser NOT on the mqtt server pi. i think the script insteuctions give some monitoring examples. Mqttsnooper on an android device works nicely.

Basically, you pi mqtt seever might not allow external connections.

On Sun, 3 Sep 2023, 19:20 Boxersteavee, @.***> wrote:

As i said, i don't really knw what i'm doing. I haven't setup any monitor tools for the mqtt server, but i have got this tool working fine on the same machine hosting the mqtt server, and it has been successfully picked up and connected to home assistant fine, just this other device isn't working. Where would i find those logs?

— Reply to this email directly, view it on GitHub https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/110#issuecomment-1704368273, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXN2P4TOTKQ6FPWU7223XYTDABANCNFSM6AAAAAA4IWQKZU . You are receiving this because you commented.Message ID: @.***>

Boxersteavee commented 10 months ago

Yeah I'm not using Home Assistant OS, so it doesn't have an Mqtt broker add-on thingy, I have to setup my own

Boxersteavee commented 10 months ago

Yeah I'm not using Home Assistant OS, so it doesn't have an Mqtt broker add-on thingy.i found an Mqtt client on the play store and it to failed to connect. How would.i allow external connections for the broker? I know the device itself allows external connections, so if it's a broker configuration. But silly for an IoT server not to allow external connections isn't it?

Boxersteavee commented 10 months ago

I can confirm it is in local only mode. I ran the sudo mosquito command and it showed it is running in local only. I'll try to set it up myself (I need to make a listener?) But I don't have high hopes 😅

Boxersteavee commented 10 months ago

nope, got stuck...

Boxersteavee commented 10 months ago

So how do I get it out of local mode?

Boxersteavee commented 6 months ago

I have done a big upgrade, and now have Home Assistant on a TrueNAS VM, and EMQX running the MQTT broker. I now have rpi-reporter running fine on my old server, but I can't figure out how to get the data to show up in home assistant. EMQX does show there is a connection.

I'm stupid, I haven't added the MQTT integration, I only setup a broker through an addon.