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

Aquapi bootilooping with factory image #68

Closed
kiguy2052 opened this issue Jul 7, 2024 · 17 comments · Fixed by #69 or #70
Closed

Aquapi bootilooping with factory image #68

kiguy2052 opened this issue Jul 7, 2024 · 17 comments · Fixed by #69 or #70
Assignees
Labels
bug Something isn't working

Comments

@kiguy2052
Copy link

Describe the bug
After flashing a fresh image using the default yaml, the device reboots immediately upon finishing setup.

To Reproduce
Not sure if reproducible

Expected behavior
No bootloop obvs

Screenshots
logs (1).txt
image
image

  • OS: ESP32
  • Browser: Flashing with esphome web in Chrome

Additional context
Tried with and without api: section commented out, it seems to be having some issue starting the api but otherwise I'm stumped

@kiguy2052
Copy link
Author

OK, I was able to find some new information and potentially reproduce the issue. I started by downloading the most recent release on the github( aquapi-esp32.factory.bin) and flashing it. I join the AP, configure it to use my guest network, and let it connect. All looks good according to the logs:
logs (3).txt

Then, I attempt to adopt it into ESPHome, which is where things go sideways. Immediately after esphome finishes uploading the api config, the bootloop begins occurring:
SC:
image
Logs:
logs (4).txt

Any ideas what might be causing this? Is anyone else able to reproduce?

@TheRealFalseReality
Copy link
Owner

TheRealFalseReality commented Jul 7, 2024

Hmm, try doing it with api: defined, that allows it to connect to Home Assistant, it may reboot every 15 mins without connecting to an API. As for the ESPHome reboot, not sure. Try doing it without anything connected to the pins on the ESP device, perhaps something is messing with the pins....
Without anything connected, add these substitutions to the yaml so the logs aren't as cluttered with components that are not actually connected.

substitutions:
  update_ph: "never"
  update_ec: "never"
  update_do: "never"
  update_rtd: "never"
  update_pmp_1: "never" # Red
  update_pmp_2: "never" # Green
  update_pmp_3: "never" # White
  update_pmp_4: "never" # Orange
  update_pmp_5: "never" # Yellow
  update_pmp_6: "never" # Blue
  update_hum: "never"
  update_co2: "never"
  update_orp: "never"
  update_button_co2: "365days"
  update_button_ec: "365days"
  update_button_hum: "365days"

https://github.com/TheRealFalseReality/aquapi/wiki/Substitutions

@TheRealFalseReality
Copy link
Owner

You can also try adding packages, one at time. I have it all split up
In your yaml, try this:

packages:
  TheRealFalseReality.aquapi/common: 
    url: https://github.com/TheRealFalseReality/aquapi
    ref: main
    file: common/device_base_common.yaml
    refresh: 1s
  TheRealFalseReality.aquapi/esp32: 
    url: https://github.com/TheRealFalseReality/aquapi
    ref: main
    file: common/device_base.yaml
    refresh: 1s

This is just the packages that allow the ESP32 to boot properly, no other components activated.

@TheRealFalseReality
Copy link
Owner

TheRealFalseReality commented Jul 7, 2024

You can also try adding packages, one at time. I have it all split up In your yaml, try this:

packages:
  TheRealFalseReality.aquapi/common: 
    url: https://github.com/TheRealFalseReality/aquapi
    ref: main
    file: common/device_base_common.yaml
    refresh: 1s
  TheRealFalseReality.aquapi/esp32: 
    url: https://github.com/TheRealFalseReality/aquapi
    ref: main
    file: common/device_base.yaml
    refresh: 1s

This is just the packages that allow the ESP32 to boot properly, no other components activated.

replace the existing packages declaration in your yaml

@kiguy2052
Copy link
Author

Alright, that stops it from bootlooping, and it is able to show basic info in HA. Adding more yamls in reveals the issue may be the ota_https package. Here's my yaml:
https://pastebin.com/S65ck3pi
and the logs:
logs (6).txt
I suspect having one pump on the multiconnector might be causing issues, so I'm goingn to try the inital default yaml setup without the multi-connector and return with results. Thank you for your quick reply!

