Download bin file using BG-95 send it to esp32 via uart & write bin file in OTA partition

komal nagda
Posts: 4
Joined: Thu Jul 29, 2021 5:44 am

Download bin file using BG-95 send it to esp32 via uart & write bin file in OTA partition

Postby komal nagda » Mon Oct 04, 2021 1:38 pm

We are usinf bg-95 module with esp32 in vs code - esp idf . we have connected esp32 with bg96 via uart. we are trying to download /bin file from aws, we have tried to download txt, pdf files successfully, but while downloading bin file we are lossing some data in between first byte and last byte data. the data receiving pattern is first we have used uart receive function,in that we are receiving 1024 bytes of data in every call,so our file is 165105 bytes, in this scenario if we devided 165105 by 1024 times, we got 162 so for 162 times our uart function willl receive data then after we have added that id data is zero we will break the loop. so this is bin file receive via uart. now inside ull code we have taken some parts of native ota example , like partition, get partiton, ota begin, ota write , ota end, set partiton, insode it we have execute code from partition to ota begin success fully successfully. now inside while loop we jhave call uart function and just after uart function we have call ota write function , in example ota receiving file writing 1024 byte every times it receive from https call, and here we are doing same, we are calling uart function that that receive 1024 bytes at each call we have write ota write function just after it so it will write data of 1024 byte at each time beacuse its inside while loop as i say earlier, now we have taken a counter to test how many times while loop is wroking, as per out calculation it should be 162 times but counter only repeted 125 to 142 times , and it is not fix, we have also check uart data using external cute terminal, that showd us some data in between first and last byte is missing so we have stuck here. also after writin avalilable data received from uart we have got error at ota end. we have as many times edited the code the error are changing at last we have got error esp image checksum files calculated 0x04 read 0x00, so kindly help required. i am sharing my code details here.
Attachments
Screenshot from 2021-10-04 11-16-09.png
Screenshot from 2021-10-04 11-16-09.png (389.36 KiB) Viewed 2535 times
partitions.csv
(305 Bytes) Downloaded 260 times
native_ota_example.c
(38.9 KiB) Downloaded 302 times

chegewara
Posts: 2358
Joined: Wed Jun 14, 2017 9:00 pm

Re: Download bin file using BG-95 send it to esp32 via uart & write bin file in OTA partition

Postby chegewara » Fri Oct 22, 2021 12:00 am

Next to each "count xxx" you have red (E), you should read it and try to understand why.

Who is online

Users browsing this forum: No registered users and 102 guests