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

add callback to HTTPUpdate #5408

Merged
merged 2 commits into from
Jul 19, 2021
Merged

Conversation

jayanta525
Copy link
Contributor

@jayanta525 jayanta525 commented Jul 17, 2021

  • add callback function to HTTPUpdate
  • update example to print progress
  • fix ArduinoIDE syntax coloring
  • reference: ESP8266httpUpdate
CALLBACK:  HTTP update process started
CALLBACK:  HTTP update process at 0 of 365728 bytes...
CALLBACK:  HTTP update process at 0 of 365728 bytes...
CALLBACK:  HTTP update process at 4096 of 365728 bytes...

Signed-off-by: Jayantajit Gogoi [email protected]

- add callback function to HTTPUpdate
- update example to print httpupdate progress
- fix ArduinoIDE syntax coloring

Signed-off-by: Jayantajit Gogoi <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Jul 17, 2021

CLA assistant check
All committers have signed the CLA.

@me-no-dev me-no-dev merged commit db4e766 into espressif:master Jul 19, 2021
@me-no-dev
Copy link
Member

Thanks @jayanta525 :)

@epiller
Copy link

epiller commented Oct 7, 2021

@jayanta525 No matter what I do, I always get error: 'class HTTPUpdate' has no member named 'onError', even though I can see the methods in source files. Same goes for onStart, onProgress and onEnd.
I'm running the newest ESP32 Core and everything else regarding HTTPUpdate is working normally. Even the included example doesn't compile for that reason. The issue is the same on both Arduino IDE and PlatformIO.
Any suggestions?

@jayanta525
Copy link
Contributor Author

@epiller I tested with the latest release 2.0.0, and the example compiled without any errors on ArduinoIDE.

Please make sure you're using the correct src and header files.

You can turn on verbose output during compilation in ArduinoIDE and check whether the compiler is using the correct HTTPUpdate.cpp

@epiller
Copy link

epiller commented Oct 8, 2021

@jayanta525 I just found out that while ESP8266 uses the same repo both on Arduino IDE and PlatformIO, ESP32 on PlatformIO utilizes https://github.com/platformio/platform-espressif32, which isn't the same as this one, so I guess I'll have to figure something out. Sorry and thank you for your help!

@jayanta525
Copy link
Contributor Author

@epiller You can add the HTTPUpdate library from this repo to lib/ folder in PlatformIO project directory.

And edit platformio.ini to ignore the built-in library.
lib_ignore = HTTPUpdate

lib_extra_dirs =
    lib/

https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-extra-dirs

And don't forget to set ldf_mode
https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-ldf-mode

@epiller
Copy link

epiller commented Oct 9, 2021

@jayanta525 That solved it and it's fully working now! Thank you so much man!

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