GithubHelp home page GithubHelp logo

Comments (6)

theyosh avatar theyosh commented on August 16, 2024

There should be warnings when TP starts up about not able to login into the MQTT server. So grep for to MQTT Broker in the logfile. Maybe there is some more information when TP starts up.

Also, when you edit the notification settings, it is all still correct values?

from terrariumpi.

G4KCM avatar G4KCM commented on August 16, 2024

There should be warnings when TP starts up about not able to login into the MQTT server. So grep for to MQTT Broker in the logfile. Maybe there is some more information when TP starts up.

Also, when you edit the notification settings, it is all still correct values?

All is Ok in the configuration file here is the part of the log where the new TP starts, looks like something is not correct?

May 14 16:19:58 terrariumpi python[496]: 2024-05-14 16:19:58,648 - INFO - OpenWeatherMap - Using Openweathermap One Call API 2.5
May 14 16:19:58 terrariumpi systemd[1]: systemd-fsckd.service: Succeeded.
May 14 16:19:59 terrariumpi python[496]: 2024-05-14 16:19:59,847 - INFO - OpenWeatherMap - Loaded new historical weather data (40 measurements) from 2024-05-13 12:00:00 till 2024-05-15 03:00:00 in 1.20 seconds.
May 14 16:19:59 terrariumpi python[496]: 2024-05-14 16:19:59,849 - INFO - terrariumWeather - Loaded weather data from source https://api.openweathermap.org/data/2.5/weather?q=Noumea,NC&appid=144d3f645a94f10491acb972422f3036 in 1.74 seconds
May 14 16:19:59 terrariumpi python[496]: Exception ignored in: <function Client.del at 0xf64aeb68>
May 14 16:19:59 terrariumpi python[496]: Traceback (most recent call last):
May 14 16:19:59 terrariumpi python[496]: File "/home/pi/TerrariumPI/venv/lib/python3.9/site-packages/paho/mqtt/client.py", line 874, in del
May 14 16:19:59 terrariumpi python[496]: self._reset_sockets()
May 14 16:19:59 terrariumpi python[496]: File "/home/pi/TerrariumPI/venv/lib/python3.9/site-packages/paho/mqtt/client.py", line 1133, in _reset_sockets
May 14 16:19:59 terrariumpi python[496]: self._sock_close()
May 14 16:19:59 terrariumpi python[496]: File "/home/pi/TerrariumPI/venv/lib/python3.9/site-packages/paho/mqtt/client.py", line 1119, in _sock_close
May 14 16:19:59 terrariumpi python[496]: if not self._sock:
May 14 16:19:59 terrariumpi python[496]: AttributeError: 'Client' object has no attribute '_sock'
May 14 16:19:59 terrariumpi python[496]: 2024-05-14 16:19:59,945 - WARNING - terrariumNotification - Failed connecting to MQTT Broker at address: 192.168.1.22:1883: init() missing 1 required positional argument: 'callback_api_version'
May 14 16:20:01 terrariumpi python[496]: 2024-05-14 16:20:01,631 - ERROR - terrariumNotification - Could not send message Starting up TerrariumPI 4.9.0 on a Raspberry Pi 4 Model B Rev 1.5 ... to topic terrariumpi/system/broadcast as we are not connected to the MQTT broker at address: 192.168.1.22:1883
May 14 16:20:02 terrariumpi python[496]: 2024-05-14 16:20:02,200 - INFO - terrariumEngine - Start loading total power and water usage
May 14 16:20:09 terrariumpi systemd[1]: systemd-hostnamed.service: Succeeded.
May 14 16:20:14 terrariumpi python[496]: 2024-05-14 16:20:14,664 - INFO - terrariumEngine - Loaded total power and water usage in 12.46 seconds.
May 14 16:20:14 terrariumpi python[496]: 2024-05-14 16:20:14,664 - INFO - terrariumEngine - Loading existing sensors from database.

