These are chat archives for esp8266/Arduino

17th
Sep 2017
brutzler
@brutzler
Sep 17 2017 15:24
Hi, perhaps a stupid question.
Is there any possibility to check if the code in the flash of an ESP is the same as the actual opened source in Arduino IDE?
riataman
@riataman
Sep 17 2017 15:25
probably not
not directly ..
you could cook up your own solution, but making your sketch print its own source hash or something. not that simple.
brutzler
@brutzler
Sep 17 2017 15:26
and indirectly?
riataman
@riataman
Sep 17 2017 15:26
you will need to incorporate code yourself to do that
I'm guessing with esptool you could download the binary out of the esp8266
and you can compare it with a binary you have
if you keep the binary you could compare thosre
stil the source can be the same, but the binary different
brutzler
@brutzler
Sep 17 2017 15:29
same source, different binary? thats the dead end...
riataman
@riataman
Sep 17 2017 15:29
anyway, there's no easy way to do it
the easy way is to incorporate a Serial.print("Version v1.2") to your sketch
and remember to change it everytime you make changes
brutzler
@brutzler
Sep 17 2017 15:31
I thought the same way. Compile the sources and compare the binary file to the data reloaded from the flash. But if there is a different result on compiling the sources twice..... forget it
riataman
@riataman
Sep 17 2017 15:31
yeah, I don't think the compiler does reproducible builds ..
you can try I guess?
brutzler
@brutzler
Sep 17 2017 15:35
Once on a project, I used this:
__DATE__ and __TIME__
on a html-page.
There I could see the compiling date and time.
Half the way....
Martin Ayotte
@martinayotte
Sep 17 2017 20:02
I'm using those DATE and TIME since more than a year ...