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

I struggle to flash OTA over network (using bluetooth) #416

Closed
tomatensaus opened this issue Jan 18, 2024 · 5 comments
Closed

I struggle to flash OTA over network (using bluetooth) #416

tomatensaus opened this issue Jan 18, 2024 · 5 comments

Comments

@tomatensaus
Copy link
Contributor

Thank you for a brilliant project! I do not think people say this enought!

I am running a V11 of the JKBMS, flashing OTA over network only gets to 55% and then times out.
Running it 25 times maybe 1 will succeed.

The moment I disable the Bluetooth I can flash it over the network so I added the configuration below.
Maybe this can help someone? Maybe I can submit it as a PR to become part of the standard example?

Is this timeout a bug? Or just the way ESP32 bluetooth works? Bluetooth and Wifi compete for the same antenna.
Perhaps the WDT is timing out?

my workaround:

  - platform: ble_client
    ble_client_id: client0
    id: bluetooth_enabled_switch   # <--- add an ID so we can disable it from the OTA
    name: "${name} enable bluetooth connection"

and also

ota:
  on_begin:
    then:
      - lambda: |-
          id(bluetooth_enabled_switch).turn_off();
      - logger.log: "BLE shutdown for flashing"
@syssi
Copy link
Owner

syssi commented Jan 18, 2024

If the ESP to too busy processing stuff OTA updates doesn't succeed unfortunately. IMO it's a general issue of the ESPHome core and cannot be resolved here but I like your workaround! Could you prepare a pull request?

I've the same issue on a ESP32 node while receiving serial traffic on three different UARTs. I've added the safe mode switch component here to reboot the node into safe mode before doing OTAs: https://esphome.io/components/switch/safe_mode.html

@tomatensaus
Copy link
Contributor Author

I would gladly prepare a PR to include the workaround in the standard examples

@syssi
Copy link
Owner

syssi commented Jan 18, 2024

Thanks!

@testpaul999
Copy link

@tomatensaus
THX cool feature run's like a charm

@tomatensaus
Copy link
Contributor Author

PR created #417

@syssi syssi closed this as completed in 8220ec8 Jan 20, 2024
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

No branches or pull requests

3 participants