Skip to content

Conversation

@wel97459
Copy link
Contributor

@wel97459 wel97459 commented Nov 21, 2025

Replaced the halt function with a delay and reboot, instead of an infinite loop. This removes an edge case were there's a bad brown out and the radio fails to initialize properly.

As @liamcottle suggested I have added an error message that is customizable to other failure cases. Available on node with a display enabled.

and instead delays 10sec and reboots.
@LitBomb
Copy link
Contributor

LitBomb commented Nov 21, 2025

halt means stop. if you delay 10 seconds and then reboot, then it is a reboot and not a halt any more, is it?

@fschrempf
Copy link
Contributor

This could keep some boards from booting when there's dirty power, and the radio chip fails to init correctly.

And I guess that's exactly what is intended. If there is a critical failure, there is no reason to continue. Rebooting could cause nasty boot loops that won't help either.

@liamcottle
Copy link
Member

For radio init failure, if the device has a screen, I'd probably prefer to show a message that says radio init failed.

@wel97459
Copy link
Contributor Author

wel97459 commented Nov 21, 2025

The halt function is only called in one place in the whole code base, just for that radio init in the being of boot. It's definitely a contributing factor for solar nodes not booting up properly.

And I have already seen improvements in getting my repeaters to start from a BMS cut off.

I would also hazard to say that a rover on Mars would not have a function like halt or a call to a function that doesn't try to get the rover back to an operational status. Most repeaters are in places where reset buttons are a pain to get too.

And I thinking adding a message for nodes with a screens is a good idea with a count down to reset or something.

@wel97459
Copy link
Contributor Author

wel97459 commented Nov 21, 2025

I'll change the function name. A halt function like this one is bad way to handle a radio init problem.

halt means stop. if you delay 10 seconds and then reboot, then it is a reboot and not a halt any more, is it?

@wel97459
Copy link
Contributor Author

wel97459 commented Nov 21, 2025

I personally would rather have a boot loop then a non-responsive repeater, with a chance of a fully functional boot.

This could keep some boards from booting when there's dirty power, and the radio chip fails to init correctly.

And I guess that's exactly what is intended. If there is a critical failure, there is no reason to continue. Rebooting could cause nasty boot loops that won't help either.

@wel97459
Copy link
Contributor Author

wel97459 commented Nov 22, 2025

I removed the halt function and added delayedReboot. The function takes in a message string and delay amount, and displays the message like in the image.

Without DISPLAY_CLASS defined it just delays and reboots.

20251121_180750

Displays a error message before rebooting.
@wel97459 wel97459 changed the title Changed halt so it's not a while loop Removed halt and replace it with a delay and reboot Nov 22, 2025
@wel97459 wel97459 changed the title Removed halt and replace it with a delay and reboot Removed halt and replaced it with a delay and reboot Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants