Dedicated or combined OTA
Dedicated or combined OTA
I wrote a program that has a Web interface to work with, additionally I want to make a button for OTA.
The program itself contains 4 areas
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x100000,
storage, data, fat, 0x200000, 2M,
I don't understand how I should make part of the code for an OTA update.
1. Make a separate area with the OTA program, which transfer control to download and place in the same memory areas instead of the old data
2. To make a General program code with the OTA and update all together in a new memory area
2.1 what area of storage (fatfs) because it is also necessary to update
What are the solutions?
The program itself contains 4 areas
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x100000,
storage, data, fat, 0x200000, 2M,
I don't understand how I should make part of the code for an OTA update.
1. Make a separate area with the OTA program, which transfer control to download and place in the same memory areas instead of the old data
2. To make a General program code with the OTA and update all together in a new memory area
2.1 what area of storage (fatfs) because it is also necessary to update
What are the solutions?
Re: Dedicated or combined OTA
Here, have a read of this. Ota is handled through 2 separate "ota" partitions.
https://docs.espressif.com/projects/esp ... m/ota.html
https://docs.espressif.com/projects/esp ... m/ota.html
Re: Dedicated or combined OTA
If you are using a board with the standard 4MB of flash then you don't really have enough free space.
John A
John A
Re: Dedicated or combined OTA
I have 16 mb.
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 1M
ota_0, app, ota_0, 0x110000, 1M
ota_1, app, ota_1, 0x210000, 1M
storage, data, fat, 0x400000, 2M
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 1M
ota_0, app, ota_0, 0x110000, 1M
ota_1, app, ota_1, 0x210000, 1M
storage, data, fat, 0x400000, 2M
Re: Dedicated or combined OTA
Hi,brp80000 wrote:I have 16 mb.
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 1M
ota_0, app, ota_0, 0x110000, 1M
ota_1, app, ota_1, 0x210000, 1M
storage, data, fat, 0x400000, 2M
If above is Partition Mechanism for your 16 MB flash memory then you can use standard OTA Mechanism to update your device firmware without any difficulties.
You can use something like below mechanis to update firmware.
1) Decide Firmware Download Location other then above configuration and store that firmware into that location.
2) Once firmware download process is completed with verification process then check current firmware is running into which partition.
3) Update firmware into other partition and switch current firmware to that location
4) So, Above way you can update firmware using OTA mechanism as per you requirement.
Let me know if need any help regarding that.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Dedicated or combined OTA
How can I update fatfs
storage, data, fat, 0x400000, 2M
via OTA?
storage, data, fat, 0x400000, 2M
via OTA?
Re: Dedicated or combined OTA
OTA is incredibly simple once you have the partitions on your flash set up. It's literally just a couple lines of code (caveat, I removed the certificate check in esp_https_ota).
To write to your file system, you are going to need a method of downloading a file and writing it to your file system. The esp_https_ota source in the components directory would be a good example of using esp_http_client to download it.
John A
Code: Select all
memset((void*)&client,0,sizeof(esp_http_client_config_t));
client.url = "https://www.somedomain.com/mybuild.bin";
int ret = esp_https_ota(&client);
John A
Re: Dedicated or combined OTA
Now I am trying to install the certificate but have a problem with .rnd
Re: Dedicated or combined OTA
Hi,
Would you please try without secure connection first to validate OTA process?
If that works fine then I suggest to go for secure connection for same.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Dedicated or combined OTA
Its too not work. But it once worked and now get error
esp_http_client_config_t config = {
.url = EXAMPLE_SERVER_URL,
//.cert_pem = (char *)server_cert_pem_start,
};
esp_http_client_config_t config = {
.url = EXAMPLE_SERVER_URL,
//.cert_pem = (char *)server_cert_pem_start,
};
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot] and 84 guests