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

"Set the band's music and receive music controls" is not working on miband5. #58

Open
janvda opened this issue Dec 5, 2021 · 5 comments

Comments

@janvda
Copy link

janvda commented Dec 5, 2021

I successfully connected to my miband5 but when I Set the band's music and receive music controls as below it doesn't work:

Set music track artist to : artist1
Set music track album to: album1
Set music track title to: title1
Set music volume: 80
Set music position: 100
Set music duration: 1000

My miband5 is showing just a sec... when opening the music menu and all the music controls are disabled.

FYI the info of my miband5:

MiBand
Soft revision: V1.0.2.58
Hardware revision: V0.44.23.2
Serial: 2c1049507e9d
Battery: 51
Time: 2021-12-06T00:04:38
Press a key to continue

I tried the same on my miband4 and it is working as expected (see output here below)

Set music track artist to : artist1
Set music track album to: album1
Set music track title to: title1
Set music volume: 80
Set music position: 100
Set music duration: 1000
Music focus in
Played
Forward
Backward
volume down
volume up
Music focus out
@janvda
Copy link
Author

janvda commented Dec 13, 2021

FYI:

wireshark log of miband 4 that is properly setting the music:

So when it receives a music focus notification (handle 0x004a - value fee0)
then 3 write commands are send to handle 0x004d:

1st write command:
image

2nd write command:
image

3rd write command:
image

image

image

@janvda
Copy link
Author

janvda commented Dec 13, 2021

I did the same on miband5 but this is not working:
when it receives the focus event it is not responding with writing 3 events.

Music focus event:
image

In first 3 commands it is writing the music data (similar as for miband 4 but using handle 0x0050 instead of 0x004a).

1st command:
image

2nd command:
image

3rd command:
image

complete wireshark overview:
image

@janvda
Copy link
Author

janvda commented Dec 13, 2021

It is working on my miband 5 when I send the 3 write events just after I have opened the music menu.

@janvda
Copy link
Author

janvda commented Dec 13, 2021

Root cause:

The handle for receiving the music notification is different on miband5 ( = 0x004d) compared to miband4 (= 0x004a).

So the following part of the code is never executed for miband 5 (74 = 0x4a)

https://github.com/janvda/miband4/blob/e6875a5ed55fe051949009196fbe6cb105179811/miband.py#L108

@janvda
Copy link
Author

janvda commented Dec 14, 2021

You can fix this easily by making following change:

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

No branches or pull requests

1 participant