Skip to content
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

[Bug]: "heap too low [10000] -> reboot in 5s" does not reboot in given time #2206

Closed
rpsainio opened this issue Jan 25, 2023 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@rpsainio
Copy link

Category

Other

Hardware

T-Beam, T-Lora v2 1.6

Firmware Version

2.0.14.cb8532f2-d

Description

There is a new feature designed to reboot the node when heap gets below 10000 #2165 . Unfortunately this does not work as designed and node did not reboot. Shortening the time it waits before rebooting seems to solve the problem

reboot_01.txt

reboot_02.txt

Relevant log output

No response

@rpsainio rpsainio added the bug Something isn't working label Jan 25, 2023
@karamo
Copy link

karamo commented Jan 25, 2023

It was just my first attempt to find a repitative process in the FW. I said that I don't know enough about the FW and that a developer should install it in a suitable place.

Yes, I've also noticed that it's awkwardly placed in OSThread.cpp. If this function is called within the 5s, then it comes to a retrigger and delays the reboot.
Why did this work for me?
Probably because I compiled myself with DEBUG_HEAP and additionally had the DEBUG output turned on.
My suggestion would now be to move this heap test to the power .cpp, since it is only called every 30s. Also, both the value 10000 is only estimated by me, since 7000 was too low.
Also, the 5s are just any value and can be reduced arbitrarily.

@rpsainio
Copy link
Author

@karamo I just tested asserting and it seems to work as well, meaning no boot-loops etc. Once low on heap I would not waste time waiting that somebody releases heap rather than rebooting. Will cost some extra messages sent around. According to my test this happens after ca. 16000 seconds == 4 hours so even an MS-windows survives longer..

@karamo
Copy link

karamo commented Jan 27, 2023

I can confirm it now.
As the last test run on the TLORA 2.1_1.6 board has shown, 10000 heap reserve for reboot is not enough and 5s delay to reboot is too long. It crashed ...
My recommendation:

  1. Move the query to Power.cpp
  2. set it to 11000
  3. set the delay to max. 1s

@karamo
Copy link

karamo commented Jan 27, 2023

Sorry, correction, the 30s rate at which [Power] thread runs can also be too long.
If the [Blink] thread runs at 1s, the query would be much better placed here.

@caveman99
Copy link
Member

see #2210

@caveman99
Copy link
Member

fixed in 2.0.14 beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants