Closed griesi closed 1 year ago
use the old 0.5.6 Version, it works great.
use the old 0.5.6 Version, it works great.
pip install mqtt-io==0.5.6
says that this version does not exist.
Can you please tell me which package/version you mean?
https://github.com/flyte/mqtt-io/tags?after=2.0.0
sudo apt install python3.9-distutils python3-pip git
sudo pip install setuptools
git clone https://github.com/....
cd mqt*
sudo python3 setup.py install
Can confirm same issue,
Config: Running in a venv, with python 3.9.2
mqtt:
host: localhost
status_payload_running: available
status_payload_stopped: unavailable
status_payload_dead: unavailable
topic_prefix: gpio
port: 1883
user: "pi-mqtt-gpio"
password: "xxx"
protocol: 3.1.1
ha_discovery:
enabled: yes
gpio_modules:
- name: raspberrypi
module: raspberrypi
cleanup: yes
digital_outputs:
- name: nightlight_1
module: raspberrypi
pin: 14
retain: yes
ha_discovery:
component: switch
name: "Night Light 1"
- name: nightlight_2
module: raspberrypi
pin: 15
retain: yes
ha_discovery:
component: switch
name: "Night Light 2"
{repeat 4 more times}
digital_inputs:
- name: motionsensor_1
module: raspberrypi
pin: 0
pullup: yes
pulldown: no
retain: yes
inverted: true
ha_discovery:
component: binary_sensor
name: "Motion Sensor 1"
device_class: motion
- name: motionsensor_2
module: raspberrypi
pin: 5
pullup: yes
pulldown: no
retain: yes
inverted: true
ha_discovery:
component: binary_sensor
name: "Motion Sensor 2"
device_class: motion
{repeat 10 more times}
Hello,
I observe the memory leak too, but what is even worse in my case: I see the cpu usage increasing too. It starts on some 2%, but after about one day it gets up to about 100%, and after some more time it even seems to not catch up it's work and some sensor values start to not be reported occasionally (shown then as "unavailable" in HA). Restart of mqttio helps then (but that has also some other negative consequences on gpio outputs temporarily switched to unexpected state, so I cannot afford doing anything like cron based mqttio preventive restarts, without coordinating with the rest of system depending on that..)
I tried to find if it is related to any particular module or sensor, by commenting out the config sections one by one for all I use (rpi gpio out, in, ds1820 temp sensor, ads115 voltage adc) and watching resident memory and cpu usage after 5min and after 10mion after restart. But I was not able to find particular module that would be causing that - the only case when it is not happenning is when mqttio config is completely empty :-(
I was observing this on 2.2.6, running on Rpi 4, but now retried on 2.2.7 and still the same.
Pavel
use the old 0.5.6 Version, it works great.
Seems this build suffers the same leak if my testing this morning is correct unfortunately.... [EDIT - I was wrong - see below]
I use this Tree since three years without problems.
Indeed you are correct. I hadn't completely removed the latest version, so despite installing an older version, I was still running up the latest version which has got the memory leak issue.
0.5.6 appears to work fine with GPIO status being sent over MQTT - memory appears to be stable too.
Those needing to do this whilst this bug is being worked on will need to follow the instructions for that specific build as the syntax is different from the latest version!
This should be fixed with version 2.2.8 Please try and report. Thanks
On my setup, after one day, seems ok. I can remove cron task to restart it daily :-) Thx !
Fixed with v2.2.8
Describe the bug RAM consumption of mqtt-io process is growing over time
Expected behavior RAM consumption is on a constant level
Error messages and traceback no errors but raspberry pi is freezing when out of memory
Config
Hardware
System:
Additional context See also
I worked around this by restarting the process once a day by the supervisor daemon which is controlling the process.