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

[Feature requests]: Messages: Configuration of buzz strength & do not power on LCD on message-auto-close #1873

Open
myxor opened this issue May 24, 2022 · 34 comments · Fixed by #1890

Comments

@myxor
Copy link
Contributor

myxor commented May 24, 2022

Messages:

  1. I would like to have a configuration for the buzz strength.
  2. It would be nice if the LCD would not turn on when an unread message is being auto-closed after the delay.

I can work on these myself but i am busy right now.
Leaving this here so i don't forget it.

@alessandrococco
Copy link
Contributor

alessandrococco commented May 26, 2022

  1. I would like to have a configuration for the buzz strength.

The current strength is already at its maximum. The doc says

strength - Power of vibration from 0 to 1 (Default 1)

The messages app call the buzz with default values. What we can do is increase the duration (default is 200ms but we can allow user to customize this value).

I can work on it later today.

@gfwilliams
Copy link
Member

The messages app call the buzz with default values.

How about we use the buzz library and then extend it, so you can have not just . and - but something else that's a lower power buzz. Then in all things (like alarms too) you could have a mix of powerful and less powerful buzzes.

@myxor
Copy link
Contributor Author

myxor commented May 26, 2022

The current strength is already at its maximum.

I do not want it to be stronger but rather weaker :)

@alessandrococco
Copy link
Contributor

alessandrococco commented May 26, 2022

I do not want it to be stronger but rather weaker :)

I thought the opposite because people usually complains that the buzz is too weak 😅

@alessandrococco
Copy link
Contributor

alessandrococco commented May 26, 2022

How about we use the buzz library and then extend it, so you can have not just . and - but something else that's a lower power buzz. Then in all things (like alarms too) you could have a mix of powerful and less powerful buzzes.

Yes, it's a good idea.

What symbols should we use?

I propose : for "short & strong" and = for "long and strong". Visually it is simple to understand: one dot/line → weak, two dots/lines → strong

So we would have:

  • . & : → short weak & short strong
  • - & = → long weak & long strong

What do you think?

@gfwilliams
Copy link
Member

That would be good if it wasn't for existing apps that use it, but I guess it's not the end of the world to have them buzzing a bit weaker until they reinstall or update the settings

@alessandrococco
Copy link
Contributor

@gfwilliams
Copy link
Member

Great! But you do realise that's gone from 14 lines up to 54? And if you don't use one of :.-= it just fails to resolve the promise now?

I yours is more readable now, but it's going to use more memory and probably be slower. Couldn't we just do it by adding 2 lines to the if...else chain?

@alessandrococco
Copy link
Contributor

alessandrococco commented May 26, 2022

I yours is more readable now, but it's going to use more memory and probably be slower. Couldn't we just do it by adding 2 lines to the if...else chain?

Sure, no problem. I'm used to Kotlin & clean code, professional deformation 😅

And if you don't use one of :.-= it just fails to resolve the promise now?

Ooops!

@alessandrococco
Copy link
Contributor

Done!

@myxor
Copy link
Contributor Author

myxor commented May 30, 2022

Thank you @alessandrococco :)

@alessandrococco
Copy link
Contributor

alessandrococco commented Jun 8, 2022

It would be nice if the LCD would not turn on when an unread message is being auto-closed after the delay.

@myxor Does the fixed version work for you?

This is the fix I pushed last week: https://github.com/espruino/BangleApps/pull/1890/files I tried the change before I opened the PR and I am 100% (99.999999%) sure it worked but I just noticed that now the screen turn on again. I reinstalled the latest version (from dev app loader) but the issue is still here - Does it only happen to me?

@myxor
Copy link
Contributor Author

myxor commented Jun 8, 2022

@alessandrococco no, it does not work for me. The screen still turns on on auto closing messages.

@alessandrococco
Copy link
Contributor

@alessandrococco no, it does not work for me. The screen still turns on on auto closing messages.

I don't understand the problem then :-/
There is another Bangle.setLCDPower(1); call but it has nothing to do with the end of the unread timeout 🤔

@gfwilliams Sorry to bother you - any idea what's going on here?

@gfwilliams
Copy link
Member

Is there a Bangle.unlock or similar? I guess one thing to do might be to add some boot code that caused Bangle.setLCDPower/unlock to write something to the console, then you could maybe see what was happening?

@alessandrococco
Copy link
Contributor

alessandrococco commented Jun 11, 2022

Is there a Bangle.unlock or similar?

This is the only setLocked/LCDPower in the messages app:

image

[...] add some boot code that caused Bangle.setLCDPower/unlock [...]

Sorry, I don't understand what you mean 😅

@alessandrococco
Copy link
Contributor

alessandrococco commented Jun 11, 2022

The root of the problem seems more trivial than expected: the load() function!

I just tried to call the load() from the Web IDE and the screen of my Bangle turned on!

@myxor Could you reopen the issue? Thanks!

@myxor
Copy link
Contributor Author

myxor commented Jun 11, 2022

I am not allowed to reopen this issue. @gfwilliams has to do it.

@gfwilliams
Copy link
Member

So what's the issue here? It's actually that the call to load() causes the Bangle to unlock?

