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

Fix calibration #1513

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Fix calibration #1513

merged 1 commit into from
Jan 17, 2025

Conversation

giedriuslt
Copy link
Contributor

You can set 0 or NAN as calibration constant currently, which should not be allowed, and in my case bricks the device.
Should be validated correctly.
Should fix #1502

@divadiow
Copy link
Contributor

I deliberately messed up my BL0937 device again on GA then flashed to 1513_merge_7263f06183e7 - the NaNs remained through counter clears. Also, applying a power value, integer or non, gave the below. voltage and current are OK. Please sanity check me - can you replicate?
image

@divadiow
Copy link
Contributor

if your modifications were only designed to stop it happening at all, and not fixing if already happened, then no worries.

@openshwprojects
Copy link
Owner

How does it brick a device? I was aware about the issue but I haven't seen any way it can brick stuff

@giedriuslt
Copy link
Contributor Author

if your modifications were only designed to stop it happening at all, and not fixing if already happened, then no worries.

This fix does nothing to correct wrong data, if you have NaN in there might be hard to get out, but recalibrating and reseting energy should I believe work

@giedriuslt
Copy link
Contributor Author

How does it brick a device? I was aware about the issue but I haven't seen any way it can brick stuff

I tested with bl602, it might have different NaN/division by zero handling. The issue was after I broke calibration, web page no longer loaded.
I tried to put it in safe mode, I could connect to device wifi, but but it still doesn't load for some reason. Although in this case it should I believe, maybe I did something wrong.
Reflashing chip which full erase (which obviously removes any config) fixed the problem

@openshwprojects openshwprojects merged commit d0a056e into openshwprojects:main Jan 17, 2025
19 checks passed
Copy link

🎉 This PR is included in version 1.18.21 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calibrating power metering with non-integers results in NaN power meter reading
3 participants