Giter Club home page Giter Club logo

Comments (10)

StefanL38 avatar StefanL38 commented on July 28, 2024 1

I found the solution this modifying of the file ElegantOTA.h.

This modification is far from beeing userfriendly

You should find a way that this will be adjusted through a
#define
inside your demo.ino-file
or
as a variant of the constructor with a parameter inside the demo.ino-file

best regards Stefan

from elegantota.

mathieucarbou avatar mathieucarbou commented on July 28, 2024

You should find a way that this will be adjusted through a
#define
inside your demo.ino-file

There are 2 ways to fix this:

  1. re-order the includes in order to put ESPAsyncWebServer at the end
  2. If you use ESPAsyncWebServer, use async mode: https://docs.elegantota.pro/async-mode/

from elegantota.

ednieuw avatar ednieuw commented on July 28, 2024

I hope you solve the error with this define.
" Locate the ELEGANTOTA_USE_ASYNC_WEBSERVER macro in the ElegantOTA.h file, and set it to 1: #define ELEGANTOTA_USE_ASYNC_WEBSERVER 1"

After een upgrade to a newer version the define is overwritten and you get a compile error

from elegantota.

thehans avatar thehans commented on July 28, 2024

Requiring the user to manually edit a dependency (this library) for it to compile is awful. I guess I will try the obsolete AsyncElegantOTA instead.

from elegantota.

mathieucarbou avatar mathieucarbou commented on July 28, 2024

Requiring the user to manually edit a dependency (this library) for it to compile is awful. I guess I will try the obsolete AsyncElegantOTA instead.

no need to edit.

just set a build flag: build_flags=-DELEGANTOTA_USE_ASYNC_WEBSERVER=1

from elegantota.

github-actions avatar github-actions commented on July 28, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

from elegantota.

StefanL38 avatar StefanL38 commented on July 28, 2024

@mathieucarbou
no need to edit.

just set a build flag: build_flags=-DELEGANTOTA_USE_ASYNC_WEBSERVER=1
Not everybody has the same knoweldge-level as you

can you please explain in detail in which file at which line do I set this build-flag?

from elegantota.

ayushsharma82 avatar ayushsharma82 commented on July 28, 2024

@StefanL38 just the matter of reading docs: https://docs.elegantota.pro/async-mode/#for-platformio

from elegantota.

StefanL38 avatar StefanL38 commented on July 28, 2024

Directly quoting what is written at the link

`
Enabling Async Mode For Arduino IDE

Go to your Arduino libraries directory
Open ElegantOTA folder and then open src folder
Locate the ELEGANTOTA_USE_ASYNC_WEBSERVER macro in the ElegantOTA.h file, and set it to 1:
#define ELEGANTOTA_USE_ASYNC_WEBSERVER 1
Save the changes to the ElegantOTA.h file.

You are now ready to use ElegantOTA in async mode for your OTA updates, utilizing the ESPAsyncWebServer library.
For PlatformIO
If you use PlatformIO then we can use a neat trick! You can set build_flags in your platformio.ini file that enables Async Mode of ElegantOTA.

Open platformio.ini file of your project
Paste this line build_flags=-DELEGANTOTA_USE_ASYNC_WEBSERVER=1 at bottom
Done!
PlatformIO will now compile ElegantOTA in Async Mode!

Benefits of Async Mode
Enabling async mode for ElegantOTA offers several advantages:

Non-blocking Operation: In async mode, ElegantOTA leverages the asynchronous web server capabilities of ESPAsyncWebServer. This means that OTA updates won't block your device's main loop. It allows your device to continue executing other tasks while handling OTA updates in the background.

Improved Responsiveness: Your device can remain responsive to user interactions or other processes during OTA updates, ensuring a smoother user experience.
`

from elegantota.

mathieucarbou avatar mathieucarbou commented on July 28, 2024

Example if you use PlatformIO (But in this case, it would have been better to read the doc about how to set build flags with PlatformIO).

image

The doc explains one way to do it.
But setting build flags is common in C/C++ and specific to the IDE. This is a way to change the program behaviour from an external config flag. So it is up to the user to know how to set those by reading the manual of its IDE. A library cannot document all the possible ways to set flags for each IDE: this is completely impossible.

And It does not require any specific knowledge level - this is part of C/C++ basics about how to compile that anyone should know when dealing with C / C++ libraries. Arduino IDE has a doc about that, PlatformIO also, and @ayushsharma82 also added another alternative on his website, so it is more than enough IMO.

from elegantota.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.