Closed prototypicalpro closed 4 years ago
https://github.com/OPEnSLab-OSU/Loom/commit/15999f7fc2f10b210bf8d436a68b567a2274b87e temporarily fixes the issue.
The solution proposed to this is to move all automatic re-initialization code in LoomManager::sleep()
to the sketch. This will also resolve issues with the ordering of DS3231 power up and toggling of hypnos pins. More documentation on proper powering up routines will be needed after this change (https://github.com/OPEnSLab-OSU/Loom/issues/79).
Describe the bug When using the I2C multiplexer and
LoomManager::sleep
, the multiplexer will mark itself deactivated by settingLoom_Module::active
to false duringLoom_Multiplexer::power_up
: https://github.com/OPEnSLab-OSU/Loom/blob/fc36a8df101e18fceca88510ed7e9ceb4cd5ef64/src/Multiplexer.cpp#L402-L410 causing subsequent measure calls to ignore the module: https://github.com/OPEnSLab-OSU/Loom/blob/fc36a8df101e18fceca88510ed7e9ceb4cd5ef64/src/Manager.cpp#L197-L200 The module will then remain deactivated even after callingLoomManager::power_up
after the board has fully powered on.While it makes sense to me that
Loom_Multiplexer::power_up
would deactivate the module because it cannot communicate with the multiplexer before the Hypnos is powered on, it is not clear to me why subsequent calls toLoom_Multiplexer::power_up
do not reactivate the module. More investigation is needed.Hardware in Use Tested on the SitkaNet setup, but should reproduce on any Feather/Hypnos/Multiplexer project (so long as the multiplexer power controlled by the Hypnos).
To Reproduce Any project using
Loom::sleep
with the multiplexer should be able to reproduce this issue. Simply load any sketch using sleep and the multiplexer, allow the board to sleep/wakeup once, and the board will no longer measure any multiplexer sensors.