I think this is my first time posting to these forums so please forgive me for any lack of typical/customary requirements.
I have a Giga with the DisplayShield. I have been able to use an older version of the LVGL library for UI based user-friendly configuration/navigation. I have managed to get a user configurable WiFi connection (through the lvgl library UI) working and have managed to be able to store configuration information through the kv_store library, retrieve by ntp and set the UTC time when available, and write a log file to an attached USB pen drive.
I plan to have multiples of these devices for managing systems across multiple customers that will need to be individually tracked. For the first iteration of this I want to use the built-in WiFi MAC address as a temporary serial number to keep customers' data separated. I understand that MAC addresses aren't truly unique but it's close enough for startup.
My question is; is it even possible to retrieve the built-in WiFi's MAC address WITHOUT/BEFORE an active WiFi connection to an AP. I have already tried both overloaded calls to WiFi::macAddress and neither work until WiFi connects. I need it before WiFi connects or is even available so I can insert it into the log file.
Again, neither work until AFTER a WiFi connection has been established (I already tried both before posting here), I need it before that. Is it possible? Is there a library-less work-around instead?
I'm a bit confused. How will you access the remote device to retrieve this information if it is not connected to WiFi? Alternatively, you could use one of the Dallas temperature sensors. Each sensor has a unique serial number, which could help identify the device.
update: scratch that for the moment, not working for me - investigating
update: getUniqueSerialNumber always returns zero (I'll raise a git issue) but HAL_GetUIDw0(), HAL_GetUIDw1() and HAL_GetUIDw2() strung together is unique - if that's of any use.
C:\Users\User\Documents\Arduino\agsmac\SerialNumber.cpp: In function 'uint8_t getUniqueSerialNumber(uint8_t*)':
C:\Users\User\Documents\Arduino\agsmac\SerialNumber.cpp:12:3: error: 'utox8' was not declared in this scope
utox8(HAL_GetUIDw0(), &name[0]);
^~~~~
C:\Users\User\Documents\Arduino\agsmac\SerialNumber.cpp:12:3: note: suggested alternative: 'utoa'
utox8(HAL_GetUIDw0(), &name[0]);
^~~~~
utoa
exit status 1
Compilation error: 'utox8' was not declared in this scope
I realized that after compiling and seeing duplicate definitions of both. I also see that the function returns "0". I've copied them out and added _ex to the end and I'm trying to figure out what's going on.
If you take a look at the Arduino team response to the git issue I raised it'll explain how it's setup to work. For my purposes the snprintf option is simpler.
hex-literal is the character sequence 0x or the character sequence 0X followed by one or more hexadecimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, A, b, B, c, C, d, D, e, E, f, F)