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

Total Yield Day is partly not visible when value is > 10.0000Wh. #1797

Closed
4c2 opened this issue Feb 27, 2024 · 10 comments
Closed

Total Yield Day is partly not visible when value is > 10.0000Wh. #1797

4c2 opened this issue Feb 27, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@4c2
Copy link

4c2 commented Feb 27, 2024

What happened?

Total Yield Day is partly not visible when value is > 10.0000Wh.
When screensaver moves the text to the left, the text disappears.

("Heute" in following pics is the Total Yield Day. It is missing in the lower picture.)

image20240227_142614094_
image20240227_142638319_

To Reproduce Bug

Use 1.3" OLED display with fusion board.
German language, but maybe issue also for others.
have day yield of > 10.000Wh
When screensaver moves the text to the left, the text disappears.

Expected Behavior

Total Yield Day always visible.

Install Method

Pre-Compiled binary from GitHub

What git-hash/version of OpenDTU?

v24.2.16

Relevant log/trace output

no log available

Anything else?

@4c2 4c2 added the bug Something isn't working label Feb 27, 2024
@broth-itk
Copy link
Contributor

I wish I had the same problem ;-)

Maybe it might make sense to convert down to kWh above 9999 Wh -> 10.0 kWh
Total length of the string would fit.

@tm-107
Copy link

tm-107 commented Feb 29, 2024

Same problem here... today I'm currently at >26.000 Wh and the value disappears when it's on the left side.

The problem only exists if the display is set to German.
Changing the display language to English or French solves the problem.
In German, either the font would have to be a little smaller or - as already suggested - there should be an automatic switch from Wh to kWh.

@MetaChuh
Copy link

@tm-107 👍🙏

The problem only exists if the display is set to German.

thanks for fiddling around with other languages, until you found a possible cause 👍

from a perspective of string lengths, it's very intreaguing why today: works, while Heute: does not, as the string lenghts should be the same.

maybe the difference lies at the capital Hwhich consumes more pixel width ?
i've not worked very much with the display libraries yet, but i, probably same as the project owner and chief of dev @tbnobody assumed, that the additional pixels would just not be displayed, if the image is shifted ... but not that the whole line would be ommited, as it seems the case

very fascinating.
can anyone else with a larger than 10kwh daily solar yield confirm this as well ?

@tbnobody
Copy link
Owner

I could imagine that either this line:

dispX = (_display->getDisplayWidth() - _display->getStrWidth(text)) / 2;

or this line
dispX = (CHART_POSX - _display->getStrWidth(text)) / 2;

calculates a negative result which results in a underflow and therefor in a very high number (e.g. 240) and places the text outside the display.

@tm-107
Copy link

tm-107 commented Mar 1, 2024

Here is a video-shot of the problem. Maybe it's interesting to see at which positions the text disappears.
Youtube-Link

@MetaChuh
Copy link

verified and working: v24.3.15 with Heute: 14121 Wh (yesterday)

let's hope for a good solar yield today too.
and especially my wishes for @broth-itk to surpass a daily yield to something like 22222 Wh ... with the fun part, that exactly this number might break the pixel length fix again 😉
(just kidding, in theory the fix should work for any pixel width)

thx & greetings to all participants of this issue
metachuh

@broth-itk
Copy link
Contributor

@MetaChuh Thanks for your wishes! ;-)
Have a great day!

@4c2
Copy link
Author

4c2 commented Mar 21, 2024

@tbnobody many thanks also from my side. It works with v24.3.15.

@tm-107
Copy link

tm-107 commented Mar 23, 2024

let's hope for a good solar yield today too. and especially my wishes for @broth-itk to surpass a daily yield to something like 22222 Wh ... with the fun part, that exactly this number might break the pixel length fix again 😉 (just kidding, in theory the fix should work for any pixel width)

Unfortunately, the display will not show “22222 Wh” because it now automatically switches to kWh.

IMG_20240317_145947

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants