P2 Executable file validation
ke4pjw
Posts: 1,155
in Propeller 2
Is there something like a CRC included in the Binary file generated by proptool?
I am writing an "over the air" firmware updater for my light controller, and to validate the file it downloaded from the internet I would like to use a CRC or an MD5 hash. This is just to make sure that the file is accurate. I can manually add a CRC to the document it checks for updates, but I would rather not, if I can get away with it.
Thanks,
Terry
Comments
IIRC no, there's no checksum in the binary, the serial loader computes and appends it on the fly. That checksum is just a sum of longs, which isn't as good as CRC.
So, after fighting (and losing) with my web hosting provider to try and disable SSL redirects, I decided to just use Azure Blob Storage to distribute updates. It's free for up to 5GB. It is fortuitous that blob storage provides a base64 encoded MD5 hash of the file in the http response headers. So that looks like the best route as a whole. I won't have to manually create the validation hash. W00T!
Pretty sure there are base64 decode and MD5 objects for spin1 already out there.
Ha! Edge hosting an Edge !
It's real now. Over the air updates by Monday morning or bust!
Looks like a bust for today. I am able download a manifest file, parse that file and download the files in the manifest. I can check for and create a DOWNLOAD and BACKUP folder on the SD card. The problem is I cannot figure out how to get the FAT32 driver to open files for writing, or capture the actual error. I need to study more about how abort works. A simple return value would have been easier IMHO, but I suspect they wanted to be able to bubble an error all the way up and abort is a way to do that.
So, this is progress from the weekend:
Neat! And not really a full bust, as you've figured so much along the way !
I sat up right out of bed this morning realizing I didn't create the file before attempting to write to it. As we say in the south, I was "stuck on stupid". I will update the code and try it this evening.
Further updates to this will be in the "Blitzen 24" E1.31 Pixel Light Controller Updates thread. thread