Skip to content

Commit

Permalink
More research done, notes added, vscode extension suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
hilli committed Apr 20, 2023
1 parent c786af3 commit 24a8e66
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["humao.rest-client"]
}
15 changes: 15 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Notes taken during the course of the project

## Getting the protocol with Wireshark and tcpdump

### tcpdump

Using the KEF Connect app on a Mac with Apple Silicon, I was able to capture the traffic between the app and the speaker. I used the following command to capture the traffic:

```bash
sudo tcpdump -s 0 -B8096 -w KEF.pcap -vvv host 10.0.0.93
```

### Wireshark

Opening the KEF.pcap file in Wireshark, filtering on `http` (Just typing http in the filter box) and then selecting the first packet, right click on it and select `Follow -> HTTP Stream` gives you a window with all HTTP requests and responses. This is a good way to get an overview of the protocol.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,35 @@ func main() {
## License

MIT License


## Command line tool

### TODO

- [ ] Backup/restore settings to file
- [ ] Set volume
- [ ] Mute/unmute
- [ ] Select source
- [ ] Get status
- [ ] Get settings
- [ ] Set settings
- [ ] Turn on/off

### Usage

```bash
```

## Web interface & HomeKit HUB

### TODO

- [ ] Turn on/off
- [ ] Set volume
- [ ] Mute/unmute
- [ ] Select source
- [ ] Status page, refreshing (web)
- [ ] Settings page, editing (web)
- [ ] Backup/restore settings to file download (web)
- [ ] ?? Streaming page, playing (web)
185 changes: 180 additions & 5 deletions research/commands.http
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Content-Type: application/json

{"path": "settings:/deviceName", "roles": "value"}


### Get Device Status
# Possible Statuses are:
# standby or powerOn
Expand Down Expand Up @@ -68,7 +67,6 @@ Content-Type: application/json
"roles": "value"
}


### Set Volume
POST {{baseurl}}/api/setData
Accept: application/json
Expand All @@ -83,9 +81,21 @@ Content-Type: application/json
}
}

### Mute Volume
# Aka set volume to 0
# 'true' is returned if successful (+200 OK)
POST {{baseurl}}/api/setData
Accept: application/json
Content-Type: application/json



{
"path": "player:volume",
"roles": "value",
"value": {
"type": "i32_",
"i32_": 0
}
}

### Song Progress
POST {{baseurl}}/api/getData
Expand All @@ -105,4 +115,169 @@ Content-Type: application/json
{
"path": "player:player/data",
"roles": "value"
}
}

### Set Device Name
POST {{baseurl}}/api/setData
Accept: application/json
Content-Type: application/json

{
"path": "settings:\/deviceName",
"roles": "value",
"value": {
"type": "string_",
"string_": "KEFs"
}
}

### Get Device Profile
POST {{baseurl}}/api/getData
Accept: application/json
Content-Type: application/json

{
"path": "kef:eqProfile/v2",
"roles": "value"
}

### Get messages from the queue
POST {{baseurl}}/api/getRows
Accept: application/json
Content-Type: application/json

{
"from": 0,
"to": 0,
"path": "notifications:/display/queue",
"roles": "@all"
}

### Is front standby LED disabled?
POST {{baseurl}}/api/getData
Accept: application/json
Content-Type: application/json

{
"path": "settings:/kef/host/disableFrontStandbyLED",
"roles": "value"
}

### GoogleCast Usage Report (Google Cast state)
GET {{baseurl}}/api/getData?path=googlecast%3AusageReport&roles=value
Accept: application/json
Content-Type: application/json

### Bluetooth Usage Report (Bluetooth state)
GET {{baseurl}}/api/getData?path=bluetooth%3Astate&roles=value
Accept: application/json
Content-Type: application/json

### Get playlists (Returns the number 1000?)
GET {{baseurl}}/api/getData?path=settings%3A%2Fplaylists%2FdbItemsLimit&roles=value
Accept: application/json
Content-Type: application/json

### Get current DSP settings
GET {{baseurl}}/api/getRows?path=kef%3Adsp%2FeditValue&roles=%40all&from=0&to=99
Accept: application/json
Content-Type: application/json

### Set app analytics
POST {{baseurl}}/api/setData
Accept: application/json
Content-Type: application/json

{
"path": "settings:\/kef\/host\/disableAppAnalytics",
"role": "value",
"value": {
"type": "bool_",
"bool_": false
}
}

### Get standby time
GET {{baseurl}}/api/getData?roles=value&path=settings%3A%2Fkef%2Fhost%2FstandbyMode
Accept: application/json
Content-Type: application/json

### Set standby time
# Possible values are:
# standby_20mins, standby_30mins, standby_60mins, standby_none
POST {{baseurl}}/api/setData
Accept: application/json
Content-Type: application/json

{
"path": "settings:\/kef\/host\/standbyMode",
"role": "value",
"value": {
"type": "kefStandbyMode",
"kefStandbyMode": "standby_30mins"
}
}

### Get secondary wakeup source
# Possible values are:
# wakeup_default, tv, optical, coaxial, analog, bluetooth
GET {{baseurl}}/api/getData?roles=value&path=settings%3A%2Fkef%2Fhost%2FwakeUpSource
Accept: application/json
Content-Type: application/json

### Set secondary wakeup source
# Possible values are:
# wakeup_default (or none), tv, optical, coaxial, analog, bluetooth
POST {{baseurl}}/api/setData
Accept: application/json
Content-Type: application/json

{
"path": "settings:\/kef\/host\/wakeUpSource",
"role": "value",
"value": {
"type": "kefWakeUpSource",
"kefWakeUpSource": "wakeup_default"
}
}

### Get statup tone for sources
GET {{baseurl}}/api/getData?roles=value&path=settings%3A%2Fkef%2Fhost%2FstartupTone
Accept: application/json
Content-Type: application/json

### Set statup tone for sources
POST {{baseurl}}/api/setData
Accept: application/json
Content-Type: application/json

{
"path": "settings:\/kef\/host\/startupTone",
"role": "value",
"value": {
"type": "bool_",
"bool_": false
}
}

### Get cabled (vs wireless) mode
GET {{baseurl}}/api/getData?roles=value&path=settings%3A%2Fkef%2Fhost%2FcableMode
Accept: application/json
Content-Type: application/json

### Set cabled mode on or off
# Possible values are:
# wired, wireless
POST {{baseurl}}/api/setData
Accept: application/json
Content-Type: application/json

{
"path": "settings:\/kef\/host\/cableMode",
"role": "value",
"value": {
"type": "kefCableMode",
"kefCableMode":"wired"
}
}

0 comments on commit 24a8e66

Please sign in to comment.