custom bootloader to update main firmware/application

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Thu Apr 19, 2018 2:33 pm

ok, understood.

Let me try out first using http get method to upgrade my firmware without encryption and not using http secure version.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Thu Apr 19, 2018 4:36 pm

Hi,

With regard to your suggestion to include all my web files( .html, .js etc) within same .bin file
I need to retrieve each file and write flash disk for web files.
I better enumerate FTP/HTTP server and do ftp/http get file and write contents into flash disk.
and handle .bin file extension first and update firmware and then put web files one by one.

It would be better.

I can start HTTP or FTP server on my host windows 7/10 machine. I am looking using libCurl to do ftp get file from esp32 device.

On windows platform. I need to start Http server or FTP server to host all files to be download by esp32 device.

Can some suggest good C++ library for Windows host machine.
I did not found any example of using libCurl for FTP/HTTP server on windows platform.

I need to select library which later support HTTPS and FTPS (secured version) as well later.

I found following for windows machine.

1- https://github.com/mkulke/ftplibpp for FTP server.
2- boost asio /Beast library for HTTP server

I need library which works alteast with SSL and on windows platform.

Does this sound logical?

Thanks,
Naeem

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Thu Apr 19, 2018 7:31 pm

Another easy option for me.

I start Http server on esp32 device. I wait for http put file.

from host Windows machine. I transfer file via Http file. bin file and web files one by one.
Do i get file contents piece by piece until completed? Can I do OTA in this case?

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Fri Apr 20, 2018 1:44 pm

Hi,

Kindly give me best option for me.

Option #1 :

Implement FTP server then FTP client on host machine ftp .bin and each web file on by one (we implement this in Keil RTX RTOS platform).
Once we upgrade our firmware we ftp web files.


Option #2 :

Implement HTTP server. Post/Put .bin and each web file on by one

Current HTTP server supports POST and put. I donot find example how to do Http put file.

Option #3 :

Example/Sample of OTA. which connect to Http server running on host machine. and do Http get chunk by chunk and write to OTA.
I need to implement Http Server on windows machine. Or FTP server as another option.

Not sure how we can do web files.either http get zip file and unzip and write each web files. they will be about 20 files I need to write flash drive after OTA operation is completed.

Kindly give me your thoughts best and easy way.

Keep in mind in future we need encrypted .bin write to OTA and HTTPS or FTPS session.

Before I processed I need expert opinion.

First option is preference for us If we can make FTP Server or HTTP server working on ESP32. not sure feasible.
If some one can write for me standalone FTP Server class which can handle FTP put and get and browser Files.
Or
If some one can write for me standalone HTTP Server class which can handle Http put and get and browser Files.

Not sure difference between Http put and Http post for files.

Thanks,
Naeem

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: custom bootloader to update main firmware/application

Postby kolban » Fri Apr 20, 2018 2:42 pm

Howdy,
There are a number of excellent HTTP server implementations available for the ESP32. If we were chatting, I'd probably start asking you "What is it you wish to achieve?" ... rather than examine ALL possible options of moving data into an ESP32, I'd suggest you define which one you actually want to achieve. Is the protocol to be FTP or HTTP or MQTT or raw sockets or something else? Do you want the ESP32 to pull data from the external servers or do you want the external servers to push data to the ESP32?

I would consider these core intrinsics. It might also help to understand if this is a hobby project or a commercial production project which would need more "robustness".

Please remember that this is a forum of community members that are looking to exchange knowledge, tips and techniques and have technical questions answered. Requests for someone to write you code (while possible) is relatively unlikely without engaging them for some form of contract. You will likely be rewarded with pointers to existing libraries and challenged to go forth and implement them yourself.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Fri Apr 20, 2018 2:56 pm

Hi Kolban,

Yes I know HTTP server implementations by you for ESP32.
I need example program how to use to send file over http chunk by chunk using your HttpServer class. I am happy with Http protocol.


Yes I know this is a forum of community members that are looking to exchange knowledge, tips and techniques and have technical questions answered.

I am not asking to write library for me. I was asking If some one already done open source project.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Sun Apr 22, 2018 8:06 pm

Is this good sample

https://github.com/nkolban/ESP32_Explorer

to http upload/put file to Http Server .

Is this way forward.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Sun Apr 22, 2018 8:50 pm

LibCurl seems better approach.

Using FTP client or http client on ESP32 to download/get file from Http Server running to host machine.

https://github.com/loboris/ESP32_curl_example

Let me know your thoughts.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: custom bootloader to update main firmware/application

Postby kolban » Sun Apr 22, 2018 9:58 pm

At the highest level, I think you need to decide on your desired design. If you embed an HTTP server in the ESP32, then the ESP32 is a passive component to which requests will be pushed. If you embed an HTTP client call or an FTP client call in your ESP32, it becomes an active component that will explicitly pull data into it when it makes the active requests. Which one you choose will be a function of what your design intents are.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: custom bootloader to update main firmware/application

Postby snahmad75 » Mon Apr 23, 2018 4:47 am

Now I have clear options. Benefit of embed an HTTP client call within ESP32 is that I can have current web site running. I can trigger update from JavaScript. It can fetch from certain Http web server the updated web files and .bin(firmware file).


I will go Http client option on ESP32. no need to look for FTP client option.

Now only question remain is to use libCurl or different method to use HttpClient on ESP32.

Who is online

Users browsing this forum: No registered users and 120 guests