For reference here is startup prior to upgrade to 4.9.0...
May 14 13:18:06 terrariumpi systemd[1]: Started watchdog daemon.
May 14 13:18:06 terrariumpi systemd[1]: Startup finished in 3.490s (kernel) + 1min 19.411s (userspace) = 1min 22.902s.
May 14 13:18:06 terrariumpi python[495]: 2024-05-14 13:18:06,977 - INFO - terrariumEngine - Loaded 30 settings in 0.18 seconds.
May 14 13:18:07 terrariumpi python[495]: 2024-05-14 13:18:07,365 - INFO - terrariumEngine - Loading weather data from source https://api.openweathermap.org/data/2.5/weather?q=Noumea,NC&appid=144d3f645a94f10491acb972422f3036
May 14 13:18:09 terrariumpi python[495]: 2024-05-14 13:18:09,338 - INFO - weather.openweathermap_org_weather - Using Openweathermap One Call API 2.5
May 14 13:18:10 terrariumpi python[495]: 2024-05-14 13:18:10,178 - INFO - weather.openweathermap_org_weather - Loaded new historical weather data (48 measurements) from 2024-05-12 12:00:00 till 2024-05-14 11:00:00 in 0.84 seconds.
May 14 13:18:10 terrariumpi python[495]: 2024-05-14 13:18:10,180 - INFO - weather - Loaded new weather data in 2.811 seconds.
May 14 13:18:11 terrariumpi python[495]: 2024-05-14 13:18:11,148 - INFO - terrariumNotification - Connecting to MQTT Broker at address: 192.168.1.22:1883 ...
May 14 13:18:11 terrariumpi python[495]: 2024-05-14 13:18:11,407 - INFO - terrariumNotification - Logged in to MQTT Broker at address: 192.168.1.22:1883.
May 14 13:18:15 terrariumpi python[495]: 2024-05-14 13:18:15,687 - INFO - terrariumEngine - Loading existing sensors from database.
May 14 13:18:15 terrariumpi python[495]: 2024-05-14 13:18:15,817 - INFO - terrariumEngine - Loaded sensor SI7021 sensor humidity named 'Humidity Mid Cage Centre' at address '0x40,1' with value 69.49% in 0.12 seconds.
May 14 13:18:15 terrariumpi python[495]: 2024-05-14 13:18:15,822 - INFO - terrariumEngine - Loaded sensor SI7021 sensor temperature named 'Temperature Mid Cage Centre' at address '0x40,1' with value 21.37C in 0.00 seconds.
May 14 13:18:15 terrariumpi python[495]: 2024-05-14 13:18:15,926 - INFO - terrariumEngine - Loaded sensor SI7021 sensor humidity named 'Humidity Mid Cage Left' at address '0x40,3' with value 69.98% in 0.10 seconds.
May 14 13:18:15 terrariumpi python[495]: 20

Rgds - Clive

from terrariumpi.

G4KCM avatar G4KCM commented on August 16, 2024

There should be warnings when TP starts up about not able to login into the MQTT server. So grep for to MQTT Broker in the logfile. Maybe there is some more information when TP starts up.

Also, when you edit the notification settings, it is all still correct values?

Looks like it might be something to do with this..?
paho-mqtt 2.0, released on Feb, 10th, now requires an additional argument to mqtt.Client(), see their migration notes.

from terrariumpi.

theyosh avatar theyosh commented on August 16, 2024

If you add the following code mqtt.CallbackAPIVersion.VERSION1 on line in the file terrariumNotification.py

self.connection = mqtt.Client(client_id=f"TerrariumPI {self.setup['version']}")
so that the line will become:

self.connection = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, client_id=f"TerrariumPI {self.setup['version']}")

And restart TerrariumPI. This should make it work again.

from terrariumpi.

G4KCM avatar G4KCM commented on August 16, 2024

If you add the following code mqtt.CallbackAPIVersion.VERSION1 on line in the file terrariumNotification.py

self.connection = mqtt.Client(client_id=f"TerrariumPI {self.setup['version']}")

so that the line will become:
self.connection = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, client_id=f"TerrariumPI {self.setup['version']}")

And restart TerrariumPI. This should make it work again.
🤙 Yep that has fixed it. Thank you!

from terrariumpi.

theyosh avatar theyosh commented on August 16, 2024

Nice! Fix is also pushed to Github. Thanks for testing!

from terrariumpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.