-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Gen 3] Fix warm boot; [Tracker] Cache ESP32 firmware version #2269
[Gen 3] Fix warm boot; [Tracker] Cache ESP32 firmware version #2269
Conversation
|
||
// Just straight up proxying to TlvFile | ||
// TODO: add support for multiple values for a key? | ||
int get(SystemCacheKey key, void* value, size_t length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't do const
as TlvFile::get()
modifies the internal state and cannot be const either, unless we make some member variables mutable.
} | ||
uint16_t version = 0; | ||
// Defaults to zero in case of failure | ||
getWifiNcpFirmwareVersion(&version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about do this in the Esp32NcpNetif::loop
before entering the while loop like we do to the Argon to fetch the MAC address? Just to be consistence to initialize things in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method will get called multiple times throughout the device runtime, so this is the appropriate place to look into cache first and then fallback to calling into ESP32 itself to get the version (and update the cache).
If we are thinking of checking/updating the cache on early boot as we do with a MAC address on an Argon, this is disabled on Tracker already, so that we don't unnecessarily boot ESP32 every time we boot Device OS. Eventually using the caching that was implemented here we'll do the same for MAC address. So, I'd prefer to keep things on as-needed basis.
34245d0
to
32a675d
Compare
Problem
Solution
Steps to Test
SEMI_AUTOMATIC
modem and suspend the connection process for some time. Wait until the device connects to the cloud, reset with a button, watch the logs - it should reconnect without powering off the NCPCached ESP32 NCP firmware version
For step 3, the following 0.0.8 ESP32 NCP firmware can be used: tracker-esp32-ncp@0.0.8.zip
Example App
N/A
References
Completeness