Esp32 dfu update wont read chunk

I am attempting to use your esp32 dfu update example and the first chunk fails when read from the notecard to the host mcu.

{"err":"transaction incomplete"}
dfu: error on read: transaction incomplete
dfu: reading chunk (offset:0 length:8192 try:2)

I have tried increasing the size of #define ALLOC_CHUNK 128 in n_lib.h to accept a full 8192 buffer, but that was unsuccessful. Full log of debug output from esp32 is below. It will repeat this 5 times and then fail / terminate the dfu session.

{"req":"hub.sync"}
{}

sync: wireless starting communications {wait-module} {connecting}
sync: wireless modem now ON {modem-on}
sync: wireless obtaining essential configuration information from modem
sync: wireless modem now OFF (was active 13 sec, 0 bytes transferred) {modem-off}
sync: wireless starting communications {wait-module} {connecting}
sync: wireless modem now ON {modem-on}
sync: wireless waiting for wireless service {wait-service} {connecting}
sync: wireless waiting for wireless service 1 sec [----] {cell-registration-wait}
sync: wireless waiting for wireless service 5 sec [+---] {cell-registration-wait}
sync: wireless cellular radio emtc band LTE BAND 12
sync: wireless waiting for wireless service 9 sec [++--] {cell-registration-wait}
sync: wireless waiting for data service {wait-data} {connecting}
sync: wireless network registration took 27 sec
sync: wireless connected {connected-closed}
sync: project using product UID product:com.xxxxxx
sync: notehub opened notehub {notehub-connected}
sync: work begin (anything pending) {sync-begin}
sync: work upload-notebox (14 changes) {sync-get-local-changes}
sync: work download-notebox (14 changes) {sync-get-remote-changes}
sync: work uploads _env.dbs (2 changes) {sync-get-local-changes}
sync: work download _env.dbs (5 changes) {sync-get-remote-changes}
sync: work uploads _env.dbs (1 changes) {sync-get-local-changes}
sync: work uploads _env.dbs (2 changes) {sync-get-local-changes}
sync: work completed {sync-end}
sync: work begin (anything pending) {sync-begin}
sync: work completed (nothing was pending) {sync-end}
sync: notehub closed notehub {notehub-disconnected}
sync: wireless modem now OFF (was active 54 sec, 18394 bytes transferred) {modem-off}
{"req":"dfu.status"}
{"body":{"crc32":498367444,"created":1611705692,"firmware":{"builder":"CA_Development","built":"Jan 26 2021 18:59:36","description":"Test Device","firmware":"notecard-esp32-dfu-example-v111","org":xxxxx","product":"Notecard ESP32 DFU Example","ver_major":1,"ver_minor":1,"ver_patch":1,"version":"1.1.1"},"info":{},"length":261856,"md5":"3bae0413e7ed4a2d5147a5dbb7e0d3e5","modified":1611705692,"name":"firmware$20210127000132.bin","notes":"for dfu testing","source":"firmware.bin","type":"firmware"},"status":"successfully downloaded","mode":"ready","on":true}

dfu: replacing current image: Ver 1.1.0 Jan 26 2021 20:01:59
dfu:   with downloaded image: firmware$20210127000132.bin
{"req":"hub.status"}
{"status":"idle (since 2021-01-27T01:36:55Z) {disconnected} {idle}"}

{"req":"hub.set","mode":"dfu"}
{}

{"req":"dfu.get"}
{"err":"DFU mode is not yet fully active: idle (since 2021-01-27T01:36:55Z) {disconnected} {idle}"}

{"req":"dfu.get"}
{"err":"DFU mode is not yet fully active: 2s starting communications {wait-module} {connecting}"}
{"req":"dfu.get"}
{"err":"DFU mode is not yet fully active: 5s starting communications {wait-module} {connecting}"}
{"req":"dfu.get"}
{"body":{"crc32":498367444,"created":1611705692,"firmware":{"builder":"CA_Development","built":"Jan 26 2021 18:59:36","description":"Test Device","firmware":"notecard-esp32-dfu-example-v111","org":"Charge Analytics LLCxxxxExample","ver_major":1,"ver_minor":1,"ver_patch":1,"version":"1.1.1"},"info":{},"length":261856,"md5":"3bae0413e7ed4a2d5147a5dbb7e0d3e5","modified":1611705692,"name":"firmware$20210127000132.bin","notes":"for dfu testing","source":"firmware.bin","type":"firmware"}}

dfu: running partition type 0 subtype 16 (offset 0x00010000)
dfu: writing to partition subtype 17 at offset 0x150000
dfu: beginning firmware update
dfu: reading chunk (offset:0 length:8192 try:1)
{"req":"dfu.get","offset":0,"length":8192}
received only partial reply after timeout:
{"body":{"crc32":498367444,"created":1611705692,"firmware":{"builder":"CA_Development","built":"Jan 26 2021 18:59:36","description":"Test Device","firmware":"notecard-esp32-dfu-example-v111","org":"xxxx","product":"Notecard ESP32 DFU Example","ver_major":1,"ver_minor":1,"ver_patch":1,"version":"1.1.1"},"info":{},"length":261856,"md5":"3bae0413e7ed4a2d5147a5dbb7e0d3e5","modified":1611705692,"name":"firmware$20210127000132.bin","notes":"for dfu testing","source":"firmware.bin","type":"firmware"},"payload":"6QYCIPQjCEDuAAAAAAAAAAAAAAAAAAABIABAP/DwAAAAAAAAAADgP5qZmZmZmak/exSuR+F6dD/8qfHSTWJAPy1DHOviNgo/8WjjiLX41D6N7bWg98agPkivvJry12o+Ooww4o55NT6V1iboCy4BPru919nffMs9RmcNQMJmDUAgZw1ARmcNQGlnDUCMZw1AjGcNQIxnDUCMZw1A5mYNQDJnDUBGZw1AaWcNQN1vDUBabw1AuG8NQN1vDUABcA1AJHANQCRwDUAkcA1AJHANQH5vDUDJbw1A3W8NQAFwDUAAAAAAAAAAgAAAAKAAAADAAAAA4BQUFAcA//8AAAAAAAAAAABIAAAASAAAAEgAAABIAAAASAAAAEgAAABIAAAAAQAAAAAAAAAFAAAAGQAAAH0AAAAAAAAAvInYl7LSnDwzp6jVI/ZJOT2n9ET9D6UynZeMzwi6WyVDb6xkKAbICgCA4Dd5w0FDF24FtbW4k0b1+T/pA084TTIdMPlId4JaPL9zf91PFXUAAAAAAADwPwAAAAAAACRAAAAAAAAAWUAAAAAAAECPQAAAAAAAiMNAAAAAAABq+EAAAAAAgIQuQQAAAADQEmNBAAAAAITXl0EAAAAAZc3NQQAAACBfoAJCAAAA6HZIN0IAAACilBptQgAAQOWcMKJCAACQHsS81kIAADQm9WsMQwCA4Dd5w0FDAKDYhVc0dkMAyE5nbcGrQwA9kWDkWOFDQIy1eB2vFURQ7+LW5BpLRJLVTQbP8IBE9krhxwIttUS0ndl5Q3jqRM7uDUAR7A1AFuwNQG3sDUCf7g1Ane4NQEjuDUBs7g1A+O8NQKHsDUDi7w1A7e8NQPjvDUD47w1A+O8NQKHsDUCh7A1AoewNQKHsDUCh7A1AoewNQKHsDUDt7w1AoewNQKHsDUCh7A1A1+8NQKHsDUDt7w1AoewNQKHsDUCG7A1AoewNQKHsDUCh7A1AoewNQKHsDUCh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5vdGUsIHJlcXVpcmVzIGxvb3Agdm9sdGFnZSB0byBiZSBmdW5jdGlvbi4ASW5pdGlhbGl6ZSBEQUMgU3VjY2Vzcy4ASW5pdGlhbGl6ZSBEQUMgRmFpbGVkLgBncGlveERpc3BsYXlCZC5kaWdpdGFsV3JpdGUoKSBmYWlsdXJlLgBTdGFydGluZyBjZWxsdWxhciBjb25uZWN0aW9uLgBFc3RhYmxpc2hpbmcgY2xvdWQgY29ubmVjdGlvbi4AY29tLmNoYXJnZS1hbmFseXRpY3MuZWNsaW5lOmRldmVsb3BtZW50MQBwcm9kdWN0AGNvbnRpbnVvdXMATm90ZWNhcmQgc2VuZFJlcXVlc3QgRkFJTEVELgBmaXJtd2FyZTo6aW5mbzp7Im9yZyI6IkNoYXJnZSBBbmFseXRpY3MgTExDIiwicHJvZHVjdCI6Ik5vdGVjYXJkIEVTUDMyIERGVSBFeGFtcGxlIiwiZGVzY3JpcHRpb24iOiJUZXN0IERldmljZSIsImZpcm13YXJlIjoibm90ZWNhcmQtZXNwMzItZGZ1LWV4YW1wbGUtdjExMSIsInZlcnNpb24iOiIxLjEuMSIsImJ1aWx0IjoiSmFuIDI2IDIwMjEgMTg6NTk6MzYiLCJ2ZXJfbWFqb3IiOjEsInZlcl9taW5vciI6MS
{"err":"transaction incomplete"}
dfu: error on read: transaction incomplete
dfu: reading chunk (offset:0 length:8192 try:2)
serial reset

Hello @ec123!

Thanks for joining our community, we are glad to have you!

First, let me attempt to recreate your issue, then I will report my findings back here.

In the meanwhile, could you describe your hardware configuration? Are you using our Notecarrier-AF with the ESP32 Feather, or something else entirely?

Cheers,
Zak

Hi Zak - we have a custom PCB with both ESP32-WROOM-32E(4MB) and notecard on it. It is a very basic application and there is plenty of RAM and FLASH free. The notecard works properly otherwise, we have run it for many hours, sending outbound data to notehub every 10 minutes without issue, and the notecard didnā€™t seem to have any problems downloading the new firmware from notehub first try. We are getting this same error on multiple boards/multiple notecards.

Best, Ed

Hi Ed,

I had a similar problem with the old example code, and Iā€™m currently updating the example code and our tutorial.

Are you using the vanilla firmware from the example code linked in the tutorial on https://dev.blues.io, or has it been modified?

~Zak

I used this tutorial

A few other things I noticed:

  1. dfu wonā€™t start if the notecard is in continuous mode. It says it has to wait for cell connection to close, but the dfu code doesnā€™t close it. So probably need you to advise best way to handle that, do we have to manually shut off sync, then do dfu check, then put it back into continuous mode? Maybe the dfu code example should provide that option? duf does start if the card is set in periodic mode.
  2. when the dfu error occurred, the dfu code exited after 5 failed attempts as expected. However the modem was in a strange state, the network led was short flash on, meaning searching for a tower, but it never connected to a tower as expected. It remained this way for over 10min then turned off, which I believe is the dfu failsafe kicking in to allow you to ā€˜come back to lifeā€™ if the dfu process failsā€¦the failsafe seemed to work, but the modem behavior was strange.

Best, Ed

Ed,

Good news. Both of those issues have been addressed in the updated example code.

Iā€™ll push the changes in the next couple of hours.

~Zak

2 Likes

As promisedā€¦

I have a PR out for you to test. This resolves both the issues you mentioned in the previous post, and I hope it will also resolve your original issue. It also resolved a similar (but not same) issue for me.

If you will flash the esp32-dfu-v1.1.1.1.ino sketch onto your ESP32, then I would expect it to successfully install your firmware that has been downloaded to the Notecard. Remember, once it updates, then it will not be able to update back, because it will have installed the ā€œoldā€ CRC firmware back onto the device.

I have not had a chance to refactor the tutorial from the documentation. I will be updating the tutorial, and refactoring the DFU utility over the next couple of days.

Let me know if you have any issues,
Zak

Hi Zak - unfortunately I get the same results
{"err":"transaction incomplete"}

Note, I am using platformIO, not stock arduino IDE. I donā€™t believe that will make any difference, but wanted to let you know. I am using notecard arduino library 1.2.10.

Ed

I know you said you were using custom hardware, and that youā€™ve had great luck so far. However, I would like to explore that angle as we diagnose other options.

If you donā€™t mind, I would like to ask a couple of questions to eliminate some assumptions, and make sure I have all the facts.

  • Does your hardware communicate with the Notecard over UART, or I2C?
  • Are you flashing the tutorial application verbatim, or are you making changes other than updating the ProductUID?

As an aside, I havenā€™t personally used PlatformIO, but I believe others have used the Notecard and PlatformIO successfully. At this time, I donā€™t believe PlatformIO to be an issue.

ec123

Tried with the latest firmware?

regards,
Rob Oudendijk

Yes, I have installed v1.2.10 of the library in platformIO, below is the libary.properties file as shown in VSCode IDE:

name=Blues Wireless Notecard version=1.2.10 author=Blues Wireless maintainer=Blues Wireless <info@blues.io> sentence=An easy to use Notecard Library for Arduino. paragraph=Supports Serial and I2C for communication from a host MCU. category=Communication url=https://github.com/blues/note-arduino architectures=*

Can you confirm how long the serial transmission from the notecard ā†’ host should be when loading an 8k chunk? I believe it is (1/9600)108192 = 8.5sec minimum. I am seeing the Red LED on the notecard light up solid for only around 2 seconds. I have tried to extend the UART timeout to 30 sec by modifying this line in (2) places within notecard.cpp:
_notecardSerial->begin(_notecardSerialSpeed, SERIAL_8N1, 4, 2, false, 30000);

Ed

Hi Ed,

I donā€™t know if you saw my post (above Robā€™s), but I had two questions.

  1. Does your hardware communicate with the Notecard over UART, or I2C?
  2. Are you flashing the tutorial application verbatim, or are you making changes other than updating the ProductUID ?

Sounds like the answer to #1, is UART. This gives me an idea. I will check my hunch with the appropriate team and respond back here.

~Zak

  1. UART, Serial1 on GPIO 2 and 4, notecard.cpp modified as shown above to initialize serial port.
  2. Iā€™m using platformIO as follows:
    a. Start new platform IO project, select ESP32dev board and Arduino framework.
    b. Install notecard library v 1.2.10
    c. Replace main.cpp with your .ino PR code
    d. Replace main.h with your PR code
    e. Create new files dfu.cpp and dfu.h from your PR code.
    f. Only change other than serial port and product id is to force button doublepress 5 seconds after boot so the application automatically goes to BUTTON_DOUBLEPRESS case.

Thx,
Ed

Ed,

I was able to reproduce your error, and it turns out the chunk size was too big. Thank you for pointing this out!

The chunk size can be updated in here in dfu.cpp.

In the sample, we reduced the chunk size by half (to 4096) just to be safe, but in my testing, I was able to reach a maximum reliable chunk size of 6900.

Please give the latest firmware a test, and let us know if it fixes your problem.

Best,
Zak

Hello, I am not sure if this is the correct place in the forum. I am trying to learn about updating the ESP32 firmware through the air on notehub. Do I need to connect the notecard to the ESP32 with I2C only or do I need serial also? Do I need any other hardwire signal between notecard and ESP32 becide I2C?

Thank you very much in advance for any guidance!

You can use either I2C or UART.

We have created a guide to help you understand everything that is required for you to update the ESP32:

I would suggest starting there, then returning to the forum if you run into trouble.

Best,
Zak

1 Like