@TheRealFalseReality
Copy link
Owner

TheRealFalseReality commented Jul 7, 2024

Ok, lemme know. The ota_https is new, but works for me in testing. It's really only meant for AquaPi Firmware update sensor so I may need to remove it if it has issues.

@kiguy2052
Copy link
Author

Yep, it appears to be the ota_https. Here's the yaml I'm running, with everything(I think) except ota_https, and it doesn't bootloop:
https://pastebin.com/fvh9uviN
and here's the logs
logs_aquapi-a9eef8_logs.txt
I remember seeing a bug report(on the esphome github i think) about devices bootlooping when loading wifi libraries before ota. something about ota lacking wireless as a requirement. couldn't find it when I went back through my history, but it could be somewhere to start

@TheRealFalseReality
Copy link
Owner

Ok, and I think I read somewhere having duplicate ota: in packages can cause issues. I simplified it, and made sure ota: is before wifi:. I updated it with some changes to 2024.6.4 if you wanna try that out.

@TheRealFalseReality TheRealFalseReality self-assigned this Jul 8, 2024
@TheRealFalseReality TheRealFalseReality added the bug Something isn't working label Jul 8, 2024
@TheRealFalseReality TheRealFalseReality modified the milestone: Started Jul 8, 2024
@TheRealFalseReality TheRealFalseReality linked a pull request Jul 8, 2024 that will close this issue
@kiguy2052
Copy link
Author

the aquapi does not boot after installing the updated image. For whatever reason, my camera also using your repository is booting just fine. i'm wondering if it could be the order of these in the yaml?
image
camera yaml:
image
Maybe moving id: under icon: to match the camera config will make it work?

@kiguy2052
Copy link
Author

shoot, just noticed the app_version: "2024.6.4". I'm using esphome 2024.6.6. might be important lol🤦‍♂️

@TheRealFalseReality
Copy link
Owner

no the 2024.6.4 is for the latest AquaPi

@TheRealFalseReality
Copy link
Owner

TheRealFalseReality commented Jul 8, 2024

try building it without the ota_httpa entirely, I created a branch that removes that, and only that. And I may move the AquaPi SnapCam to its own repository in the near future, keep a lootout.

packages:
  TheRealFalseReality.aquapi: 
    url: https://github.com/TheRealFalseReality/aquapi
    ref: test-ota
    file: aquapi_config.yaml
    refresh: 1s

@kiguy2052
Copy link
Author

That works! Thanks for making that build!

@kiguy2052
Copy link
Author

OK, after running into the exact same issue with my other aquapi unrelated esphome devices, i found the issue. If it doesn't have internet, it will reboot after loading the ota, bootlooping it. This wasn't the case on previous versions, so I had them all on a cut off network. Throwing them on a vlan with internet let me use the normal version immediately. Any idea where I would report this further up the chain? Maybe the esphome github?

@TheRealFalseReality
Copy link
Owner

TheRealFalseReality commented Jul 8, 2024

Hmm, so you need internet otherwise the device just reboots? A little annoying. I do like the update sensor but maybe I will just keep a branch without ota_https in the meantime.

@TheRealFalseReality TheRealFalseReality linked a pull request Jul 8, 2024 that will close this issue
@kiguy2052
Copy link
Author

It's incredibly annoying. After further testing, I can confirm that if they don't have internet access, installing anything with ota_https will result in that device looping until it gets access. Once it can boot with internet, it seem to be fine, even surviving power cycling after the initial install is done with internet. Thanks for helping me work through this!

@TheRealFalseReality
Copy link
Owner

No worries! I recently tested the ota_http and it worked fine, but it completely reset the device 100% including wifi credentials., not the intended results I wanted. I removed the feature entirely for now and is active in the main branch.

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

Successfully merging a pull request may close this issue.

2 participants