0

I want to download a bin file from server for OTA process. But how I can download the whole file without any error. I am using esp8266 on Arduino IDE core. For OTA, I am using updater class of esp8266 core library. Is it good to use error checking method like CRC check? If yes how I can implement it?

Thanks!

  • IDE: Arduino IDE
  • Board: NodeMCU 1.0 (ESP8266)
  • 1
    Network transfer does some error checking already. Do you verify the file content after writing it to the NodeMCU memory? If you are *really* concerned, you might consider this as well ... – datafiddler Jun 24 '21 at 09:01

1 Answers1

1

Yes, you should checksum or hash the image and verify it before trusting it. ESP8266 library has built-in MD5, SHA1 and SHA256 implementations that would be good for this.

The ArduinoOTA class implementation bundled with ESP8266 uses MD5 or SHA256 for validation.

I need to implement a similar OTA tool. I'll try to report back later when I have actually done it.

Phil Hord
  • 12,780
  • 1
  • 26
  • 30