Brightness change
Opened this issue · 6 comments
Hello! I've been reading your code and this docs but I cannot figure out why when I send "high brightness" continuously my divoom alternates: HIGH, MED, LOW, OFF, LOW, MED [...]
Based on what I send it, it is always the same:
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
> ['0x1', '0x4', '0x0', '0x32', '0xd2', '0x8', '0x3', '0x4', '0x2']
< ['0x1', '0x6', '0x0', '0x4', '0x32', '0x55', '0xd2', '0x63', '0x3', '0x4', '0x2']
and the replies are also constant..
If I send LOW instead of HIGH for brightness; the behavior is the same (iterates over high/med/low/off brightness)
Any ideas on how to set brightness in an absolute way?
I tried this on 'static image' mode and on 'clock' mode; same behavior
Sending 0x74 instead of 0x32 allows me to set OFF, LOW, HIGH but the 0x32 behavior still remains..
I can also set more levels of brightness from the app (which are the same as the 'random' ones on 0x32)
Ok, what do you expect me to do here?
If you have any idea please create a pull request.
The behavior appears different on my aurabox. When I send the brightness commands it sets in the "absolute" way as you say.
Here is the second byte on my brightness commands
{ "Full", 0xd2 },
{ "Dim", 0x3f },
{ "Off", 0x00 }
On my timebox sending 0x32 makes the brightness iterate over various (5?) states.. sending 0x74 works with the 3 values (full, dim, off).. using the app I can set more than 3 brightness levels, but the HCI snoop on my phone does not seem to work
The dimming behavior must be different on the timebox compared to aurabox.
On my Galaxy S8 I had to follow the following instructions to enable HCI snoop.
https://stackoverflow.com/a/46674486
1, enable developer mode
2, enable HCI snoop
3, disable, renable bluetooth
4, reboot the phone
5, (do whatever bluetooth actions you want to log)
6, Open system dump tools (#9900# on phone dialpad)
7, Click "Run DUMPSTATE/LOGCAT/MODEM LOG" then wait to finish
8, Click "Copy to SDCARD"
9, Plug phone into USB on computer and open "phone" then "/logs"
10, Copy btsnoop_hci_.cfa to computer
11, open in wireshark
(edited to add missing step 3)
This is what I got from changing brightness on the app with the hci snoop logs
# [0x1, 0x9, 0x0, 0x45, 0x3, 0x5, 0xf0, 0x30, 0x0, 0x27, 0x0, 0x97, 0x3, 0x4, 0x2]
# [0x1, 0x9, 0x0, 0x45, 0x3, 0x5, 0xf0, 0x30, 0x0, 0x32, 0x0, 0xa2, 0x3, 0x4, 0x2]
# [0x1, 0x9, 0x0, 0x45, 0x3, 0x5, 0xf0, 0x30, 0x0, 0x3e, 0x0, 0xae, 0x3, 0x4, 0x2]
# [0x1, 0x9, 0x0, 0x45, 0x3, 0x5, 0xf0, 0x30, 0x0, 0x49, 0x0, 0xb9, 0x3, 0x4, 0x2]
# [0x1, 0x9, 0x0, 0x45, 0x3, 0x5, 0xf0, 0x30, 0x0, 0x55, 0x0, 0xc5, 0x3, 0x4, 0x2]
# [0x1, 0x9, 0x0, 0x45, 0x3, 0x5, 0xf0, 0x30, 0x0, 0x5c, 0x0, 0xcc, 0x3, 0x4, 0x2]
# 0x45 = SWITCH_VIEW
# 0x3, 0x5 => 0x2 masked = ANIM_HARDCODED_1
# 0xf0 0x30 0x0 are the R, G, B values but with << 4
# 0x27-0x5c is the brightness
You can see here that on my device this command has a 'linear' change, it is not just a few steps