KarimGeiger / HKAPI

API wrapper for Harman Kardon AVR with network capabilities and HK Remote support.
MIT License
35 stars 9 forks source link

BDS 280 #7

Closed jacquesvzijp closed 3 years ago

jacquesvzijp commented 3 years ago

Does anyone have any success with the BDS280? It does not seem to have a port open at 10025 and does not react to any command. Probably no support at all;-( Thanks for your tips

KarimGeiger commented 3 years ago

You can try running nmap to see if any ports are exposed. Maybe it’s as easy as adjusting the port and hoping for the best.

jacquesvzijp commented 3 years ago

Thanks for your fast reply. Indeed I checked all open port and find only 80, 443, 1900 (upnp) and 5000 (no idea what it is, tried it but no response), so probably no support at all;-(

KarimGeiger commented 3 years ago

Sorry to hear that. Unfortunately I don’t know any other way of trying to approach the issue, other than reverse engineering the official App, if it works for your device at all.

jacquesvzijp commented 3 years ago

Actually that is a great tip, did not think of that, I will download the App, It says BDS 280 support so let's see, and otherwise I may do some Wireshark sniffing;-) fun!

cn-ml commented 2 years ago

I am currently running tests against my BDS 580 which should be the same model as the BDS 280. I reversed the HK Remote app a little bit to find out some basic commands and then went to wireshark. I just did an nmap of my system which resulted in this:

PORT      STATE SERVICE VERSION
2870/tcp  open  upnp    IPI Media Renderer upnpd 1.0 (UPnP 1.0; DLNADOC 1.50)
4096/tcp  open  http    Mongoose httpd
| http-methods: 
|_  Supported Methods: GET HEAD POST
|_http-title: Site doesn't have a title (text/plain).
10025/tcp open  unknown
13000/tcp open  unknown
38438/tcp open  http    Mongoose httpd
|_http-title: Site doesn't have a title (text/plain).
| http-methods: 
|_  Supported Methods: GET HEAD POST

The 38438 also has some sort of UPnP function but i dont know what. So i am now sending commands to the 10025, just as my phone does with the HK Remote app (using plain netcat, your HKAPI application and from my own implementation) but i do not get any response from the BDS. The phone remote works well, but sending the exact same request from my machine over a tcp socket does nothing, the machine does not react, however I do get TCP Acknowledgements from the BDS.

I would like to get this working for the BDS 580/280 series, but I cannot figure out what i'm doing wrong.

KarimGeiger commented 2 years ago

Hi @cn-ml. It's been a while since I last had to deal with a HK device, so my knowledge on this topic may no longer be up to date, but I remember that there were some discrepancies between the HTTP spec (or at least what is commonly implemented in HTTP libraries) and what the HK device expected. For example, the header sent by HTTP clients always contains a / for the URI:

POST /example HTTP/1.1

HK however expects there to be no / and refuses to work otherwise:

POST HK_APP HTTP/1.1

What I'm trying to say is: Have you double-checked that the request you are sending via netcat is exactly the request you have captured using Wireshark? Including \r\n for new lines and all that?