@gfwilliams gfwilliams reopened this Jun 13, 2022
@alessandrococco
Copy link
Contributor

So what's the issue here? It's actually that the call to load() causes the Bangle to unlock?

Nope, the issue is that load() turns on the screen.

The goal here is to avoid to turn on the screen after the unread timeout expires.

@gfwilliams
Copy link
Member

Ok, so I think that's a firmware change. I'll look into it

@gfwilliams
Copy link
Member

Nope, the issue is that load() turns on the screen.

Hmm - just tried here, and if I just call load() from the IDE then it doesn't turn the screen on on Bangle.js 2

Or are we talking about Bangle.js 1 here?

@alessandrococco
Copy link
Contributor

Bangle 2.

What's your firmware? I just tried on 2.14: if I call load() from web IDE the screen always turns on 🤔

@gfwilliams
Copy link
Member

Well that's very odd. What are your 'wake on ...' settings set to?

Also what apps are installed? I wonder if some app/boot code it turning it on for you?

@alessandrococco
Copy link
Contributor

alessandrococco commented Jun 14, 2022

Well that's very odd. What are your 'wake on ...' settings set to?

Button only.

Also what apps are installed? I wonder if some app/boot code it turning it on for you?

widlock, widbt, launch, boot, swiperclocklaunch, messages, sched, setting, alarm, patclock, android, widChargingStatus (patclock is a simple custom clock I'm working on, ClockFace + Layout, no custom boot code)

@rigrig
Copy link
Contributor

rigrig commented Aug 4, 2022

I just tried it on my Bangle.js 2 with 2v14.125, and load() from the IDE turns on the screen for me as well.

>require('Storage').readJSON('setting.json')
={ ble: true, blerepl: true, log: false, timeout: 15,
  vibrate: true,
  beep: "vib",
  timezone: 2, HID: false, clock: null, "12hour": false, brightness: 1,
  options: { wakeOnBTN1: true, wakeOnBTN2: true, wakeOnBTN3: true, wakeOnFaceUp: false,
    wakeOnTouch: true, wakeOnTwist: false, twistThreshold: 819.2, twistMaxY: -800, twistTimeout: 1000 },
  theme: { fg: 65535, bg: 0, fg2: 2047, bg2: 31,
    fgH: 65535, bgH: 63488, dark: true },
  quiet: 1, firstDayOfWeek: 1, batFullVoltage: 0.31744384765 }

@gfwilliams
Copy link
Member

@rigrig just tried it on a Bangle.js 2 here with your settings, and still nothing here. Please can you upload the contents of your .boot0 file and let me know which clock you have? It might give a hint as to what's turning the screen on

@rigrig
Copy link
Contributor

rigrig commented Aug 9, 2022

Now it doesn't happen anymore....
Which pointed me to qmsched: it applies Quiet Mode-specific settings in boot, but only while active: turns out Bangle.setLCDBrightness(1) briefly turns on the screen.

And it stays on until all code finishes running, so putting this in the IDE:
Bangle.setLCDBrightness(1);for(i=0;i<10000;i++){}
turns on the screen for several seconds.

I guess that's not the whole story though, because after load() it even stays on for a while after the clock is started, even though boot0 should be finished by then.

Just in case: I'm using barclock / boot0.txt

@gfwilliams
Copy link
Member

Ok, great - that makes sense then. If I recall I had to allow setLCDBrightness to turn the backlight on because there's this disconnect between whether the screen is unlocked, the LCD on, or the LCD backlight on...

I guess for most people, just not calling Bangle.setLCDBrightness if the value is 1 might fix it?

@rigrig
Copy link
Contributor

rigrig commented Aug 10, 2022

for most people, just not calling Bangle.setLCDBrightness if the value is 1 might fix it?

I think so, but

  • it will break setting brightness back to 1 when disabling Quiet Mode. ("broken" as in "won't change until the next reboot instead of immediately", so that's probably acceptable) too bad there isn't a getLCDBrightness...
    Actually, I guess we could just add some code to make the qmsched library distinguish between boot-time and other changes.
  • it will remain broken for people who set a lower brightness (either always, or only during Quiet Mode).

Still, it's probably better than nothing.
Maybe we could also wrap the setLCDBrightness in a timeout (both in qmsched and settings), so at least it only flashes very briefly?

@alessandrococco: Did you have your LCD brightness set below 1? Otherwise this wouldn't explain why the screen turns on for you, as you don't have qmsched installed.

@alessandrococco
Copy link
Contributor

Did you have your LCD brightness set below 1?

Hi @rigrig, Yes, I set it to 0.6 months ago and forget about it 😅

@myxor
Copy link
Contributor Author

myxor commented Nov 16, 2022

It seems that the LCD is still turned on when load() is called. Do we have an idea if this can be changed?

@gfwilliams
Copy link
Member

Did you see the comments above? What if LCD brightness is left at 1?

If so it should be easy enough to fix I hope

@thyttan
Copy link
Collaborator

thyttan commented Nov 20, 2023

This was recently brought up on the Bangle.js subreddit: https://www.reddit.com/r/Banglejs/comments/17qtpgd/how_to_turn_off_backlight/

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

Successfully merging a pull request may close this issue.

6 participants