Aymkdn / assistant-freebox-cloud

Assistant Freebox in the Cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Send commands issue

sz-ashik440 opened this issue · comments

I have successfully completed pairing. Now I am trying to send key command via 6466 port. I got first configuration message when I establish a secure connection with OpenSSL. But when I send back configuration message which includes server information, instead of [ 5 ] [ 10, 3, 8, 255, 4 ] message I get another huge message with server information(I have tried to analyse the bytes data) example data

[88] [26, 86, 8, 2, 18, 82, 18, 77, 10, 9, 105, 112, 104, 111, 110, 101, 32, 49, 49, 18, 5, 65, 112, 112, 108, 101, 24, 1, 34, 2, 49, 50, 42, 36, 99, 111, 109, 46, 103, 111, 111, 103, 108, 101, 46, 97, 110, 100, 114, 111, 105, 100, 46, 116, 118, 46, 114, 101, 109, 111, 116, 101, 46, 115, 101, 114, 118, 105, 99, 101, 50, 13, 53, 46, 50, 46, 52, 55, 51, 50, 53, 52, 49, 51, 51, 8, 238, 4]

Am I missing some points?
Tried to look into louis49/androidtv-remote 's code. There they closed paring socket connection before connecting into 6466 port which I also did.
Also I have also tried to connecting with 6466 port before paring and get same message above.
I am little bit lost right now

I know it's super tricky… I did what I could to share a doc with my discoveries, but it's not perfect.

The message you received seems to be that:
image

Because if I try to decode the message:

[ 26 = Len ? ] [ 86 = Len ? ]
 8, 2, 18, 82, 18 = Probably an error because different from [ 8, 255, 4, 18 ] or [ 8, 239, 4, 18 ]
[ 77 = Len ? ] 
[ 10 ]
[ 9 = SIZE_OF_MODEL_NAME ] [ 105, 112, 104, 111, 110, 101, 32, 49, 49 = iphone 11 = MODEL_NAME_OF_TV ]
[ 18 ]
[ 5 = SIZE_OF_VENDOR_NAME ]  [ 65, 112, 112, 108, 101 = Apple = VENDOR_NAME ]
[ 24, 1, 34 ]
[ 2 = SIZE_OF_SOMETHING_VERSION ] [ 49, 50 = 12 = VERSION_NUMBER ]
[  42 ] 
[ 36 = SIZE_OF_PACKAGE_NAME ] [ 99, 111, 109, 46, 103, 111, 111, 103, 108, 101, 46, 97, 110, 100, 114, 111, 105, 100, 46, 116, 118, 46, 114, 101, 109, 111, 116, 101, 46, 115, 101, 114, 118, 105, 99, 101 = com.google.android.tv.remote.service = APP_NAME ]
[13  = SIZE_OF_APP_VERSION ] [ 53, 46, 50, 46, 52, 55, 51, 50, 53, 52, 49, 51, 51 = 5.2.473254133 = APP_VERSION ]

The 8, 2, 18, 82, 18 may mean you did something wrong. But what?! I don't know.

Also I'm surprised to see iPhone 11 for the TV Model?!

Anyhow, sorry but I cannot help here. You'll have to keep try and fail, until you find the correct way :-(

Thanks for your awesome work and quick reply 💯
I am getting this message after sending first configuration message. I am making configuration by following the wiki and louis49/androidtv-remote 's code. I am requesting from an iPhone thats why I put model as iPhone 11. I was expecting, I would get the [ 5 ] [ 10, 3, 8, 255, 4 ] response from tv but I am getting configuration message for the second time after sending my version of configuration.

8, 2, 18, 82, 18 = Probably an error because different from [ 8, 255, 4, 18 ] or [ 8, 239, 4, 18 ]

Probably I am doing something wrong and getting some error.

I am little bit confused about pairing and key code sending.
First we did paring with 6467 port then we closed that socket. After that we have to send key command at 6466 where we don't have to include any information from paring state. This doesn't add up for my understanding 😅.

When you send data to port 6466 you need to provide the SSL Certificate that has been validated/approved during the first phase (port 6467).

So the pairing permits to have Android TV to accept a SSL Certificate, and once accepted, you attach it when you connect to port 6466. Makes sense?

So the pairing permits to have Android TV to accept a SSL Certificate, and once accepted, you attach it when you connect to port 6466. Makes sense?

Got it. Thanks for the explanation.

The 8, 2, 18, 82, 18 may mean you did something wrong. But what?! I don't know.

I will dig the reason behind this error.

I was sending the byte size before sending the configuration message, which is Thats why I was getting the same configuration message with 8, 2, 18, 82, 18 error.
Just sending the configuration message will be enough.