-
Notifications
You must be signed in to change notification settings - Fork 124
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
[Must Read] V3 Project Plan & Features #86
Comments
Hey, @ayushsharma82, |
@vortigont Good Idea! That will be much appreciated and it will also ensure quick uploads for those who are experiencing upload issues due to signal loss. |
I'd like to be able to upload cryptographic keys at the first installation. Before uploading a new OTA file, the certificate has been deployed to the device as part of the initial installation. ElegantOTA then require a file encrypted and/or signed with the private file. The device then cannot be updated without having access to the private certificate file. |
@silverfisk That will be a nice addition as well. We can use an approach with AES128-CBC or AES256-CBC encryption where we have a logic to buffer incoming chunks from the HTTP server and pass the buffer with correct length for decryption on-the-fly. As with CBC based encryption we already know the block size, we will be able to decrypt the file as we receive it from the user. I'm only concerned about the performance drawback which will be incurred due to decryption, I hope it doesn't deter the HTTP upload process. Very nice overall suggestions from the community! Love it. |
If anybody knows a public key cipher which can work with parallel computing ( decrypting ), then please do let us know. I really prefer public key cryptography in IoT. Till then, I only see AES to work as it's successfully implemented on the hardware level and in SDK. |
asymmetric crypto is veeery slow, so it is used only for key exchange for symmetric ciphers. |
@vortigont how slow are we talking? At least signing would be nice to validate the binary. But if it's too slow to decrypt perhaps it's better to use HTTPS to encapsulate the payload in symmetric encryption? |
@silverfisk the difference is huge, 3-5 orders of magnitude or so
RSA
actually I do not know any real life use case for asymmetric crypto other than KEX or signatures. HTTPS for fw transfer is definitely right approach to secure the transfer itself. Other than this Espressif has all the required features for signed fw in their SDK, no need to reinvent the wheel. I'm not that deep into this area, mostly use open source firmware's for my needs :) |
@vortigont Nice info regarding ciphers. Let's see if we can get at least the firmware signing integrated. Espressif does provide features like SecureBoot V2 and encryption but for ESP32 only. I'm going to make this library supported on other platforms as well so it will be a very important feature to have. |
@ayushsharma82 As for compression, I've done some dirty sketching and your front-end works pretty well with my flashz lib. Although there are some gaps that needs to be considered. Maybe open a discussion thread for this? |
@vortigont You are pretty fast :)) I'll open a discussion thread. I did some renovations in past few days which switched the webpage from ancient 'Vuejs 2' to SvelteJS framework ( 73%~ size reduction - 54KB ( old ) to 15KB ( new ) ) and changed C++ library structure. Do you want to wait for the changes to be live in a v3 branch? Or you can integrate it in the current version and I'll port it to V3 for you. ( whichever way you prefer ) Here's a sneak peak: |
nice, will continue in discussion #88 thread |
BTW size reduction is a must. 50k is too much nowadays for a simple upload form :) |
I decided to merge AsyncWebServer support with V3. The only problem I'm facing is that the files are getting included irrespective of preprocessor conditions. Even when @vortigont Can you take a look at |
When lib is being build, preprocessor directives from the main sketch are not included. |
I actually never tried it in Arduino IDE for now. Tested with PIO and it's the same in there as well which is pretty weird. I used the reference from @vshymanskyy / TinyGSM lib which also uses preprocessor directives to include appropriate library. If it works in that case then it should work in ElegantOTA as well. |
It works if you place all of your lib's code only in .h header files, i.e. no .cpp's. Headers are build on every inclusion and not processed if not included in any .cpp. Not an elegant solution, mostly used due to this ugly Arduino IDE heritage. With PIO you can use build_flags for the same purpose, no need to fit all code into .h, but in that case you will loose Arduino support. |
@vortigont My javascript oriented mind struggles with C++ haha. I've had some users pointing me out earlier when ElegantOTA had everything in a single header file, that lead to people unable include ElegantOTA header more than once ( for example usage in their own wrapper class ). Also Arduino compatibility is a must as apart from my personal interest, there are many users who use & prefer Arduino IDE. Priority 1 is to make the v3 library compatible with Arduino IDE, then comes PIO ( which will most likely work as it is bound to be compatible with Arduino IDE ) I'll try some other way if the existing v3-alpha approach doesn't work out. |
I don't know if this is needed, but reading the issues log on here, I found that the filesystem binary file for upload is supposed to be generated by the Arduino IDE (v1.8.19)compiler. When I compile for export on Debian Sid, I only get the NODEMCU binary. I can't find any spiffs binaries anywhere with Catfish. Maybe because SPIFFS is now deprecated? But LittleFS is overkill for this project and bogs me down. So if this is a real issue, and not just my ignorance, it would make sense to have a way to upload a tarball of the data folder that can be extracted to SPIFFS, or even a tool to upload files individually. EDIT! -- never mind, I found the SPIFFS.bin file location. Arduino IDE builds this in the /tmp folder on Debian. Not very nice of them IMHO. |
@ayushsharma82 with Arduino IDE you are doomed to misery, sorry. And if you are going to support other MCU's and their dependent libs it's getting even worse. So, better plan your way in advance.
you can check this PR and it's descendants to find how deep this rabbit hole goes. Actually, I'm very skeptical about seeing this resolved any time soon. I've gone through your code, can suggest some improvements besides flashz compression, but let's settle design questions before moving forward. |
@NickelNuts abandon Arduino IDE and you'll get most of your issues resolved :) |
@vortigont Good info. I just checked Blynk library. They also support multiple platforms and in their case, instead of using preprocessor directives to select the appropriate platform, they rely on users to include their platform's header file ( which is somewhat acceptable in my sense ) For example: What do you think about this approach? |
@vortigont Thanks, I have only been messing with these controllers for about a month or so, and have run into some stability issues with the Arduino IDE. I will look into PlatformIO. These projects I'm doing are not urgent, and mostly for my education, so learning another platform sounds like a good idea. That ftp server looks exactly what I need though |
@ayushsharma82 looks like you are js-biased and do not get the idea of c/cpp build system (no offense, just explaining here) :))) Builder compiles .cpp's (and .ino) files and includes headers during compilation of those files. If you write a lib than all it's .cpp's are build separately of the user code without ANY idea of what is inside users files (defines, headers, includes etc...). If inside your lib's cpp you can set guards like |
@vortigont Thanks for the detailed explanation, this will certainly help me in the long run 👍🏻.
I tried this and it worked perfectly :) we can use a combo of flags set by build system and custom definitions like |
What else would you like to suggest for the v3-alpha branch? |
I meant some code optimizations here and there. |
You may have already spotted bits of it in the v3 branch :) , I'm working on ElegantOTA Cloud ( almost complete ) which is much secure than hosting the firmware on your own. The ElegantOTA Cloud will feature:
This is geared towards businesses but I'll have a forever free plan for individuals so that they can benefit from the platform for their own projects/hobby. |
it is possible to return a special error if it does not have enough memory to upload a file ? |
Maybe my question is invalid, probably because I'm an amateur. However, how can we add other html pages to this project? Example: Access an HTML "index" on esp32's ip, without the need for a my_ip/update The second question is: |
@limaomerces The difference is that one is built for the Async Web Server. The use of the /update folder by this project leaves the web server root folder available for your html code. The best way to visualize this is probably to load an "Example" for the web server you plan to use, then add the Elegant OTA to that example. |
I realise this is asynchronous, but the ota updates often lock up at various % on one of my particular ESP8266 chips that is doing some fairly heavy lifting, so i suspect the poor little processor is struggling to run multiple tasks. would there be the ability to have some sort of callback function that runs just before the upload occurs? so I could for example, halt other processing via code when an update is running? |
one runs synchronously one runs asynchronously. use async. |
Automatic redirect to index.html(or configurable target for redirect) after OTA Sucess and some timeout(configurable). I have index.html in filesystem. ElegantOTA page in flash program space has big advantage. Work as rescue mode if filesystem is broken or not formatted. |
Just inserted AsyncElegantOTA into my project today. I couldn't believe how easy it was. Really cool! Only issue was I was already using the path /update on my AsyncWebServer, which I had to rename in my project to another path. Not a big issue, but my feature request would be configurable path for the /update for a future version. |
I'm a fairly new user of ElegantOTA, but I absolutely love it! Great work! I did think of one thing I wish it did. Before I found this thread, I took a quick look at the source code and I am pretty sure this is not a current feature of ElegantOTA, so let me suggest here. My apologies if this has already been brought up before... My ESP32 apps often use a LCD display. When the OTA update executes, the LCD just goes blank until the ESP32 reboots on the newly downloaded .bin file. I would like to be able to flash a message on the LCD stating that an OTA update is in progress, please wait. Not sure the best way to implement this, but one would be to add the ability to register a callback function pointer. By default, this function pointer would be null so nothing would be any different from now. But if the app had registered the function pointer, the function would get called one or more times (you decide) to inform the application that an OTA update is starting, finished, rebooting, whatever. You will know far better than I what state ElegantOTA goes through internally and will know which states it may be useful for the app to know about. I also would not have the callback function pass any actual message text; I think it would be better to simply pass an integer value that has one or more values defined. Let the app itself create the message it wants to display based on this integer code, the type of output device it has access to, etc. Another advantage of this would be for apps that have some sort of logging mechanism, or work in conjunction with other processors via MQTT. It would allow the app to log the OTA occurrence, broadcast a MQTT message, etc. It would be SUPER nice (but definitely an extra) if information on the .bin file that is being installed was passed; perhaps file name, file update timestamp, etc. I assume (from much low-level prior experience with HTTP on other platforms) that there is probably already a way to get info on the remote client (the IP address) that executed the OTA. |
As many of you I integrated this library into my project and it worked flawlessly in a matter of minutes. I use version 2.2.6 with some custom modifications. |
@dmitrykez I like your idea and I thought I would expand on it. It would be great if something like you would upload a zip file which would contain a config file and the firmware or file system or both. The config file would contain the names of the firmware/filesystem to be applied and a md5/sha hash for each file which the esp32 could compare to the hash listed in the config file. If the hashes do not match then the upgrade would not be completed and you would have to re upload. The config file could also possibly contain version numbers so it could only apply newer versions and not older version. |
@doanerock For debug purposes I need to downgrade sometimes. |
Hello, I have tried your library on the ESP8266 and liked it very much. However, I would like to migrate my project to the raspberry pi pico W now. Can you provide a version for this micro? I would be ready to test... |
@DiverBW , Someone recently created a pull request with exactly these "callbacks" added in the code. Soon I'll release it under the same v2 source. Thanks for the comment! |
Hi is it possible to not require STA mode but say, use AP mode so that a client (eg. Smartphone could connect with the sole purpose of performing a remote upload? I have used elegant no problems in my own wifi LAN (and a commercially available alternative supporting remote OTA over the internet) but in some use cases there is no wifi LAN, or at least none with access permission or credentials known. A workaround is a small battery powered wifi router I have to carry with me; but surely this could be done in software? |
@robhellstrom I was thinking the same and then integrate it with a WiFiManager as well so the AP mode has one entry point to set both the WiFi and do an OTA upgrade. |
Hi, it will be great to be able to call the url with all variables already in it: IP + FW filename and then the FW update starts automatically without further screen input and button presses e.g. By sending the URL to the browser the IP should be started and the fw file selected and added and start the OTA automatically. Perhaps a 2nd page to call without any nice to haves or graphics even to speed up the process. |
A bit update on the previous V3 plan. It is now divided in 2 phases. Phase 1 is already done where I update the library to include improvements, UI optimization and gear it towards almost all wireless platforms instead of just focusing on ESP devices. Phase 2 will commence in a few months where Cloud support will be added to the library. |
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. |
This issue was closed because it has been stalled for 5 days with no activity. |
Hello everyone!
It has been 3 years since I created this library and it has received unprecedented love from the open-source community which has been the driving force to keep enhancing this library.
Today marks as a stepping stone for V3 of ElegantOTA which will further reduce the size of webpage, add exciting new features, potential bug fixes with new optimized source code and most importantly support for new microcontrollers.
To make this possible, I'll need your help in figuring out what's best and what you guys need in ElegantOTA. So comment down any feature you feel is missing in ElegantOTA and I'll add it in my project plan.
Supporting New Platforms:
For past 3 years ElegantOTA has been stuck with ESP32 and ESP8266 but now I wish to increase the coverage of ElegantOTA so that more people can make use of it to update their microcontroller conveniently. If you know or work with any microcontroller ( other than ESP32 or ESP8266 ) that has OTA capability please write it down in the comments below. I'll look into it.
The microcontroller doesn't necessarily needs to have in-built WiFi, it can also be a NCP ( Network Co-Processor ) architecture like Nano 33 IoT.
The text was updated successfully, but these errors were encountered: