Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Arthur Khusnutdinov
#88772 Hello.

I have some kind of smart home on multiple esp8266, and I periodically update code of their firmwares via OTA.
And sometimes I forget to upload actual code on them. For example, I don't remember, if I uploaded a new version of firmware to esp8266, that serves in toilet :) .

Each of esp8266 firmware is *.bin file, if I understood it correctly. Each of file has time of creation.
And question is - does esp8266 stores date and time of firmware, uploaded via OTA (or update) and is there any Arduino program method to get that date and time?
User avatar
By quackmore
#88793 The gcc option -D NAME defines a preprocessor macro NAME from the command line

I use it to generate the firmware version at compile time

the following example works on linux, and I'm not using Arduino, so checkout if you can adapt it to your environment

Code: Select allthe following compiler flag defines a preprocessor macro with the git version

-DAPP_RELEASE=\"$($(shell git --no-pager describe --tags --always --dirty))\"

changing it to
-DFILE_DATE=\"$($(shell date))\"

it's like you define the following
#define FILE_DATE "current_date"
and you can then use the macro FILE_DATE inside your code