-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1 crashes after a few hours #14
Comments
Ik heb inmiddels zelf ook het probleem ervaren met mijn setup hier. Ik heb nog geen exact idee waardoor dit wordt veroorzaakt, maar een paar mogelijkheden zijn:
Wat kan helpen is om uit te vinden of er ook iets bijzonders te zien is op de seriële poort voordat de boel crasht. Ikzelf heb inmiddels de nRF905 via een USB kabel gekoppeld aan een losse raspberry pi die ik nog had liggen, waar ik nu een seriële monitor op heb draaien. |
I have the same issue and I used a serial monitor with HA to get the output of it. Just before it crashed, it returned:
If you want to create the serial monitor sensor as well, attach the USB cable to the Home Assistant host and use the following config (make sure to double check the serial port): - platform: serial
serial_port: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
name: "Ventilation-RC Serial"
baudrate: 115200 |
I have the same issue with a Wemos D1 Mini (ESP8266), it disconnected after 19 hours. I cannot use the USB cable trick described above though. |
Were you able to make any progress with the logging @eelcohn ? |
I have the same problem. Dies after 12-15 hrs of use. Turning off and on the power doesn't help. I have to remove the USB connector and re-insert. |
I have the same isue with my ESP32 Dev board. Around 12 hours indeed. update: Now it doesn't connect to the fan anymore after the second time it crashes. Seems like it lost the fan settings, had to reinitialise the fan connection. |
I'm happy to have a go at adding some serial port logging to see if its something easy, the C++ is not very complicated. The issue that I have (as well as it bombing after 12 hours) is that chip I bought is a PTR8000 (https://www.amazon.nl/gp/product/B08CCP13HB) it only has a 2 meter range. Which would mean I'd have to put the computer in the loft. Can anyone recommend a chip that works over 20 meters or so that's available in NL? If so I'll buy that and debug what's going on. |
@chrisjstevo I know eelcohn has ordered a new model that in theory actually supports the 800MHz band: https://gathering.tweakers.net/forum/list_message/64826542#64826542, but haven't seen the results yet (most of the existing boards are build for 400MHz and 800MHz 'support' is accidental, hence the limited range). My PTR8000 with Wemos D1 mini is running fine for more than 2 days now, but that is w/o any polling of state by Home Assistant. I only check the status manually with the api a few times a day. As soon as I turn on the REST sensor in Home Assistant (polling it every 30s I think), it stops responding after a few hours. Have to reconnect the usb connector to make it work again. |
I'm polling every minute in the script i made for domoticz. Almost sounds like some kind of memory leak or something. |
@abmaonline I have a smart plug that runs on a timer, I will try setting this up to restart the device every few hours and see if it increases the time till failure. If so that would point to a mem issue I agree. |
@proditaki I have a similar issue with Home Assistant. After 12 hours the Wemos D1 mini crashes, and only a hard reset will solve it. Update: it crashed after 29 hours. |
It's already running for 20 hours now when polling every 15 minutes, so it seems that there's a connection to the bug there. |
I'd agree with @proditaki, I've had the chip running for 3.5 days now. I reboot it every twelve hours using a smart plug and have seen no issues. If this were a normal cpp app running on an OS I would look to a memory leak or heap fragmentation. Because this is running on the chip and I assume doesn't really have an OS, I'm not sure what services are offered at all by the underlying runtime. I suspect not many. I'll try and see how one would debug a memory leak on such a hardware setup. A quick and dirty solution might be to call the reset on the chip after every n calls. Effectively doing what my plug is doing but in code. |
I might reset it every night from my domoticz plugin for now as a failsafe. is this API call enough for a reset? update: since i run my domoticz on a pi i added this to the cron.daily. Let's see if this will help to keep it running update 2021-02-04: this has been working fine for almost a week now, so acceptable as a workaround for now. |
Yes, same issue indeed. I solved it via hass adding a reset rest command, script and some automation to reset every hour: Next week I`ll have some time to go through the api code. Not sure, but my guess this can be resolved and make this solution more robust. |
update: never mind, somehow the IP address changed, allthough i gave it a static lease.. weird
|
Thank you all for taking the effort to solve this problem 👍 Unfortunately I haven't found the time to work on a solution yet, but I agree with @proditaki that it's most likely a memory leak issue. I'm wondering if there's a difference between systems with or without CO2-sensors. Since CO2-sensors send out data every minute or so, the nRF905API receives way more data on systems with CO2-sensors. If it's a buffer overlow issue related to received data, then theoretically the nRF905API should crash sooner on systems with CO2-sensors, and should crash later on systems with just the RF remote controls. |
@eelcohn my setup is without CO2-sensors 👍. |
Mine is without CO2 sensors as well. |
No CO2 sensor here as well. Reboot is working fine, took it from xirixiz' HA config :) |
I used an esp32 nodemcu but i dont poll for status at all. i didnt had any freezes AT ALL for weeks, no restarts needed/done or anything else. I also dont have a co2 sensor |
My setup is without CO2 sensors as well, but I do poll the status every minute. |
Mine is with CO2 sensor too. It seems to crash in a few days, but have to keep an eye on the exact timelines to be sure. |
I'm not using Home Assistant in my setup. I have a python script which is listening on some humidity sensors and sending a request to the module when humidity gets above a certain %'s. Before I was polling the status from the chip each time the python script updated the fan state. I turned this off two weeks ago and have it just telling the chip the fan speed when its needed and never asking it what the speed is. It hasn't crashed once since. It looks very much like the issue is with querying the device. |
Any update? |
Co2 sensor here aswell. Works for couple hours. After that it crashes. "WiFi SoftAP. IP address: Altho no SSID shows up in my Wifi list. My esp8266 is 3 meters away from my accesspoint. My other esp8266 (from other projects) dont experiance disconnects. Hopefully there will be a fix soon. |
I attached my device to my server and I'm running the following to get the serial logs: sudo cat /dev/ttyUSB0 | gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }' | tee -a ttylog.txt Try the following to get your TTY if it doesn't work: dmesg | cat tty It should show you something like this after a few seconds: |
I catched an exception! @eelcohn I can DM you the full stack trace if you want. I'm using API V1 with the CO2 sensor.
|
Nice work @DevSecNinja , thanks! Can you send the full stack trace via a Tweakers DM? (DM's aren't available in GitHub AFAIK) |
Any news regarding the catched exception? |
I have sent the catched exception to @eelcohn. Let's hope the exception gives some good info. :) |
@eelcohn, any updates on a possible fix? |
Yeah its the receive-buffer: Data received - not stored due to buffer overflow! Core 0 register dump: Backtrace:0x4008f0bf:0x3ffbd0100x4008ebdc:0x3ffbd050 0x4008d2cb:0x3ffbd070 0x4008d37c:0x3ffbd0b0 0x400839c9:0x3ffbd0d0 0x40156d9f:0x3ffbd0f0 0x40134670:0x3ffbd110 0x40131709:0x3ffbd130 0x40156cbf:0x3ffbd150 0x40156cf9:0x3ffbd1a0 0x401588d5:0x3ffbd1c0 0x401557bc:0x3ffbd1e0 Core 1 register dump: Backtrace:0x4008ef35:0x3ffbeff00x4008e157:0x3ffbf010 0x4008d297:0x3ffbf030 0x400e849f:0x3ffbf070 0x400e6cdd:0x3ffbf090 0x400e71d7:0x3ffbf0b0 0x40081421:0x3ffbf150 0x400e5a95:0x3ffbf170 0x40084f65:0x3ffbf190 0x400e832f:0x3ffb27b0 0x400e6c61:0x3ffb27e0 0x400e6cf9:0x3ffb2800 0x400e81e2:0x3ffb2820 |
Thanks! Based on what do you determine it's the receive-buffer? I'm not really familiar with C/C++. Thanks! |
Would calling |
I don't know, it resets the index for the buffer if you look at the code. What i do is just reset the device every night with a cron job. |
I think (hope) that I finally found why this problem is happening: the call to |
Any update on this @eelcohn ? :) |
Mss heb je hier meer aan @freakshock88: https://gist.github.com/golles/ae32d9a7c14b63d9d68f6ff9a6fd4d6a Nou ja, met name deze link: https://github.com/Sanderhuisman/ESPHome-Zehnder-RF |
Thanks @xirixiz , wist niet dat er al ESPHome functionaliteit hiervoor was, ik ga overstappen :) |
Hey @eelcohn, Thanks for creating this first of all! But I'm still running into the issue that it crashes after a few hours. I'm reading here and on Tweakers you've been working on a v2, any chance you can share what you already have on that front? |
Since upgrading to v1, my NodeMCU ESP8266 crashes after running the API for a few hours.
The blue LED also turns off.
I can remove power and restore it, then the NodeMCU boots and the API works again for a few hours.
The text was updated successfully, but these errors were encountered: