Skip to content
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

LYWSD03MMC Thermometers occassionally re-enable the disabled comfort smiley display (ScheduleProgrammingVisibility) #47

Closed
JayFoxRox opened this issue Jan 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@JayFoxRox
Copy link

I'm on Zigbee2MQTT (1.34.0 commit: aae7312); zStack12 Coordinator revision 20211115.

I have 9 LYWSD03MMC thermometers (called T1 - T9).
Each of them is running 3001-0117 (20231215).

Initially I configured them to hide the smiley using #28 (comment) in zigbee2mqtt using the "Dev Console", but it keeps breaking - the smiley keeps coming back randomly (or temporarily?).

They've been running this firmware for about ~7 weeks.
Since then, in at least 3 cases, one of those thermometers (a different one each time) suddenly started showing the comfort smiley.
First, it happened on 1 thermometer about a week after initial setup of the thermometers. Then it happened 2 more times this week, again, on different thermometers.
It's fixable by rewriting 1 to the visibility setting on the affected thermometer.

Each of the affected thermometers report > 70% battery

It's not clear to me if this is a zigbee2mqtt reconfiguration issue or a bug in this firmware or even something like a flash malfunction.

I'd like to provide logs, but my logs are quickly rotating because of issue #46 and I never spotted the moment it changed.
I did not try to read back the config attribute on an affected thermometer (I always just rewrote the field to hide the smiley again), but will read it out if it happens again.

@JayFoxRox
Copy link
Author

JayFoxRox commented Jan 31, 2024

Checked the code, and my theory is that the thermometer doesn't even have the setting saved properly.
The code to _save to flash looks "odd" because it uses the same nv_flashReadNew as _restore:

_save:

st = nv_flashReadNew(1, NV_MODULE_ZCL, NV_ITEM_ZCL_THERMOSTAT_UI_CFG, sizeof(zcl_thermostatUICfgAttr_t), (u8*)&zcl_nv_thermostatUiCfg);

_restore:

st = nv_flashReadNew(1, NV_MODULE_ZCL, NV_ITEM_ZCL_THERMOSTAT_UI_CFG, sizeof(zcl_nv_thermostatUiCfg), (u8*)&zcl_nv_thermostatUiCfg);

Therefore, I believe the thermometers might have restarted (I didn't try to manually restart them, but would assume they'd show similar behaviour?)

Edit: Checked the telink SDK to see if this was using some weird MMIO or diff-ing approach; but there's indeed a nv_flashWriteNew which should probably have been used instead

pvvx added a commit that referenced this issue Jan 31, 2024
@pvvx
Copy link
Owner

pvvx commented Jan 31, 2024

Thanks!
The error has been fixed. Ver0.1.1.9.

@pvvx pvvx added the bug Something isn't working label Feb 1, 2024
@pvvx pvvx closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants