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

Allow button to reset RX config #1681

Merged
merged 3 commits into from Jul 7, 2022

Conversation

CapnBry
Copy link
Member

@CapnBry CapnBry commented Jul 7, 2022

This changes the behavior of the 9-count long button press handler on the receiver from simply rebooting to resetting the config to defaults, then rebooting. STM32 platform also gets this functionality.

Porblem

There is no way to reset RX config on STM32 platform, meaning options which are webui-only (Force Telemetry Off is the only real problem) have no way to be undone on these devices without reflashing them with an old version and back again.

Details

Almost all of them have bind buttons and the remainder have a boot pad, so let's take advantage of that.

The boot pad / button on ESP and ESP32 RX currently has a 9x long press handler on it which reboots the RX. The sequence is that it goes into wifi mode on 5x long presses, then reboots at 9x. I'm not sure anyone actually uses this to reboot their RX, so it seems like this is a good place to stick the config reset function. It seemed everyone in dev chat was on board with this being the better functionality.

  • EEPROM RxConfig is reset to defaults
  • SPIFFS is reformatted, deleting options.json and hardware.json if custom files existed

Bonus

RadioMaster has indicated they have some support tickets which are crusty old fixed wing people who won't look up the "3-plugs to rebind" procedure and they expect the button to do this for them. Since this resets the config, this effectively unbinds the model with a long enough press, which may save some support requests. We need a way to reset config anyway so win-win right?

Tested

  • EP2 with bind phrase and Model Match ON + Force Telem Disabled - Model Match and Force Telem reset, binding retained
  • EP2 with traditional bind - Binding reset, starts in bind mode
  • R9MM with bind phrase and Model Match ON + Force Telem Disabled - Model Match and Force Telem reset, binding retained
  • R9MM with traditional bind - Binding reset, starts in bind mode

@CapnBry
Copy link
Member Author

CapnBry commented Jul 7, 2022

Should this also erase SPIFFS so we know there is nothing by stock compiled in settings? I feel like it should do this too probably because a webui-set binding phase or wifi network would not be cleared by this. EDIT: Done!

@pkendall64
Copy link
Collaborator

Should this also erase SPIFFS so we know there is nothing by stock compiled in settings? I feel like it should do this too probably because a webui-set binding phase or wifi network would not be cleared by this.

Probably not a bad idea.

@JyeSmith
Copy link
Member

JyeSmith commented Jul 7, 2022

Tested on a Pico Rx proto. Everything looks fine.

Buuuuut... unrelated to this PR, I did notice that if the rx is in bind mode with the LED blinking, then the button is pressed to enter wifi, the LED does not update to LED mode.

@pkendall64
Copy link
Collaborator

Tested on a Pico Rx proto. Everything looks fine.

Buuuuut... unrelated to this PR, I did notice that if the rx is in bind mode with the LED blinking, then the button is pressed to enter wifi, the LED does not update to LED mode.

Yeah, I noticed that too. It's because the Binding mode is a separate flag and when we switch to web mode we should clear the flag.

@JyeSmith JyeSmith merged commit a69e639 into ExpressLRS:3.x.x-maintenance Jul 7, 2022
@CapnBry CapnBry deleted the long-to-reset branch August 11, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants