docs: sweep example LAN IPs to RFC-5737 documentation range

Phase 4 of the docs portion of the rfc-5737-cleanup. Replaces all
192.168.1.x example IPs in tracked .md / .txt files with the
equivalent last-octet under 192.0.2.x.

192.168.1.x is RFC-1918 private space and routes on real networks,
which leaves readers guessing whether a documented IP is a placeholder
or a documented LAN. 192.0.2.0/24 is reserved by RFC 5737 exclusively
for documentation — readers know on sight that they're examples.

58 files touched, 551 line pairs. Includes .github issue/PR templates,
all docs/ references, example READMEs, and one script doc. No code
changes, no test changes; test files still carry the 192.168.1.x
placeholder pending Phase 2 in _/RFC-5737-cleanup/assessment.md.

Also fixed a small fallout in docs/analysis/ANONYMIZATION-SUMMARY.md
where the explanatory sentence "a reader can't tell whether
192.168.1.10 is a placeholder or a documented LAN address" had
itself been swept by the regex (inverting the point); restored the
literal example and noted the sweep progress inline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tobias Gesellchen
2026-05-17 22:05:13 +02:00
co-authored by Claude Opus 4.7
parent ffd5974ddb
commit 1b21e0eaa8
58 changed files with 560 additions and 558 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ A clear and concise description of what you expected to happen.
**Command/Code that failed**
```bash
# If using CLI tool, provide the exact command
soundtouch-cli --host 192.168.1.100 info get
soundtouch-cli --host 192.0.2.100 info get
# If using Go library, provide minimal code example
```
@@ -69,8 +69,8 @@ List any features that don't work or behave unexpectedly:
**Testing Commands Used**
```bash
# List the specific commands you used for testing
soundtouch-cli --host 192.168.1.100 info get
soundtouch-cli --host 192.168.1.100 play start
soundtouch-cli --host 192.0.2.100 info get
soundtouch-cli --host 192.0.2.100 play start
# ... etc
```
+1 -1
View File
@@ -50,7 +50,7 @@ client.NewFeature(parameters)
```bash
# CLI example
soundtouch-cli --host 192.168.1.100 new-feature --param value
soundtouch-cli --host 192.0.2.100 new-feature --param value
```
**Priority**
+2 -2
View File
@@ -50,7 +50,7 @@ Please check the type of change your PR introduces:
**Device(s) tested with:**
- Device model: [e.g. SoundTouch 10]
- Device IP: [e.g. 192.168.1.100]
- Device IP: [e.g. 192.0.2.100]
- Test results: [brief description]
### Test Commands
@@ -58,7 +58,7 @@ Please check the type of change your PR introduces:
# Commands used to test this change
make test
go test ./pkg/client -v -run TestNewFeature
soundtouch-cli --host 192.168.1.100 new-command
soundtouch-cli --host 192.0.2.100 new-command
```
## Documentation
+6 -6
View File
@@ -157,7 +157,7 @@ golangci-lint run --fix
go install ./cmd/soundtouch-cli
# Run integration tests (requires real device)
make test-integration HOST=192.168.1.100
make test-integration HOST=192.0.2.100
```
### Environment Setup
@@ -166,7 +166,7 @@ For development with real devices, create a `.env` file:
```env
# Optional: Pre-configured device for testing
SOUNDTOUCH_HOST=192.168.1.100
SOUNDTOUCH_HOST=192.0.2.100
SOUNDTOUCH_PORT=8090
# Optional: Enable debug logging
@@ -340,7 +340,7 @@ When possible, test with real SoundTouch devices:
```bash
# Set device IP for integration tests
export SOUNDTOUCH_HOST=192.168.1.100
export SOUNDTOUCH_HOST=192.0.2.100
go test -tags integration ./pkg/client/
```
@@ -361,7 +361,7 @@ go test -tags integration ./pkg/client/
// Basic usage:
//
// client := client.NewClient(&client.Config{
// Host: "192.168.1.100",
// Host: "192.0.2.100",
// Port: 8090,
// })
//
@@ -410,8 +410,8 @@ If you have access to other SoundTouch models:
2. **Test basic functionality**:
```bash
./soundtouch-cli -h 192.168.1.100 info get
./soundtouch-cli -h 192.168.1.100 now-playing get
./soundtouch-cli -h 192.0.2.100 info get
./soundtouch-cli -h 192.0.2.100 now-playing get
```
3. **Report compatibility** in your PR or issue
+1 -1
View File
@@ -88,7 +88,7 @@ go build -o soundtouch-web
./soundtouch-web -port 8888
# Connect to specific device
./soundtouch-web -host 192.168.1.100
./soundtouch-web -host 192.0.2.100
```
### Command Line Options
+2 -2
View File
@@ -197,12 +197,12 @@ err := client.SelectContentItem(contentItem)
### CLI Usage
```bash
# streamUrl format
soundtouch-cli --host 192.168.1.100 source internet-radio \
soundtouch-cli --host 192.0.2.100 source internet-radio \
--location "http://contentapi.gmuth.de/station.php?name=MyStation&streamUrl=https://stream.example.com/radio" \
--name "My Station"
# Direct stream
soundtouch-cli --host 192.168.1.100 source internet-radio \
soundtouch-cli --host 192.0.2.100 source internet-radio \
--location "https://stream.example.com/radio" \
--name "Direct Stream"
```
+1 -1
View File
@@ -294,7 +294,7 @@ This document tracks the detailed evolution of features and capabilities in the
- **Phase 9**: Bug fixes (speaker beep reliability)
#### CLI Feature Enhancements
- **Host:Port Parsing**: Support for `192.168.1.100:8090` format
- **Host:Port Parsing**: Support for `192.0.2.100:8090` format
- **Auto-Discovery Integration**: Seamless device discovery
- **Formatted Output**: Human-readable, structured output
- **Error Handling**: Comprehensive error messages and recovery suggestions
+17 -17
View File
@@ -11,7 +11,7 @@ The SoundTouch CLI now supports parsing host and port combinations in the `-host
### Basic Host:Port Format
```bash
# Specify host and port together
soundtouch-cli -host 192.168.1.100:8090 -info
soundtouch-cli -host 192.0.2.100:8090 -info
soundtouch-cli -host 192.0.2.10:8090 -play
soundtouch-cli -host soundtouch.local:8090 -pause
```
@@ -19,7 +19,7 @@ soundtouch-cli -host soundtouch.local:8090 -pause
### Traditional Separate Flags (Still Supported)
```bash
# Traditional separate host and port flags
soundtouch-cli -host 192.168.1.100 -port 8090 -info
soundtouch-cli -host 192.0.2.100 -port 8090 -info
soundtouch-cli -host 192.0.2.10 -port 8090 -play
```
@@ -27,7 +27,7 @@ soundtouch-cli -host 192.0.2.10 -port 8090 -play
When both formats are used, the port specified in the host:port format takes precedence:
```bash
# Uses port 8090 from host:port, ignores -port 9999
soundtouch-cli -host 192.168.1.100:8090 -port 9999 -info
soundtouch-cli -host 192.0.2.100:8090 -port 9999 -info
```
## Supported Formats
@@ -35,10 +35,10 @@ soundtouch-cli -host 192.168.1.100:8090 -port 9999 -info
### IPv4 Addresses
```bash
# Standard IPv4 with port
soundtouch-cli -host 192.168.1.100:8090 -info
soundtouch-cli -host 192.0.2.100:8090 -info
# IPv4 without port (uses default 8090)
soundtouch-cli -host 192.168.1.100 -info
soundtouch-cli -host 192.0.2.100 -info
```
### Hostnames
@@ -123,31 +123,31 @@ Tested with real SoundTouch devices:
# Discover devices to find host:port
$ soundtouch-cli -discover
Found SoundTouch devices:
My SoundTouch Device (192.168.1.10:8090) - SoundTouch 20
My SoundTouch Device (192.0.2.10:8090) - SoundTouch 20
# Use discovered host:port directly
$ soundtouch-cli -host 192.168.1.10:8090 -play
$ soundtouch-cli -host 192.0.2.10:8090 -play
```
### Different Port Scenarios
```bash
# Standard SoundTouch port
soundtouch-cli -host 192.168.1.100:8090 -info
soundtouch-cli -host 192.0.2.100:8090 -info
# Custom port (if device configured differently)
soundtouch-cli -host 192.168.1.100:9000 -info
soundtouch-cli -host 192.0.2.100:9000 -info
# Default port fallback
soundtouch-cli -host 192.168.1.100 -info # Uses 8090
soundtouch-cli -host 192.0.2.100 -info # Uses 8090
```
### Error Scenarios
```bash
# Invalid port - uses default 8090
soundtouch-cli -host 192.168.1.100:invalid -info
soundtouch-cli -host 192.0.2.100:invalid -info
# Out of range port - uses default 8090
soundtouch-cli -host 192.168.1.100:99999 -info
soundtouch-cli -host 192.0.2.100:99999 -info
# Malformed input - treats as hostname
soundtouch-cli -host "malformed::input" -info
@@ -163,10 +163,10 @@ Options:
-port <port> SoundTouch device port (default: 8090)
Examples:
soundtouch-cli -host 192.168.1.100 -info
soundtouch-cli -host 192.168.1.100:8090 -info
soundtouch-cli -host 192.168.1.100:8090 -pause
soundtouch-cli -host 192.168.1.100:8090 -preset 1
soundtouch-cli -host 192.0.2.100 -info
soundtouch-cli -host 192.0.2.100:8090 -info
soundtouch-cli -host 192.0.2.100:8090 -pause
soundtouch-cli -host 192.0.2.100:8090 -preset 1
```
## Technical Implementation
@@ -197,7 +197,7 @@ The parsed values are used throughout the CLI:
Potential improvements for the future:
1. **URL Format Support**: Support full URLs like `http://192.168.1.100:8090`
1. **URL Format Support**: Support full URLs like `http://192.0.2.100:8090`
2. **Service Discovery**: Auto-detect port via service discovery protocols
3. **Configuration File**: Save frequently used host:port combinations
4. **Environment Variables**: Support `SOUNDTOUCH_HOST` with host:port format
+5 -5
View File
@@ -316,7 +316,7 @@ MX:3
NOTIFY * HTTP/1.1
HOST:239.255.255.250:1900
CACHE-CONTROL:max-age=1800
LOCATION:http://192.168.1.100:8090/device_description.xml
LOCATION:http://192.0.2.100:8090/device_description.xml
NT:upnp:rootdevice
NTS:ssdp:alive
USN:uuid:12345678-1234-1234-1234-123456789012::upnp:rootdevice
@@ -328,7 +328,7 @@ HTTP/1.1 200 OK
CACHE-CONTROL:max-age=1800
DATE:Wed, 18 Dec 2024 10:30:00 GMT
EXT:
LOCATION:http://192.168.1.100:8090/device_description.xml
LOCATION:http://192.0.2.100:8090/device_description.xml
SERVER:Linux/3.0 UPnP/1.0 Device/1.0
ST:upnp:rootdevice
USN:uuid:12345678-1234-1234-1234-123456789012::upnp:rootdevice
@@ -363,7 +363,7 @@ arp -a
# Scan local network segment (requires nmap)
brew install nmap
nmap -sn 192.168.1.0/24 # Adjust network range as needed
nmap -sn 192.0.2.0/24 # Adjust network range as needed
# Quick ping sweep (built-in)
for i in {1..254}; do ping -c 1 -t 1 192.168.1.$i >/dev/null 2>&1 && echo "192.168.1.$i is up"; done
@@ -439,10 +439,10 @@ sudo tcpdump -i any -n -A 'port 5353' | grep -i soundtouch
netstat -g
# Test UDP connectivity
nc -u 192.168.1.100 8090 # Replace with actual device IP
nc -u 192.0.2.100 8090 # Replace with actual device IP
# Test HTTP connectivity to discovered devices
curl -i http://192.168.1.100:8090/info # SoundTouch info endpoint
curl -i http://192.0.2.100:8090/info # SoundTouch info endpoint
```
## Protocol Comparison
+1 -1
View File
@@ -40,7 +40,7 @@ import (
func main() {
// Create client
config := &client.Config{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
}
soundtouch := client.NewClient(config)
+22 -22
View File
@@ -10,20 +10,20 @@ SoundTouch devices support 6 preset slots that can store your favorite content f
### 1. See Current Presets
```bash
soundtouch-cli --host 192.168.1.100 preset list
soundtouch-cli --host 192.0.2.100 preset list
```
### 2. Store What's Currently Playing
```bash
# Store current song/station as preset 1
soundtouch-cli --host 192.168.1.100 preset store-current --slot 1
soundtouch-cli --host 192.0.2.100 preset store-current --slot 1
```
### 3. Store Specific Content
#### Spotify Playlist
```bash
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 2 \
--source SPOTIFY \
--location "spotify:playlist:37i9dQZF1DXcBWIGoYBM5M" \
@@ -32,7 +32,7 @@ soundtouch-cli --host 192.168.1.100 preset store \
#### Radio Station
```bash
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 3 \
--source TUNEIN \
--location "/v1/playback/station/s33828" \
@@ -42,16 +42,16 @@ soundtouch-cli --host 192.168.1.100 preset store \
### 4. Use Your Presets
```bash
# Play preset 1
soundtouch-cli --host 192.168.1.100 preset select --slot 1
soundtouch-cli --host 192.0.2.100 preset select --slot 1
# Play preset 2
soundtouch-cli --host 192.168.1.100 preset select --slot 2
soundtouch-cli --host 192.0.2.100 preset select --slot 2
```
### 5. Remove Presets
```bash
# Remove preset 6
soundtouch-cli --host 192.168.1.100 preset remove --slot 6
soundtouch-cli --host 192.0.2.100 preset remove --slot 6
```
## Getting Content Locations
@@ -61,7 +61,7 @@ To store specific content, you need the `location` parameter. Here's how to get
### Method 1: From Currently Playing Content
```bash
# Play the content you want to save, then:
soundtouch-cli --host 192.168.1.100 play now
soundtouch-cli --host 192.0.2.100 play now
```
**Example output:**
@@ -135,7 +135,7 @@ import (
func main() {
// Create client
c := client.NewClient(&client.Config{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
})
@@ -235,19 +235,19 @@ select {} // Run forever
### Family Setup
```bash
# Dad's morning playlist
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 1 --source SPOTIFY \
--location "spotify:playlist:morning-energy" \
--name "Dad's Morning Mix"
# Mom's cooking music
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 2 --source SPOTIFY \
--location "spotify:playlist:cooking-vibes" \
--name "Kitchen Tunes"
# Kids' bedtime stories
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 3 --source TUNEIN \
--location "/v1/playback/station/bedtime-stories" \
--name "Bedtime Stories"
@@ -256,22 +256,22 @@ soundtouch-cli --host 192.168.1.100 preset store \
### Party Mode
```bash
# Upbeat party playlist
soundtouch-cli --host 192.168.1.100 preset store-current --slot 1
soundtouch-cli --host 192.0.2.100 preset store-current --slot 1
# Chill background music
soundtouch-cli --host 192.168.1.100 preset store-current --slot 2
soundtouch-cli --host 192.0.2.100 preset store-current --slot 2
# Dance music
soundtouch-cli --host 192.168.1.100 preset store-current --slot 3
soundtouch-cli --host 192.0.2.100 preset store-current --slot 3
```
### Smart Home Integration
```bash
# Morning routine (preset 1) - triggered by smart home at 7 AM
soundtouch-cli --host 192.168.1.100 preset select --slot 1
soundtouch-cli --host 192.0.2.100 preset select --slot 1
# Evening routine (preset 2) - triggered at sunset
soundtouch-cli --host 192.168.1.100 preset select --slot 2
soundtouch-cli --host 192.0.2.100 preset select --slot 2
```
## Troubleshooting
@@ -286,26 +286,26 @@ Not all content can be saved as presets:
### "All preset slots are occupied"
```bash
# See which presets you have
soundtouch-cli --host 192.168.1.100 preset list
soundtouch-cli --host 192.0.2.100 preset list
# Remove one you don't need
soundtouch-cli --host 192.168.1.100 preset remove --slot 6
soundtouch-cli --host 192.0.2.100 preset remove --slot 6
# Or overwrite an existing one
soundtouch-cli --host 192.168.1.100 preset store-current --slot 6
soundtouch-cli --host 192.0.2.100 preset store-current --slot 6
```
### Getting Spotify URIs
If you can't find Spotify URIs:
1. **Play the content** in Spotify on your SoundTouch
2. **Check what's playing**: `soundtouch-cli --host 192.168.1.100 play now`
2. **Check what's playing**: `soundtouch-cli --host 192.0.2.100 play now`
3. **Copy the location** from the output
### Device Connection Issues
```bash
# Test connection first
soundtouch-cli --host 192.168.1.100 info
soundtouch-cli --host 192.0.2.100 info
# If that fails, check:
# - Device IP address is correct
+1 -1
View File
@@ -364,7 +364,7 @@ func main() {
```go
func handleClientProxy(w http.ResponseWriter, r *http.Request) {
// Extract device IP from path: /api/client/192.168.1.100/now_playing
// Extract device IP from path: /api/client/192.0.2.100/now_playing
pathParts := strings.Split(r.URL.Path, "/")
if len(pathParts) < 5 {
http.Error(w, "Invalid path", http.StatusBadRequest)
+1 -1
View File
@@ -121,7 +121,7 @@ sa.GetUnavailableServiceCount()
### Basic Usage
```go
client := client.NewClientFromHost("192.168.1.100")
client := client.NewClientFromHost("192.0.2.100")
serviceAvailability, err := client.GetServiceAvailability()
if err != nil {
+10 -10
View File
@@ -275,8 +275,8 @@ Returns detected UPnP/DLNA media servers.
**Response Example:**
```xml
<ListMediaServersResponse>
<media_server id="2f402f80-da50-11e1-9b23-123456789012" mac="0017886e13fe" ip="192.168.1.4" manufacturer="Signify" model_name="Philips hue bridge 2015" friendly_name="Hue Bridge (192.168.1.4)" model_description="Philips hue Personal Wireless Lighting" location="http://192.168.1.4:80/description.xml" />
<media_server id="d09708a1-5953-44bc-a413-123456789012" mac="S-1-5-21-240303764-901663538-1234567890-1001" ip="192.168.1.5" manufacturer="Microsoft Corporation" model_name="Windows Media Player Sharing" friendly_name="My NAS Media Library" model_description="" location="http://192.168.1.5:2869/upnphost/udhisapi.dll?content=uuid:d09708a1-5953-44bc-a413-123456789012" />
<media_server id="2f402f80-da50-11e1-9b23-123456789012" mac="0017886e13fe" ip="192.0.2.4" manufacturer="Signify" model_name="Philips hue bridge 2015" friendly_name="Hue Bridge (192.0.2.4)" model_description="Philips hue Personal Wireless Lighting" location="http://192.0.2.4:80/description.xml" />
<media_server id="d09708a1-5953-44bc-a413-123456789012" mac="S-1-5-21-240303764-901663538-1234567890-1001" ip="192.0.2.5" manufacturer="Microsoft Corporation" model_name="Windows Media Player Sharing" friendly_name="My NAS Media Library" model_description="" location="http://192.0.2.5:2869/upnphost/udhisapi.dll?content=uuid:d09708a1-5953-44bc-a413-123456789012" />
</ListMediaServersResponse>
```
@@ -641,15 +641,15 @@ Gets current stereo pair configuration.
<groupRole>
<deviceId>9070658C9D4A</deviceId>
<role>LEFT</role>
<ipAddress>192.168.1.131</ipAddress>
<ipAddress>192.0.2.131</ipAddress>
</groupRole>
<groupRole>
<deviceId>F45EAB3115DA</deviceId>
<role>RIGHT</role>
<ipAddress>192.168.1.134</ipAddress>
<ipAddress>192.0.2.134</ipAddress>
</groupRole>
</roles>
<senderIPAddress>192.168.1.131</senderIPAddress>
<senderIPAddress>192.0.2.131</senderIPAddress>
<status>GROUP_OK</status>
</group>
```
@@ -671,12 +671,12 @@ Creates new stereo pair group.
<groupRole>
<deviceId>9070658C9D4A</deviceId>
<role>LEFT</role>
<ipAddress>192.168.1.131</ipAddress>
<ipAddress>192.0.2.131</ipAddress>
</groupRole>
<groupRole>
<deviceId>F45EAB3115DA</deviceId>
<role>RIGHT</role>
<ipAddress>192.168.1.134</ipAddress>
<ipAddress>192.0.2.134</ipAddress>
</groupRole>
</roles>
</group>
@@ -707,12 +707,12 @@ Updates stereo pair group name.
<groupRole>
<deviceId>9070658C9D4A</deviceId>
<role>LEFT</role>
<ipAddress>192.168.1.131</ipAddress>
<ipAddress>192.0.2.131</ipAddress>
</groupRole>
<groupRole>
<deviceId>F45EAB3115DA</deviceId>
<role>RIGHT</role>
<ipAddress>192.168.1.134</ipAddress>
<ipAddress>192.0.2.134</ipAddress>
</groupRole>
</roles>
</group>
@@ -762,7 +762,7 @@ Returns network status configuration.
<name>eth0</name>
<mac-addr>1004567890AA</mac-addr>
<bindings>
<ipv4address>192.168.1.131</ipv4address>
<ipv4address>192.0.2.131</ipv4address>
</bindings>
<running>true</running>
<kind>Wireless</kind>
+23 -21
View File
@@ -10,19 +10,19 @@ use across the codebase. Use these values in new examples and tests.
## Placeholder mapping
| Concept | Placeholder |
|--------------------------|--------------------------------------------------------------|
| Example IP (primary) | `192.0.2.10` |
| Example IP (secondary) | `192.0.2.11` |
| Example IP (third) | `192.0.2.12` |
| Network / CIDR | `192.0.2.0/24` |
| External / non-LAN IP | `198.51.100.10` or `203.0.113.10` |
| Gateway IP | `192.0.2.1` |
| Device MAC (primary) | `AA:BB:CC:DD:EE:FF` (no separator: `AABBCCDDEEFF`) |
| Device MAC (secondary) | `AA:BB:CC:DD:EE:01` (no separator: `AABBCCDDEE01`) |
| Device ID (some XML) | `ABCD1234EFGH` — legacy placeholder still in some fixtures |
| Device display name | `Living Room SoundTouch` / `Kitchen SoundTouch` / `Bedroom SoundTouch` |
| Bose account ID | `1000001` / `1000002` |
| Concept | Placeholder |
|------------------------|------------------------------------------------------------------------|
| Example IP (primary) | `192.0.2.10` |
| Example IP (secondary) | `192.0.2.11` |
| Example IP (third) | `192.0.2.12` |
| Network / CIDR | `192.0.2.0/24` |
| External / non-LAN IP | `198.51.100.10` or `203.0.113.10` |
| Gateway IP | `192.0.2.1` |
| Device MAC (primary) | `AA:BB:CC:DD:EE:FF` (no separator: `AABBCCDDEEFF`) |
| Device MAC (secondary) | `AA:BB:CC:DD:EE:01` (no separator: `AABBCCDDEE01`) |
| Device ID (some XML) | `ABCD1234EFGH` — legacy placeholder still in some fixtures |
| Device display name | `Living Room SoundTouch` / `Kitchen SoundTouch` / `Bedroom SoundTouch` |
| Bose account ID | `1000001` / `1000002` |
`192.0.2.0/24`, `198.51.100.0/24`, and `203.0.113.0/24` are reserved
by [RFC 5737](https://www.rfc-editor.org/rfc/rfc5737) exclusively for
@@ -39,15 +39,17 @@ pattern) but stay numeric for parsers that expect integer-looking IDs.
## Why we don't use 192.168.1.x
An earlier anonymisation pass (now superseded) used `192.168.1.x` as
its target. That range is RFC-1918 private space — perfectly valid on
real networks, which means a reader can't tell whether `192.168.1.10`
is a placeholder or a documented LAN address. RFC-5737 ranges fix
that.
An earlier anonymisation pass used `192.168.1.x` as its target. That
range is RFC-1918 private space — perfectly valid on real networks,
which means a reader can't tell whether `192.168.1.10` is a
placeholder or a documented LAN address. RFC-5737 ranges fix that:
because they're reserved for documentation only, any reader knows on
sight that they don't represent a real device.
A broader follow-up sweep of remaining `192.168.1.*` references is
tracked separately in NEXT.md (still pending at the time this file
was rewritten).
The `.md` / `.txt` portion of the `192.168.1.*``192.0.2.x` sweep
is complete. Test files (`.go` / `.xml` / `.http`) still carry the
old placeholder pending Phase 2 in the audit at
`_/RFC-5737-cleanup/assessment.md`.
## How to audit before committing
+6 -6
View File
@@ -95,17 +95,17 @@ This Go implementation provides **complete coverage** of the Bose SoundTouch Web
**Official Low-Level API:**
```go
// Individual slave operations (exact official API implementation)
client.AddZoneSlave("MASTER123", "SLAVE456", "192.168.1.101")
client.RemoveZoneSlave("MASTER123", "SLAVE456", "192.168.1.101")
client.AddZoneSlave("MASTER123", "SLAVE456", "192.0.2.101")
client.RemoveZoneSlave("MASTER123", "SLAVE456", "192.0.2.101")
```
**Enhanced High-Level API:**
```go
// High-level fluent API (enhanced implementation)
zone := client.CreateZoneWithIPs("192.168.1.100", []string{"192.168.1.101", "192.168.1.102"})
client.AddToZone("192.168.1.100", "192.168.1.103")
client.RemoveFromZone("192.168.1.100", "192.168.1.101")
client.DissolveZone("192.168.1.100")
zone := client.CreateZoneWithIPs("192.0.2.100", []string{"192.0.2.101", "192.0.2.102"})
client.AddToZone("192.0.2.100", "192.0.2.103")
client.RemoveFromZone("192.0.2.100", "192.0.2.101")
client.DissolveZone("192.0.2.100")
```
**Advantages:**
+6 -6
View File
@@ -26,7 +26,7 @@ Read on for the full manual walkthrough and the rationale behind each step.
> **BLE limitation**: Android emulators do not expose Bluetooth hardware. The Bose app's default setup path (BLE Wi-Fi provisioning) therefore cannot be used to configure a factory-reset speaker from the emulator. Use **AP mode** instead: provision the speaker's Wi-Fi credentials via the Mac command line first (see [DEVICE-INITIAL-SETUP.md § 6](../guides/DEVICE-INITIAL-SETUP.md)), then the app can discover the already-networked speaker via mDNS/SSDP without BLE.
> **Emulator ↔ local network**: The emulator routes all traffic through the Mac's active network interface. Once the speaker is on the same LAN as the Mac, the emulator can reach it at its normal LAN IP (e.g. `192.168.1.50`) — no extra routing is needed. Use `adb shell ping 192.168.1.50` to confirm reachability.
> **Emulator ↔ local network**: The emulator routes all traffic through the Mac's active network interface. Once the speaker is on the same LAN as the Mac, the emulator can reach it at its normal LAN IP (e.g. `192.0.2.50`) — no extra routing is needed. Use `adb shell ping 192.0.2.50` to confirm reachability.
Add Android SDK tools to your PATH (add to `~/.zshrc`):
@@ -149,13 +149,13 @@ Find your Mac's local IP:
```bash
ipconfig getifaddr en0
# e.g. 192.168.1.123
# e.g. 192.0.2.123
```
Set the proxy:
```bash
adb -s emulator-5554 shell settings put global http_proxy 192.168.1.123:8080
adb -s emulator-5554 shell settings put global http_proxy 192.0.2.123:8080
```
---
@@ -214,7 +214,7 @@ Edit `/tmp/config.js` and set:
```javascript
const CERT_PEM = `<contents of ~/.mitmproxy/mitmproxy-ca-cert.pem>`;
const PROXY_HOST = '192.168.1.123'; // your Mac IP
const PROXY_HOST = '192.0.2.123'; // your Mac IP
const PROXY_PORT = 8080;
```
@@ -251,8 +251,8 @@ Expected output in the Frida REPL:
```
== System certificate trust injected ==
== Proxy system configuration overridden to 192.168.1.123:8080 ==
== Proxy configuration overridden to 192.168.1.123:8080 ==
== Proxy system configuration overridden to 192.0.2.123:8080 ==
== Proxy configuration overridden to 192.0.2.123:8080 ==
== Certificate unpinning completed ==
== Unpinning fallback auto-patcher installed ==
```
+9 -9
View File
@@ -34,10 +34,10 @@ The most robust and granular method involves modifying the device's private conf
Requires SSH access to the device.
```xml
<SoundTouchSdkPrivateCfg>
<margeServerUrl>http://192.168.1.10:8000</margeServerUrl>
<statsServerUrl>http://192.168.1.10:8000</statsServerUrl>
<swUpdateUrl>http://192.168.1.10:8000/updates/soundtouch</swUpdateUrl>
<bmxRegistryUrl>http://192.168.1.10:8000/bmx/registry/v1/services</bmxRegistryUrl>
<margeServerUrl>http://192.0.2.10:8000</margeServerUrl>
<statsServerUrl>http://192.0.2.10:8000</statsServerUrl>
<swUpdateUrl>http://192.0.2.10:8000/updates/soundtouch</swUpdateUrl>
<bmxRegistryUrl>http://192.0.2.10:8000/bmx/registry/v1/services</bmxRegistryUrl>
</SoundTouchSdkPrivateCfg>
```
@@ -45,7 +45,7 @@ Requires SSH access to the device.
> at the **root** of port 8000, so the URL has no `/marge` suffix.
> [`deborahgu/soundcork`](https://github.com/deborahgu/soundcork) routes marge
> under a `/marge` sub-path, so users redirecting to soundcork must append it
> (`http://192.168.1.10:8000/marge`).
> (`http://192.0.2.10:8000/marge`).
### Pros & Cons
| Pros | Cons |
@@ -68,9 +68,9 @@ This method uses the standard Linux hosts file to redirect traffic at the networ
### Implementation
Requires SSH access. Add entries for the target domains:
```text
192.168.1.10 streaming.bose.com
192.168.1.10 updates.bose.com
192.168.1.10 stats.bose.com
192.0.2.10 streaming.bose.com
192.0.2.10 updates.bose.com
192.0.2.10 stats.bose.com
```
### Pros & Cons
@@ -141,7 +141,7 @@ A common question is whether these methods can be used in isolation or if they m
If your firmware does not strictly enforce the `IsItBose` check for the specific URLs you are changing, **Method 1 (XML)** is sufficient. This is the cleanest approach and is used by the `soundtouch-service` migration tool.
### Scenario B: XML Config + Binary Patching (The "Locked" Case)
On some newer firmware versions, even if you change the `<margeServerUrl>` in the XML to `http://192.168.1.10`, the internal library (`libBmxAccountHsm.so`) will validate the string against the hardcoded Bose regex.
On some newer firmware versions, even if you change the `<margeServerUrl>` in the XML to `http://192.0.2.10`, the internal library (`libBmxAccountHsm.so`) will validate the string against the hardcoded Bose regex.
* **Symptom**: The device ignores the XML setting or fails to connect despite the correct URL being present.
* **Solution**: You **must** apply the **Binary Patch (Method 3)** to neutralize the `IsItBose` check *in addition* to the XML change.
+4 -4
View File
@@ -656,10 +656,10 @@ func main() {
soundtouch discover
# Device operations
soundtouch --device 192.168.1.100 info
soundtouch --device 192.168.1.100 play
soundtouch --device 192.168.1.100 volume 50
soundtouch --device 192.168.1.100 preset 1
soundtouch --device 192.0.2.100 info
soundtouch --device 192.0.2.100 play
soundtouch --device 192.0.2.100 volume 50
soundtouch --device 192.0.2.100 preset 1
# Interactive mode
soundtouch interactive
+2 -2
View File
@@ -171,7 +171,7 @@ This project implements a comprehensive Go client library and CLI tool for Bose
- **Notification System**: TTS and URL playback with multi-language support
- **API Compliance**: Proper press+release key pattern implementation
- **Safety First**: Volume warnings and limits for user protection
- **User Experience**: Host:port parsing (e.g., `-host 192.168.1.100:8090`)
- **User Experience**: Host:port parsing (e.g., `-host 192.0.2.100:8090`)
- **CLI Enhancement**: Direct flags for common operations and audio control
- **Discovery Excellence**: Multi-protocol discovery (UPnP + mDNS) with caching
- **Real Device Testing**: Validated with SoundTouch 10 and SoundTouch 20
@@ -193,7 +193,7 @@ This project implements a comprehensive Go client library and CLI tool for Bose
- **HTTP Client**: Mock server tests with real response data
### Integration Tests
- **Real Devices**: SoundTouch 10 (192.168.1.10) and SoundTouch 20 (192.168.1.11)
- **Real Devices**: SoundTouch 10 (192.0.2.10) and SoundTouch 20 (192.0.2.11)
- **All Endpoints**: Validated against actual hardware
- **Source Selection**: Tested with Spotify, TuneIn, and other available sources
- **Bass Control**: Tested bass adjustment, validation, and device-specific behavior
+2 -2
View File
@@ -568,7 +568,7 @@ Response: 200 OK
"reason": "mdns_discovery",
"source": "discovery",
"context": {
"ip_address": "192.168.1.100",
"ip_address": "192.0.2.100",
"discovery_method": "mdns"
}
},
@@ -586,7 +586,7 @@ Response: 200 OK
"serial_number": "I6332527703739342000020",
"firmware_version": "4.8.1.25341.2677643.1597353330",
"mac_address": "AA:BB:CC:DD:EE:FF",
"ip_address": "192.168.1.100",
"ip_address": "192.0.2.100",
"last_seen": "2024-01-20T15:30:00Z",
"is_legacy_id": false,
"capabilities": ["multiroom", "bluetooth", "aux"]
+2 -2
View File
@@ -138,7 +138,7 @@ data/
"serial_number": "I6332527703739342000020",
"firmware_version": "4.8.1.25341.2677643.1597353330",
"mac_address": "AA:BB:CC:DD:EE:FF",
"ip_address": "192.168.1.100",
"ip_address": "192.0.2.100",
"last_seen": "2024-01-20T16:20:00Z",
"is_legacy_id": false
},
@@ -166,7 +166,7 @@ data/
2024-01-20T16:15:30Z|volume_changed|websocket|{"volume":45,"muted":false}
2024-01-20T16:16:00Z|preset_selected|websocket|{"preset":1,"source":"SPOTIFY","location":"spotify:track:123"}
2024-01-20T16:18:00Z|disparity_detected|mirror|{"endpoint":"/v1/account/full","local_hash":"abc123","upstream_hash":"def456"}
2024-01-20T16:20:00Z|device_online|discovery|{"ip":"192.168.1.100","method":"mdns"}
2024-01-20T16:20:00Z|device_online|discovery|{"ip":"192.0.2.100","method":"mdns"}
```
### Disparity Log Format
@@ -50,7 +50,7 @@ The current system uses multiple data collection methods to build a complete dev
<margeURL>https://streaming.bose.com</margeURL>
<networkInfo type="SCM">
<macAddress>AA:BB:CC:DD:EE:FF</macAddress>
<ipAddress>192.168.1.10</ipAddress>
<ipAddress>192.0.2.10</ipAddress>
</networkInfo>
<moduleType>sm2</moduleType>
<variant>rhino</variant>
+6 -6
View File
@@ -39,12 +39,12 @@ Shows the network layout with Raspberry Pi, router, and SoundTouch devices.
```
Internet Cloud
↑↓ (Optional - during migration)
Home Router (192.168.1.1)
├── Raspberry Pi (192.168.1.10) [SoundTouch Service]
├── Living Room Speaker (192.168.1.100)
├── Kitchen Speaker (192.168.1.101)
├── Bedroom Speaker (192.168.1.102)
└── Office Speaker (192.168.1.103)
Home Router (192.0.2.1)
├── Raspberry Pi (192.0.2.10) [SoundTouch Service]
├── Living Room Speaker (192.0.2.100)
├── Kitchen Speaker (192.0.2.101)
├── Bedroom Speaker (192.0.2.102)
└── Office Speaker (192.0.2.103)
```
### Connections
+2 -2
View File
@@ -200,7 +200,7 @@ echo "Proxy set to ${MAC_IP}:8080"
Confirm emulator can reach the speaker:
```bash
SPEAKER_IP=192.168.1.50 # adjust to your speaker's LAN IP
SPEAKER_IP=192.0.2.50 # adjust to your speaker's LAN IP
adb -s emulator-5554 shell ping -c 3 "$SPEAKER_IP"
```
@@ -394,7 +394,7 @@ Raw log of the first interactive run. To be cleaned up into the runbook above.
### Wi-Fi Provisioning (AP mode)
- `airport` command not available on this macOS version (removed in recent releases)
- Connect Mac to speaker AP via **System Settings → Wi-Fi** (SSID: "Bose SoundTouch XXXX")
- Speaker AP gateway confirmed: `192.0.2.1` (client gets `192.0.2.2`), not `192.168.1.1` as previously assumed
- Speaker AP gateway confirmed: `192.0.2.1` (client gets `192.0.2.2`), not `192.0.2.1` as previously assumed
- `/gabbo_wifi` endpoint was hallucinated — actual endpoint verified from browser network capture (`_/device-reset/wifi-setup.txt`):
- Site survey: `POST http://192.0.2.1:8090/performWirelessSiteSurvey` with `<PerformWirelessSiteSurvey timeout="5"/>`
- Add profile: `POST http://192.0.2.1:8090/addWirelessProfile` with XML body, `securityType="wpa_or_wpa2"`
+125 -125
View File
@@ -68,7 +68,7 @@ soundtouch-cli --host <device> info
**Example:**
```bash
soundtouch-cli --host 192.168.1.10 info
soundtouch-cli --host 192.0.2.10 info
```
#### `name get|set`
@@ -119,16 +119,16 @@ soundtouch-cli --host <device> preset remove --slot <1-6>
**Store Current Content Examples:**
```bash
# Store what's currently playing as preset 1
soundtouch-cli --host 192.168.1.10 preset store-current --slot 1
soundtouch-cli --host 192.0.2.10 preset store-current --slot 1
# Store current Spotify track as preset 3
soundtouch-cli --host 192.168.1.10 preset store-current --slot 3
soundtouch-cli --host 192.0.2.10 preset store-current --slot 3
```
**Store Specific Content Examples:**
```bash
# Store Spotify playlist
soundtouch-cli --host 192.168.1.10 preset store \
soundtouch-cli --host 192.0.2.10 preset store \
--slot 1 \
--source SPOTIFY \
--location "spotify:playlist:37i9dQZF1DXcBWIGoYBM5M" \
@@ -136,14 +136,14 @@ soundtouch-cli --host 192.168.1.10 preset store \
--name "Today's Top Hits"
# Store radio station
soundtouch-cli --host 192.168.1.10 preset store \
soundtouch-cli --host 192.0.2.10 preset store \
--slot 2 \
--source TUNEIN \
--location "/v1/playback/station/s33828" \
--name "K-LOVE Radio"
# Store internet radio
soundtouch-cli --host 192.168.1.10 preset store \
soundtouch-cli --host 192.0.2.10 preset store \
--slot 3 \
--source LOCAL_INTERNET_RADIO \
--location "https://stream.example.com/jazz" \
@@ -153,13 +153,13 @@ soundtouch-cli --host 192.168.1.10 preset store \
**Selection and Management Examples:**
```bash
# List all presets
soundtouch-cli --host 192.168.1.10 preset list
soundtouch-cli --host 192.0.2.10 preset list
# Select preset 1
soundtouch-cli --host 192.168.1.10 preset select --slot 1
soundtouch-cli --host 192.0.2.10 preset select --slot 1
# Remove preset 6
soundtouch-cli --host 192.168.1.10 preset remove --slot 6
soundtouch-cli --host 192.0.2.10 preset remove --slot 6
```
**Getting Content Locations:**
@@ -168,10 +168,10 @@ To find content locations for the `--location` parameter:
```bash
# Show current content details (includes location for all sources)
soundtouch-cli --host 192.168.1.10 play now
soundtouch-cli --host 192.0.2.10 play now
# Show detailed content information
soundtouch-cli --host 192.168.1.10 play now --verbose
soundtouch-cli --host 192.0.2.10 play now --verbose
```
### Recent Content
@@ -199,28 +199,28 @@ soundtouch-cli --host <device> recents stats
**Basic Usage Examples:**
```bash
# List last 10 recent items (default)
soundtouch-cli --host 192.168.1.10 recents list
soundtouch-cli --host 192.0.2.10 recents list
# Show all recent items with detailed information
soundtouch-cli --host 192.168.1.10 recents list --limit 0 --detailed
soundtouch-cli --host 192.0.2.10 recents list --limit 0 --detailed
# Show only the most recent item
soundtouch-cli --host 192.168.1.10 recents latest
soundtouch-cli --host 192.0.2.10 recents latest
```
**Filtering Examples:**
```bash
# Show only Spotify items
soundtouch-cli --host 192.168.1.10 recents filter --source SPOTIFY
soundtouch-cli --host 192.0.2.10 recents filter --source SPOTIFY
# Show only tracks (no stations or playlists)
soundtouch-cli --host 192.168.1.10 recents filter --type track
soundtouch-cli --host 192.0.2.10 recents filter --type track
# Show only presetable items
soundtouch-cli --host 192.168.1.10 recents filter --type presetable
soundtouch-cli --host 192.0.2.10 recents filter --type presetable
# Show last 5 local music items
soundtouch-cli --host 192.168.1.10 recents filter --source LOCAL_MUSIC --limit 5
soundtouch-cli --host 192.0.2.10 recents filter --source LOCAL_MUSIC --limit 5
```
**Available Sources:**
@@ -242,7 +242,7 @@ soundtouch-cli --host 192.168.1.10 recents filter --source LOCAL_MUSIC --limit 5
**Statistics Example:**
```bash
# Get detailed statistics about recent content
soundtouch-cli --host 192.168.1.10 recents stats
soundtouch-cli --host 192.0.2.10 recents stats
```
#### `presets` (Legacy)
@@ -292,10 +292,10 @@ soundtouch-cli --host <device> preset --preset <1-6>
**Examples:**
```bash
# Select preset 1
soundtouch-cli --host 192.168.1.10 preset --preset 1
soundtouch-cli --host 192.0.2.10 preset --preset 1
# Select preset 6
soundtouch-cli --host 192.168.1.10 preset --preset 6
soundtouch-cli --host 192.0.2.10 preset --preset 6
```
#### `track`
@@ -362,16 +362,16 @@ soundtouch-cli --host <device> volume down [--amount <1-10>]
**Examples:**
```bash
# Get volume
soundtouch-cli --host 192.168.1.10 volume get
soundtouch-cli --host 192.0.2.10 volume get
# Set volume to 50
soundtouch-cli --host 192.168.1.10 volume set --level 50
soundtouch-cli --host 192.0.2.10 volume set --level 50
# Increase volume by 5
soundtouch-cli --host 192.168.1.10 volume up --amount 5
soundtouch-cli --host 192.0.2.10 volume up --amount 5
# Decrease volume by 3 (default amount is 2)
soundtouch-cli --host 192.168.1.10 volume down --amount 3
soundtouch-cli --host 192.0.2.10 volume down --amount 3
```
### Audio Sources
@@ -419,42 +419,42 @@ soundtouch-cli --host <device> source content --source <SOURCE> --location <LOCA
**Examples:**
```bash
# List all sources
soundtouch-cli --host 192.168.1.10 source list
soundtouch-cli --host 192.0.2.10 source list
# Select Spotify
soundtouch-cli --host 192.168.1.10 source spotify
soundtouch-cli --host 192.0.2.10 source spotify
# Select Spotify with specific account
soundtouch-cli --host 192.168.1.10 source select --source SPOTIFY --account user@example.com
soundtouch-cli --host 192.0.2.10 source select --source SPOTIFY --account user@example.com
# Select Bluetooth
soundtouch-cli --host 192.168.1.10 source bluetooth
soundtouch-cli --host 192.0.2.10 source bluetooth
# Select internet radio with streamUrl format
soundtouch-cli --host 192.168.1.10 source internet-radio \
soundtouch-cli --host 192.0.2.10 source internet-radio \
--location "http://contentapi.gmuth.de/station.php?name=MyStation&streamUrl=https://stream.example.com/radio" \
--name "My Radio Station" \
--artwork "https://example.com/art.png"
# Select internet radio with direct stream URL
soundtouch-cli --host 192.168.1.10 source internet-radio \
soundtouch-cli --host 192.0.2.10 source internet-radio \
--location "https://stream.example.com/radio" \
--name "My Stream"
# Select local music content (requires SoundTouch App Media Server)
soundtouch-cli --host 192.168.1.10 source local-music \
soundtouch-cli --host 192.0.2.10 source local-music \
--location "album:983" \
--account "3f205110-4a57-4e91-810a-123456789012" \
--name "Welcome to the New"
# Select stored music content (requires UPnP/DLNA media server)
soundtouch-cli --host 192.168.1.10 source stored-music \
soundtouch-cli --host 192.0.2.10 source stored-music \
--location "6_a2874b5d_4f83d999" \
--account "d09708a1-5953-44bc-a413-123456789012/0" \
--name "Christmas Album"
# Advanced content selection with all options
soundtouch-cli --host 192.168.1.10 source content \
soundtouch-cli --host 192.0.2.10 source content \
--source LOCAL_INTERNET_RADIO \
--location "https://stream.example.com/radio" \
--name "My Stream" \
@@ -462,22 +462,22 @@ soundtouch-cli --host 192.168.1.10 source content \
--presetable
# Get introspect data for Spotify
soundtouch-cli --host 192.168.1.10 source introspect --source SPOTIFY
soundtouch-cli --host 192.0.2.10 source introspect --source SPOTIFY
# Get introspect data with account
soundtouch-cli --host 192.168.1.10 source introspect --source SPOTIFY --account user@spotify.com
soundtouch-cli --host 192.0.2.10 source introspect --source SPOTIFY --account user@spotify.com
# Spotify introspect (convenience command)
soundtouch-cli --host 192.168.1.10 source introspect-spotify
soundtouch-cli --host 192.0.2.10 source introspect-spotify
# Get introspect data for all available services
soundtouch-cli --host 192.168.1.10 source introspect-all
soundtouch-cli --host 192.0.2.10 source introspect-all
# Check service availability
soundtouch-cli --host 192.168.1.10 source availability
soundtouch-cli --host 192.0.2.10 source availability
# Compare sources and availability
soundtouch-cli --host 192.168.1.10 source compare
soundtouch-cli --host 192.0.2.10 source compare
```
**Content Selection Commands:**
@@ -496,12 +496,12 @@ The `internet-radio` command supports the streamUrl proxy format from the [Sound
```bash
# Using contentapi.gmuth.de proxy for complex streams
soundtouch-cli --host 192.168.1.10 source internet-radio \
soundtouch-cli --host 192.0.2.10 source internet-radio \
--location "http://contentapi.gmuth.de/station.php?name=Antenne%20Chillout&streamUrl=https://stream.antenne.de/chillout/stream/aacp" \
--name "Antenne Chillout"
# Using local soundtouch-service for custom streams
soundtouch-cli --host 192.168.1.10 source custom-radio \
soundtouch-cli --host 192.0.2.10 source custom-radio \
--url "https://stream.antenne.de/chillout/stream/aacp" \
--name "Antenne Chillout" \
--service-url "http://localhost:8080"
@@ -543,19 +543,19 @@ soundtouch-cli --host <device> source introspect-all
**Examples:**
```bash
# Get Spotify service status
soundtouch-cli --host 192.168.1.10 source introspect --source SPOTIFY
soundtouch-cli --host 192.0.2.10 source introspect --source SPOTIFY
# Get Spotify status with specific account
soundtouch-cli --host 192.168.1.10 source introspect --source SPOTIFY --account my_spotify_user
soundtouch-cli --host 192.0.2.10 source introspect --source SPOTIFY --account my_spotify_user
# Use Spotify convenience command
soundtouch-cli --host 192.168.1.10 source introspect-spotify
soundtouch-cli --host 192.0.2.10 source introspect-spotify
# Get status for all available streaming services
soundtouch-cli --host 192.168.1.10 source introspect-all
soundtouch-cli --host 192.0.2.10 source introspect-all
# Check which services are available before introspecting
soundtouch-cli --host 192.168.1.10 source availability
soundtouch-cli --host 192.0.2.10 source availability
```
### Music Service Account Management
@@ -604,40 +604,40 @@ soundtouch-cli --host <device> account remove-nas --user <GUID/0> [--name <NAME>
**Examples:**
```bash
# List all configured music service accounts
soundtouch-cli --host 192.168.1.10 account list
soundtouch-cli --host 192.0.2.10 account list
# Add a Spotify Premium account
soundtouch-cli --host 192.168.1.10 account add-spotify \
soundtouch-cli --host 192.0.2.10 account add-spotify \
--user "user@spotify.com" \
--password "mypassword"
# Add a Pandora account
soundtouch-cli --host 192.168.1.10 account add-pandora \
soundtouch-cli --host 192.0.2.10 account add-pandora \
--user "pandora_username" \
--password "pandora_password"
# Add an Amazon Music account
soundtouch-cli --host 192.168.1.10 account add-amazon \
soundtouch-cli --host 192.0.2.10 account add-amazon \
--user "amazon_user" \
--password "amazon_password"
# Add a network music library (NAS/UPnP)
soundtouch-cli --host 192.168.1.10 account add-nas \
soundtouch-cli --host 192.0.2.10 account add-nas \
--user "d09708a1-5953-44bc-a413-123456789012/0" \
--name "My Music Server"
# Remove a Spotify account
soundtouch-cli --host 192.168.1.10 account remove-spotify \
soundtouch-cli --host 192.0.2.10 account remove-spotify \
--user "user@spotify.com"
# Generic account management
soundtouch-cli --host 192.168.1.10 account add \
soundtouch-cli --host 192.0.2.10 account add \
--source DEEZER \
--user "deezer_user" \
--password "deezer_pass" \
--name "Deezer Premium"
soundtouch-cli --host 192.168.1.10 account remove \
soundtouch-cli --host 192.0.2.10 account remove \
--source DEEZER \
--user "deezer_user"
```
@@ -676,16 +676,16 @@ soundtouch-cli --host <device> bass capabilities
**Examples:**
```bash
# Get current bass
soundtouch-cli --host 192.168.1.10 bass get
soundtouch-cli --host 192.0.2.10 bass get
# Set bass to +3
soundtouch-cli --host 192.168.1.10 bass set --level 3
soundtouch-cli --host 192.0.2.10 bass set --level 3
# Increase bass by 2
soundtouch-cli --host 192.168.1.10 bass up --amount 2
soundtouch-cli --host 192.0.2.10 bass up --amount 2
# Decrease bass by 1 (default)
soundtouch-cli --host 192.168.1.10 bass down
soundtouch-cli --host 192.0.2.10 bass down
```
### Balance Control
@@ -716,16 +716,16 @@ soundtouch-cli --host <device> balance center
**Examples:**
```bash
# Get balance
soundtouch-cli --host 192.168.1.10 balance get
soundtouch-cli --host 192.0.2.10 balance get
# Set balance 10 units to the right
soundtouch-cli --host 192.168.1.10 balance set --level 10
soundtouch-cli --host 192.0.2.10 balance set --level 10
# Shift left by 5 units (default)
soundtouch-cli --host 192.168.1.10 balance left
soundtouch-cli --host 192.0.2.10 balance left
# Center the balance
soundtouch-cli --host 192.168.1.10 balance center
soundtouch-cli --host 192.0.2.10 balance center
```
### Clock and Time
@@ -757,22 +757,22 @@ soundtouch-cli --host <device> clock display format --format <12|24>
**Examples:**
```bash
# Get current time
soundtouch-cli --host 192.168.1.10 clock get
soundtouch-cli --host 192.0.2.10 clock get
# Set time to 2:30 PM
soundtouch-cli --host 192.168.1.10 clock set --time "14:30"
soundtouch-cli --host 192.0.2.10 clock set --time "14:30"
# Sync with system time
soundtouch-cli --host 192.168.1.10 clock now
soundtouch-cli --host 192.0.2.10 clock now
# Enable clock display
soundtouch-cli --host 192.168.1.10 clock display enable
soundtouch-cli --host 192.0.2.10 clock display enable
# Set 24-hour format
soundtouch-cli --host 192.168.1.10 clock display format --format 24
soundtouch-cli --host 192.0.2.10 clock display format --format 24
# Set high brightness
soundtouch-cli --host 192.168.1.10 clock display brightness --brightness high
soundtouch-cli --host 192.0.2.10 clock display brightness --brightness high
```
### Network Information
@@ -831,19 +831,19 @@ soundtouch-cli --host <device> zone set --master <ip> --members <ip1,ip2>
**Examples:**
```bash
# Get current zone info
soundtouch-cli --host 192.168.1.10 zone get
soundtouch-cli --host 192.0.2.10 zone get
# Create zone with three speakers
soundtouch-cli --host 192.168.1.10 zone create --members 192.168.1.11,192.168.1.12
soundtouch-cli --host 192.0.2.10 zone create --members 192.0.2.11,192.0.2.12
# Add speaker to existing zone
soundtouch-cli --host 192.168.1.10 zone add --member 192.168.1.13
soundtouch-cli --host 192.0.2.10 zone add --member 192.0.2.13
# Remove speaker from zone
soundtouch-cli --host 192.168.1.10 zone remove --member 192.168.1.12
soundtouch-cli --host 192.0.2.10 zone remove --member 192.0.2.12
# Dissolve the zone (make all speakers independent)
soundtouch-cli --host 192.168.1.10 zone dissolve
soundtouch-cli --host 192.0.2.10 zone dissolve
```
### Browse and Navigation
@@ -877,22 +877,22 @@ soundtouch-cli --host <device> browse container --source <SOURCE> --location <LO
**Examples:**
```bash
# Browse TuneIn stations
soundtouch-cli --host 192.168.1.10 browse tunein
soundtouch-cli --host 192.0.2.10 browse tunein
# Browse first 50 TuneIn stations
soundtouch-cli --host 192.168.1.10 browse tunein --limit 50
soundtouch-cli --host 192.0.2.10 browse tunein --limit 50
# Browse Pandora radio stations
soundtouch-cli --host 192.168.1.10 browse pandora --source-account myuser123
soundtouch-cli --host 192.0.2.10 browse pandora --source-account myuser123
# Browse Pandora with menu navigation
soundtouch-cli --host 192.168.1.10 browse menu --source PANDORA --source-account myuser123 --menu radioStations --sort dateCreated
soundtouch-cli --host 192.0.2.10 browse menu --source PANDORA --source-account myuser123 --menu radioStations --sort dateCreated
# Browse stored music library
soundtouch-cli --host 192.168.1.10 browse stored-music --source-account device_12345
soundtouch-cli --host 192.0.2.10 browse stored-music --source-account device_12345
# Browse into a music album container
soundtouch-cli --host 192.168.1.10 browse container --source STORED_MUSIC --location "album:983" --type dir
soundtouch-cli --host 192.0.2.10 browse container --source STORED_MUSIC --location "album:983" --type dir
```
### Station Search and Management
@@ -926,35 +926,35 @@ soundtouch-cli --host <device> station remove --source <SOURCE> --location <LOCA
**Search Examples:**
```bash
# Search TuneIn for jazz stations
soundtouch-cli --host 192.168.1.10 station search-tunein --query "jazz"
soundtouch-cli --host 192.0.2.10 station search-tunein --query "jazz"
# Search Pandora for Taylor Swift
soundtouch-cli --host 192.168.1.10 station search-pandora --source-account myuser123 --query "Taylor Swift"
soundtouch-cli --host 192.0.2.10 station search-pandora --source-account myuser123 --query "Taylor Swift"
# Search Spotify for workout playlists
soundtouch-cli --host 192.168.1.10 station search-spotify --source-account spotify_user --query "workout playlist"
soundtouch-cli --host 192.0.2.10 station search-spotify --source-account spotify_user --query "workout playlist"
# General search across any source
soundtouch-cli --host 192.168.1.10 station search --source TUNEIN --query "classic rock"
soundtouch-cli --host 192.0.2.10 station search --source TUNEIN --query "classic rock"
```
**Station Management Examples:**
```bash
# Add a station found from search results (use token from search output)
soundtouch-cli --host 192.168.1.10 station add \
soundtouch-cli --host 192.0.2.10 station add \
--source TUNEIN \
--token "c121508" \
--name "Classic Rock Radio"
# Add Pandora station with account
soundtouch-cli --host 192.168.1.10 station add \
soundtouch-cli --host 192.0.2.10 station add \
--source PANDORA \
--source-account myuser123 \
--token "TR:12345" \
--name "My Custom Station"
# Remove a station (use location from browse/search results)
soundtouch-cli --host 192.168.1.10 station remove \
soundtouch-cli --host 192.0.2.10 station remove \
--source TUNEIN \
--location "/v1/playback/station/s33828"
```
@@ -962,16 +962,16 @@ soundtouch-cli --host 192.168.1.10 station remove \
**Workflow Example - Discover and Play New Content:**
```bash
# 1. Search for content
soundtouch-cli --host 192.168.1.10 station search-tunein --query "smooth jazz"
soundtouch-cli --host 192.0.2.10 station search-tunein --query "smooth jazz"
# 2. Add interesting station from results (copy token from output)
soundtouch-cli --host 192.168.1.10 station add \
soundtouch-cli --host 192.0.2.10 station add \
--source TUNEIN \
--token "c456789" \
--name "Smooth Jazz 24/7"
# 3. Station is automatically playing! Or browse for more options:
soundtouch-cli --host 192.168.1.10 browse tunein --limit 10
soundtouch-cli --host 192.0.2.10 browse tunein --limit 10
```
### Speaker Notifications and Content
@@ -999,19 +999,19 @@ soundtouch-cli speaker help
**TTS Examples:**
```bash
# Basic TTS in English
soundtouch-cli --host 192.168.1.10 speaker tts \
soundtouch-cli --host 192.0.2.10 speaker tts \
--text "Hello, welcome home" \
--app-key "your-app-key"
# TTS with volume and language
soundtouch-cli --host 192.168.1.10 speaker tts \
soundtouch-cli --host 192.0.2.10 speaker tts \
--text "Bonjour le monde" \
--app-key "your-app-key" \
--volume 70 \
--language FR
# TTS for home automation alert
soundtouch-cli --host 192.168.1.10 speaker tts \
soundtouch-cli --host 192.0.2.10 speaker tts \
--text "Motion detected at front door" \
--app-key "security-system-key" \
--volume 80
@@ -1020,13 +1020,13 @@ soundtouch-cli --host 192.168.1.10 speaker tts \
**URL Content Examples:**
```bash
# Play audio file from URL
soundtouch-cli --host 192.168.1.10 speaker url \
soundtouch-cli --host 192.0.2.10 speaker url \
--url "https://example.com/doorbell.mp3" \
--app-key "your-app-key" \
--volume 75
# Play with custom metadata
soundtouch-cli --host 192.168.1.10 speaker url \
soundtouch-cli --host 192.0.2.10 speaker url \
--url "https://example.com/song.mp3" \
--app-key "your-app-key" \
--service "Music Service" \
@@ -1035,7 +1035,7 @@ soundtouch-cli --host 192.168.1.10 speaker url \
--volume 60
# Emergency alert
soundtouch-cli --host 192.168.1.10 speaker url \
soundtouch-cli --host 192.0.2.10 speaker url \
--url "https://alerts.example.com/fire-alarm.wav" \
--app-key "emergency-system" \
--service "Emergency System" \
@@ -1046,10 +1046,10 @@ soundtouch-cli --host 192.168.1.10 speaker url \
**Simple Notifications:**
```bash
# Quick beep notification
soundtouch-cli --host 192.168.1.10 speaker beep
soundtouch-cli --host 192.0.2.10 speaker beep
# Test device connectivity with beep
soundtouch-cli --host 192.168.1.10 speaker beep
soundtouch-cli --host 192.0.2.10 speaker beep
```
**Supported Languages for TTS:**
@@ -1106,16 +1106,16 @@ soundtouch-cli --host <device> events subscribe [flags]
**Examples:**
```bash
# Monitor all events
soundtouch-cli --host 192.168.1.10 events subscribe
soundtouch-cli --host 192.0.2.10 events subscribe
# Monitor only volume and now playing events
soundtouch-cli --host 192.168.1.10 events subscribe --filter volume,nowPlaying
soundtouch-cli --host 192.0.2.10 events subscribe --filter volume,nowPlaying
# Monitor for 5 minutes with verbose output
soundtouch-cli --host 192.168.1.10 events subscribe --duration 5m --verbose
soundtouch-cli --host 192.0.2.10 events subscribe --duration 5m --verbose
# Monitor zone events without automatic reconnection
soundtouch-cli --host 192.168.1.10 events subscribe --filter zone --no-reconnect
soundtouch-cli --host 192.0.2.10 events subscribe --filter zone --no-reconnect
```
**Notes:**
@@ -1133,59 +1133,59 @@ soundtouch-cli --host 192.168.1.10 events subscribe --filter zone --no-reconnect
soundtouch-cli discover devices
# Get device info
soundtouch-cli --host 192.168.1.10 info
soundtouch-cli --host 192.0.2.10 info
# Set comfortable volume and start playing
soundtouch-cli --host 192.168.1.10 volume set --level 30
soundtouch-cli --host 192.168.1.10 source spotify
soundtouch-cli --host 192.168.1.10 play start
soundtouch-cli --host 192.0.2.10 volume set --level 30
soundtouch-cli --host 192.0.2.10 source spotify
soundtouch-cli --host 192.0.2.10 play start
```
### Daily Usage
```bash
# Morning routine
soundtouch-cli --host 192.168.1.10 preset --preset 1 # Morning playlist
soundtouch-cli --host 192.168.1.10 volume set --level 25
soundtouch-cli --host 192.0.2.10 preset --preset 1 # Morning playlist
soundtouch-cli --host 192.0.2.10 volume set --level 25
# Pause for a call
soundtouch-cli --host 192.168.1.10 play pause
soundtouch-cli --host 192.0.2.10 play pause
# Resume
soundtouch-cli --host 192.168.1.10 play start
soundtouch-cli --host 192.0.2.10 play start
# Evening routine
soundtouch-cli --host 192.168.1.10 preset --preset 3 # Evening playlist
soundtouch-cli --host 192.168.1.10 volume set --level 15
soundtouch-cli --host 192.0.2.10 preset --preset 3 # Evening playlist
soundtouch-cli --host 192.0.2.10 volume set --level 15
```
### Multi-room Setup
```bash
# Create a zone with living room as master
soundtouch-cli --host 192.168.1.10 zone create --members 192.168.1.11,192.168.1.12
soundtouch-cli --host 192.0.2.10 zone create --members 192.0.2.11,192.0.2.12
# Control the whole zone from master
soundtouch-cli --host 192.168.1.10 volume set --level 40
soundtouch-cli --host 192.168.1.10 source spotify
soundtouch-cli --host 192.168.1.10 preset --preset 2
soundtouch-cli --host 192.0.2.10 volume set --level 40
soundtouch-cli --host 192.0.2.10 source spotify
soundtouch-cli --host 192.0.2.10 preset --preset 2
# Later, dissolve the zone
soundtouch-cli --host 192.168.1.10 zone dissolve
soundtouch-cli --host 192.0.2.10 zone dissolve
```
### Audio Tuning
```bash
# Get current audio settings
soundtouch-cli --host 192.168.1.10 volume get
soundtouch-cli --host 192.168.1.10 bass get
soundtouch-cli --host 192.168.1.10 balance get
soundtouch-cli --host 192.0.2.10 volume get
soundtouch-cli --host 192.0.2.10 bass get
soundtouch-cli --host 192.0.2.10 balance get
# Adjust for better sound
soundtouch-cli --host 192.168.1.10 bass set --level 2 # Slight bass boost
soundtouch-cli --host 192.168.1.10 balance set --level -5 # Slightly left
soundtouch-cli --host 192.168.1.10 volume set --level 35 # Good listening level
soundtouch-cli --host 192.0.2.10 bass set --level 2 # Slight bass boost
soundtouch-cli --host 192.0.2.10 balance set --level -5 # Slightly left
soundtouch-cli --host 192.0.2.10 volume set --level 35 # Good listening level
```
## Error Handling
@@ -1235,7 +1235,7 @@ soundtouch-cli zone create --help
You can set default values using environment variables:
```bash
export SOUNDTOUCH_HOST=192.168.1.10
export SOUNDTOUCH_HOST=192.0.2.10
export SOUNDTOUCH_PORT=8090
export SOUNDTOUCH_TIMEOUT=15s
@@ -1249,7 +1249,7 @@ soundtouch-cli volume get
Create `~/.soundtouch.env`:
```
SOUNDTOUCH_HOST=192.168.1.10
SOUNDTOUCH_HOST=192.0.2.10
SOUNDTOUCH_PORT=8090
SOUNDTOUCH_TIMEOUT=15s
SOUNDTOUCH_DISCOVERY_TIMEOUT=10s
+4 -4
View File
@@ -177,8 +177,8 @@ server:
soundtouch:
device_hosts:
- "192.168.1.100"
- "192.168.1.101"
- "192.0.2.100"
- "192.0.2.101"
discovery_timeout: "30s"
request_timeout: "15s"
max_retries: 3
@@ -820,7 +820,7 @@ services:
ports:
- "8080:8080"
environment:
- DEVICE_HOSTS=192.168.1.100,192.168.1.101
- DEVICE_HOSTS=192.0.2.100,192.0.2.101
- LOG_LEVEL=info
- METRICS_ENABLED=true
volumes:
@@ -927,7 +927,7 @@ kind: ConfigMap
metadata:
name: soundtouch-config
data:
device_hosts: "192.168.1.100,192.168.1.101,192.168.1.102"
device_hosts: "192.0.2.100,192.0.2.101,192.0.2.102"
```
#### Systemd Service
+11 -11
View File
@@ -172,14 +172,14 @@ discoverer := discovery.NewDiscoverer(discovery.Config{
devices, err := discoverer.DiscoverDevices()
// Or connect directly if you know the IP
soundtouch := client.NewClientFromHost("192.168.1.100")
soundtouch := client.NewClientFromHost("192.0.2.100")
```
### Client Configuration
```go
config := client.ClientConfig{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090, // Default SoundTouch port
Timeout: 10 * time.Second,
UserAgent: "MyApp/1.0", // Optional
@@ -318,7 +318,7 @@ import (
func main() {
// Connect to device
soundtouch := client.NewClientFromHost("192.168.1.100")
soundtouch := client.NewClientFromHost("192.0.2.100")
// Create WebSocket client
wsClient := soundtouch.NewWebSocketClient(nil)
@@ -369,7 +369,7 @@ memberIDs := []string{"DEVICE456", "DEVICE789"}
soundtouch.CreateZone(masterID, memberIDs)
// Add device to existing zone
soundtouch.AddToZone("DEVICE999", "192.168.1.15")
soundtouch.AddToZone("DEVICE999", "192.0.2.15")
// Remove device from zone
soundtouch.RemoveFromZone("DEVICE456")
@@ -387,7 +387,7 @@ soundtouch.DissolveZone()
**Solutions:**
- Ensure SoundTouch is powered on
- Check both devices are on same network
- Try specifying IP directly: `client.NewClientFromHost("192.168.1.100")`
- Try specifying IP directly: `client.NewClientFromHost("192.0.2.100")`
- Check firewall settings
### Connection Timeouts
@@ -397,7 +397,7 @@ soundtouch.DissolveZone()
**Solutions:**
- Increase timeout: `Timeout: 30 * time.Second`
- Verify IP address and port (default 8090)
- Check network connectivity with `ping 192.168.1.100`
- Check network connectivity with `ping 192.0.2.100`
### Volume/Control Issues
```
@@ -444,14 +444,14 @@ Use the included CLI for quick testing:
go run ./cmd/soundtouch-cli discover devices
# Device info
go run ./cmd/soundtouch-cli --host 192.168.1.100 info
go run ./cmd/soundtouch-cli --host 192.0.2.100 info
# Basic controls
go run ./cmd/soundtouch-cli --host 192.168.1.100 play start
go run ./cmd/soundtouch-cli --host 192.168.1.100 volume set --level 50
go run ./cmd/soundtouch-cli --host 192.0.2.100 play start
go run ./cmd/soundtouch-cli --host 192.0.2.100 volume set --level 50
# WebSocket monitoring (use websocket-demo)
go run ./cmd/websocket-demo --host 192.168.1.100
go run ./cmd/websocket-demo --host 192.0.2.100
```
### Configuration Management
@@ -462,7 +462,7 @@ import "os"
host := os.Getenv("SOUNDTOUCH_HOST")
if host == "" {
host = "192.168.1.100" // fallback
host = "192.0.2.100" // fallback
}
soundtouch := client.NewClientFromHost(host)
+3 -3
View File
@@ -26,7 +26,7 @@ The service automatically maps between these identifiers so that API requests us
The service extracts MAC addresses from UPnP device descriptions:
```xml
<!-- From http://192.168.1.100:8091/XD/BO5EBO5E-F00D-F00D-FEED-AABBCCDDEEFF.xml -->
<!-- From http://192.0.2.100:8091/XD/BO5EBO5E-F00D-F00D-FEED-AABBCCDDEEFF.xml -->
<root xmlns="urn:schemas-upnp-org:device-1-0">
<device>
<friendlyName>Sound Machinery</friendlyName>
@@ -115,7 +115,7 @@ cat > data/accounts/1000001/devices/I6332527703739342000020/DeviceInfo.xml << EO
<name>My SoundTouch Device</name>
<networkInfo type="SCM">
<macAddress>AABBCCDDEEFF</macAddress>
<ipAddress>192.168.1.100</ipAddress>
<ipAddress>192.0.2.100</ipAddress>
</networkInfo>
</info>
EOF
@@ -126,7 +126,7 @@ EOF
**Check UPnP accessibility:**
```bash
# Test UPnP endpoint directly
curl http://192.168.1.100:8091/XD/BO5EBO5E-F00D-F00D-FEED-AABBCCDDEEFF.xml
curl http://192.0.2.100:8091/XD/BO5EBO5E-F00D-F00D-FEED-AABBCCDDEEFF.xml
# Should return XML with <serialNumber> field
```
+5 -5
View File
@@ -35,7 +35,7 @@ The repository ships a `docker-compose.yml` ready for this use case. Clone or do
```bash
cp .env.example .env
# Edit .env:
# SOUNDTOUCH_HOSTNAME=192.168.1.100 ← your server's address
# SOUNDTOUCH_HOSTNAME=192.0.2.100 ← your server's address
# SOUNDTOUCH_VERSION=v0.70.0 ← pin to a release tag instead of 'latest'
docker compose up -d
```
@@ -82,7 +82,7 @@ Open `http://<server>:8000` and go to the **Settings** tab.
![AfterTouch Settings tab](../images/ui-settings.png)
Set the **Target Domain** to the address your speakers can reach — for example `https://soundtouch.fritz.box` or `http://192.168.1.100:8000`. This must be the host's address on your local network, not `localhost`.
Set the **Target Domain** to the address your speakers can reach — for example `https://soundtouch.fritz.box` or `http://192.0.2.100:8000`. This must be the host's address on your local network, not `localhost`.
If you plan to use DNS/DHCP redirect, enable the **DNS Discovery Server** and set the **DNS Bind Address** to `:53`. The upstream DNS should be your router's IP, not the service's own address.
@@ -224,12 +224,12 @@ If you prefer scripting the migration, or the wizard isn't an option (headless s
```bash
# 1. Plan what the reset+pair pipeline will write (dry run, no changes yet).
soundtouch-cli --host 192.168.1.50 setup plan \
soundtouch-cli --host 192.0.2.50 setup plan \
--reset=true --include-pair=false \
--service-url='https://soundtouch.local'
# 2. Trigger the factory reset. The speaker reboots into AP mode.
soundtouch-cli --host 192.168.1.50 setup factory-reset
soundtouch-cli --host 192.0.2.50 setup factory-reset
# --- Manual step: join the speaker's Wi-Fi AP (SSID "Bose SoundTouch ...") ---
@@ -252,7 +252,7 @@ soundtouch-cli setup wait-online --match=42CAFE
# --mode=full runs the canonical WebSocket SETUP sequence (matches the
# Bose app's flow); --account is the 7-digit account ID AfterTouch
# should attach the speaker to.
soundtouch-cli --host 192.168.1.50 setup pair \
soundtouch-cli --host 192.0.2.50 setup pair \
--mode=full --account=1111111 \
--service-url='https://soundtouch.local'
```
+2 -2
View File
@@ -69,7 +69,7 @@ In a web browser on any device on your network, go to:
http://<your-server-ip>:8000
```
Replace `<your-server-ip>` with the actual IP address of the computer running AfterTouch. For example: `http://192.168.1.100:8000`.
Replace `<your-server-ip>` with the actual IP address of the computer running AfterTouch. For example: `http://192.0.2.100:8000`.
If you are on the same computer that is running AfterTouch, you can use `http://localhost:8000`.
@@ -82,7 +82,7 @@ You should see the AfterTouch web interface with tabs: Overview, Settings, Devic
This is the most important setting. Go to the **Settings** tab and set the **Target Domain** to the full address of your AfterTouch server — the same address you used to open the web interface:
```
http://192.168.1.100:8000
http://192.0.2.100:8000
```
Use the IP address of your server, **not** `localhost`. Your speakers need to reach this address over the network, and they cannot resolve `localhost`.
+18 -18
View File
@@ -268,10 +268,10 @@ Device migration switches your SoundTouch devices from Bose's cloud services to
```bash
# Get migration summary first
curl http://localhost:8000/setup/migration-summary/192.168.1.100
curl http://localhost:8000/setup/migration-summary/192.0.2.100
# Perform migration
curl -X POST http://localhost:8000/setup/migrate/192.168.1.100
curl -X POST http://localhost:8000/setup/migrate/192.0.2.100
# Verify migration status
curl http://localhost:8000/setup/devices
@@ -281,16 +281,16 @@ curl http://localhost:8000/setup/devices
```bash
# Migration with custom target URL
curl -X POST "http://localhost:8000/setup/migrate/192.168.1.100?target_url=https://my-server.com:8000"
curl -X POST "http://localhost:8000/setup/migrate/192.0.2.100?target_url=https://my-server.com:8000"
# Per-field literal URL overrides (preferred — used by the web wizard)
curl -X POST "http://localhost:8000/setup/migrate/192.168.1.100?method=xml&target_url=http://server:8000&marge_url=http://server:8000/marge"
curl -X POST "http://localhost:8000/setup/migrate/192.0.2.100?method=xml&target_url=http://server:8000&marge_url=http://server:8000/marge"
# SSH-less migration over the device's port-17000 diagnostic shell
curl -X POST "http://localhost:8000/setup/migrate/192.168.1.100?method=telnet&target_url=http://server:8000"
curl -X POST "http://localhost:8000/setup/migrate/192.0.2.100?method=telnet&target_url=http://server:8000"
# Legacy proxy-fallback for selected fields (kept for API back-compat)
curl -X POST "http://localhost:8000/setup/migrate/192.168.1.100?proxy_url=http://localhost:8000&marge=original&stats=original"
curl -X POST "http://localhost:8000/setup/migrate/192.0.2.100?proxy_url=http://localhost:8000&marge=original&stats=original"
```
See the full parameter reference at `POST /setup/migrate/{deviceIP}` below for `method`, `target_url`, `*_url`, and the legacy mode selectors.
@@ -304,10 +304,10 @@ After migration, verify the device is working correctly:
curl http://localhost:8000/setup/devices
# Test preset functionality
curl "http://192.168.1.100:8090/presets"
curl "http://192.0.2.100:8090/presets"
# Monitor device events (if needed)
curl "http://localhost:8000/events/192.168.1.100"
curl "http://localhost:8000/events/192.0.2.100"
```
#### DNS/DHCP Migration (DHCP-Aware DNS Redirection)
@@ -420,7 +420,7 @@ Lists all discovered SoundTouch devices with their current status.
{
"device_id": "08DF1F0BA325",
"name": "Living Room Speaker",
"ip_address": "192.168.1.100",
"ip_address": "192.0.2.100",
"product_code": "SoundTouch 20",
"firmware_version": "19.0.5",
"migrated": true,
@@ -489,13 +489,13 @@ Migrates device to use local services.
```bash
# Canonical XML migration over SSH to the default service URL
curl -X POST "http://localhost:8000/setup/migrate/192.168.1.100?method=xml"
curl -X POST "http://localhost:8000/setup/migrate/192.0.2.100?method=xml"
# Telnet migration with the soundcork redirect (only marge gets the /marge suffix)
curl -X POST "http://localhost:8000/setup/migrate/192.168.1.100?method=telnet&target_url=http://soundcork.local:8000&marge_url=http://soundcork.local:8000/marge"
curl -X POST "http://localhost:8000/setup/migrate/192.0.2.100?method=telnet&target_url=http://soundcork.local:8000&marge_url=http://soundcork.local:8000/marge"
# DNS interception (writes /etc/resolv.conf hook + installs CA) — *_url overrides are ignored
curl -X POST "http://localhost:8000/setup/migrate/192.168.1.100?method=resolv&target_url=https://my-server.com:8443"
curl -X POST "http://localhost:8000/setup/migrate/192.0.2.100?method=resolv&target_url=https://my-server.com:8443"
```
#### `POST /setup/telnet-probe/{deviceIP}`
@@ -834,25 +834,25 @@ Clears all recorded DNS discovery data from memory and disk.
#### Device Not Discovered
```bash
# Check network connectivity
ping 192.168.1.100
ping 192.0.2.100
# Trigger manual discovery
curl -X POST http://localhost:8000/setup/discover
# Check device accessibility
curl http://192.168.1.100:8090/info
curl http://192.0.2.100:8090/info
```
#### Migration Failures
```bash
# Check SSH connectivity
ssh-keyscan 192.168.1.100
ssh-keyscan 192.0.2.100
# Get migration summary
curl http://localhost:8000/setup/migration-summary/192.168.1.100
curl http://localhost:8000/setup/migration-summary/192.0.2.100
# Verify device configuration
curl http://192.168.1.100:8090/info
curl http://192.0.2.100:8090/info
```
#### Service Connectivity Issues
@@ -931,7 +931,7 @@ func main() {
```yaml
# configuration.yaml
soundtouch:
- host: 192.168.1.100
- host: 192.0.2.100
port: 8090
name: "Living Room Speaker"
+28 -28
View File
@@ -14,13 +14,13 @@ Run these commands to quickly diagnose your setup:
go run ./cmd/soundtouch-cli -discover
# 2. Test specific device connection
go run ./cmd/soundtouch-cli -host 192.168.1.100 -info
go run ./cmd/soundtouch-cli -host 192.0.2.100 -info
# 3. Test basic controls
go run ./cmd/soundtouch-cli -host 192.168.1.100 -volume
go run ./cmd/soundtouch-cli -host 192.0.2.100 -volume
# 4. Test network connectivity
ping 192.168.1.100
ping 192.0.2.100
```
---
@@ -70,7 +70,7 @@ discoverer := discovery.NewDiscoverer(discovery.Config{
#### 5. **Use Manual IP**
```go
// Bypass discovery entirely
client := client.NewClientFromHost("192.168.1.100")
client := client.NewClientFromHost("192.0.2.100")
```
### ❌ "Discovery timeout"
@@ -93,10 +93,10 @@ discoverer := discovery.NewDiscoverer(discovery.Config{
2. **Check network performance:**
```bash
# Test network latency
ping -c 4 192.168.1.1
ping -c 4 192.0.2.1
# Check for network congestion
iperf3 -c 192.168.1.1 # If iperf server available
iperf3 -c 192.0.2.1 # If iperf server available
```
3. **Use wired connection if possible**
@@ -213,7 +213,7 @@ If presets still won't play after step 5, capture `logread -f | grep -v '127.0.0
**Symptoms:**
```go
Failed to connect: dial tcp 192.168.1.100:8090: connection refused
Failed to connect: dial tcp 192.0.2.100:8090: connection refused
```
**Diagnostic Steps:**
@@ -221,12 +221,12 @@ Failed to connect: dial tcp 192.168.1.100:8090: connection refused
#### 1. **Verify IP and Port**
```bash
# Test if port 8090 is open
telnet 192.168.1.100 8090
telnet 192.0.2.100 8090
# OR
nc -zv 192.168.1.100 8090
nc -zv 192.0.2.100 8090
# Scan for open ports
nmap -p 8080-8100 192.168.1.100
nmap -p 8080-8100 192.0.2.100
```
#### 2. **Check Device Status**
@@ -237,10 +237,10 @@ nmap -p 8080-8100 192.168.1.100
#### 3. **Router/Network Issues**
```bash
# Check routing
traceroute 192.168.1.100
traceroute 192.0.2.100
# Test basic connectivity
ping -c 4 192.168.1.100
ping -c 4 192.0.2.100
```
### ❌ "Timeout" / "Context deadline exceeded"
@@ -255,7 +255,7 @@ Failed to get device info: context deadline exceeded
#### 1. **Increase Client Timeout**
```go
config := client.ClientConfig{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
Timeout: 30 * time.Second, // Increase from default 10s
}
@@ -264,7 +264,7 @@ config := client.ClientConfig{
#### 2. **Check Network Latency**
```bash
# Test response time
ping -c 10 192.168.1.100
ping -c 10 192.0.2.100
# Should be < 100ms typically
```
@@ -285,7 +285,7 @@ Failed to connect: dial tcp: lookup soundtouch.local: no such host
1. **Use IP instead of hostname:**
```go
client := client.NewClientFromHost("192.168.1.100") // Not "soundtouch.local"
client := client.NewClientFromHost("192.0.2.100") // Not "soundtouch.local"
```
2. **Fix DNS/mDNS:**
@@ -630,7 +630,7 @@ fmt.Printf("Current source: %s, status: %s\n",
**Symptoms:**
```go
Failed to connect WebSocket: dial ws://192.168.1.100:8080/: connection refused
Failed to connect WebSocket: dial ws://192.0.2.100:8080/: connection refused
```
**Solutions:**
@@ -638,7 +638,7 @@ Failed to connect WebSocket: dial ws://192.168.1.100:8080/: connection refused
#### 1. **Verify WebSocket Port (8080)**
```bash
# WebSocket uses port 8080, not 8090
nc -zv 192.168.1.100 8080
nc -zv 192.0.2.100 8080
```
#### 2. **Check Protocol Specification**
@@ -647,7 +647,7 @@ nc -zv 192.168.1.100 8080
wsClient := client.NewWebSocketClient(nil)
// Manual connection (if needed)
url := "ws://192.168.1.100:8080/"
url := "ws://192.0.2.100:8080/"
headers := http.Header{}
headers.Set("Sec-WebSocket-Protocol", "gabbo")
```
@@ -677,7 +677,7 @@ wsClient := client.NewWebSocketClient(config)
2. **Check network stability:**
```bash
# Test for packet loss
ping -c 100 192.168.1.100 | grep loss
ping -c 100 192.0.2.100 | grep loss
```
3. **Power management issues:**
@@ -809,7 +809,7 @@ transport := &http.Transport{
}
config := client.ClientConfig{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
Timeout: 10 * time.Second,
}
@@ -831,14 +831,14 @@ config.Logger = &client.DefaultLogger{} // Or custom logger
```bash
# Capture SoundTouch traffic
sudo tcpdump -i any host 192.168.1.100 and port 8090
sudo tcpdump -i any host 192.0.2.100 and port 8090
# Monitor WebSocket traffic
sudo tcpdump -i any host 192.168.1.100 and port 8080
sudo tcpdump -i any host 192.0.2.100 and port 8080
# HTTP debugging with curl
curl -v http://192.168.1.100:8090/info
curl -v http://192.168.1.100:8090/volume
curl -v http://192.0.2.100:8090/info
curl -v http://192.0.2.100:8090/volume
```
---
@@ -1059,7 +1059,7 @@ SSH ping from device failed and service-side DNS lookup also failed
```
or:
```
resolved "soundtouch.local" to 192.168.1.100 from service, not from device —
resolved "soundtouch.local" to 192.0.2.100 from service, not from device —
result may be wrong if NAT or split-DNS is in use
```
@@ -1078,7 +1078,7 @@ ssh root@<speaker-ip>
# Try to resolve the service hostname
ping -c 1 soundtouch.local
# or use the IP directly to verify connectivity
ping -c 1 192.168.1.100
ping -c 1 192.0.2.100
# Check the speaker's current DNS config
cat /etc/resolv.conf
@@ -1096,8 +1096,8 @@ The most reliable fix. If the hostname cannot be resolved from the device, use a
```bash
# In your .env
SERVER_URL=http://192.168.1.100:8000
HTTPS_SERVER_URL=https://192.168.1.100:8443
SERVER_URL=http://192.0.2.100:8000
HTTPS_SERVER_URL=https://192.0.2.100:8443
```
HTTPS works correctly with IP addresses — the service certificate includes the IP as a Subject Alternative Name (SAN).
+10 -10
View File
@@ -74,10 +74,10 @@ func (c *Client) StoreCurrentAsPreset(id int) error {
```bash
# Store currently playing content as preset
soundtouch-cli --host 192.168.1.100 preset store-current --slot 3
soundtouch-cli --host 192.0.2.100 preset store-current --slot 3
# Store specific content as preset
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 1 \
--source SPOTIFY \
--location "spotify:playlist:37i9dQZF1DX0XUsuxWHRQd" \
@@ -85,31 +85,31 @@ soundtouch-cli --host 192.168.1.100 preset store \
--name "My Worship Mix"
# Store radio station as preset
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 2 \
--source TUNEIN \
--location "/v1/playback/station/s33828" \
--name "K-LOVE Radio"
# Store radio station using TuneIn URL (Name and Artwork are automatically fetched)
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 6 \
--location "https://tunein.com/radio/WDR-2-Rheinland-1004-s213886/"
# Store Spotify album using URL (Name and Artwork are automatically fetched)
soundtouch-cli --host 192.168.1.100 preset store \
soundtouch-cli --host 192.0.2.100 preset store \
--slot 1 \
--location "https://open.spotify.com/album/6rT8yer84xoh0t17poLsmn?si=XqxdZazpTLC1ceoC8EeCuA" \
--source-account "yourusername"
# Remove preset
soundtouch-cli --host 192.168.1.100 preset remove --slot 3
soundtouch-cli --host 192.0.2.100 preset remove --slot 3
# Show current content details (including location URI for all sources)
soundtouch-cli --host 192.168.1.100 play now
soundtouch-cli --host 192.0.2.100 play now
# Show detailed content information
soundtouch-cli --host 192.168.1.100 play now --verbose
soundtouch-cli --host 192.0.2.100 play now --verbose
```
## Spotify Integration Examples
@@ -297,7 +297,7 @@ The CLI now automatically shows location details for **all sources** when using
### Automatic Location Display
```bash
# Location automatically shown for any source with location data
go run ./cmd/soundtouch-cli --host 192.168.1.100 play now
go run ./cmd/soundtouch-cli --host 192.0.2.100 play now
```
**Example outputs:**
@@ -335,7 +335,7 @@ Content Details:
### Verbose Mode for Complete Details
```bash
go run ./cmd/soundtouch-cli --host 192.168.1.100 play now --verbose
go run ./cmd/soundtouch-cli --host 192.0.2.100 play now --verbose
```
Shows additional information:
+1 -1
View File
@@ -87,7 +87,7 @@ func getDevicesWithFallback() []*client.Client {
log.Printf("Discovery failed: %v, trying known IPs...", err)
// Fallback to known IP addresses
knownIPs := []string{"192.168.1.100", "192.168.1.101", "192.168.1.102"}
knownIPs := []string{"192.0.2.100", "192.0.2.101", "192.0.2.102"}
var clients []*client.Client
for _, ip := range knownIPs {
+1 -1
View File
@@ -403,7 +403,7 @@ Retrieves network information.
```xml
<networkInfo wifiProfileCount="1">
<interfaces>
<interface type="WIFI_INTERFACE" name="wlan0" macAddress="..." ipAddress="192.168.1.131" ssid="network_name" frequencyKHz="2452000" state="NETWORK_WIFI_CONNECTED" signal="MARGINAL_SIGNAL" mode="STATION" />
<interface type="WIFI_INTERFACE" name="wlan0" macAddress="..." ipAddress="192.0.2.131" ssid="network_name" frequencyKHz="2452000" state="NETWORK_WIFI_CONNECTED" signal="MARGINAL_SIGNAL" mode="STATION" />
<interface type="WIFI_INTERFACE" name="wlan1" macAddress="..." state="NETWORK_WIFI_DISCONNECTED" />
</interfaces>
</networkInfo>
+12 -12
View File
@@ -58,7 +58,7 @@ import "github.com/gesellix/bose-soundtouch/pkg/client"
// Create client
config := client.ClientConfig{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
}
c := client.NewClient(config)
@@ -138,35 +138,35 @@ fmt.Printf("Default: %d\n", models.BassLevelDefault) // 0
```bash
# Get current bass level
soundtouch-cli -host 192.168.1.100 -bass
soundtouch-cli -host 192.0.2.100 -bass
# Set specific bass level
soundtouch-cli -host 192.168.1.100 -set-bass 3
soundtouch-cli -host 192.168.1.100 -set-bass -5
soundtouch-cli -host 192.0.2.100 -set-bass 3
soundtouch-cli -host 192.0.2.100 -set-bass -5
# Increment/decrement bass
soundtouch-cli -host 192.168.1.100 -inc-bass 1
soundtouch-cli -host 192.168.1.100 -dec-bass 2
soundtouch-cli -host 192.0.2.100 -inc-bass 1
soundtouch-cli -host 192.0.2.100 -dec-bass 2
```
### Real Examples
```bash
# Check current bass settings
soundtouch-cli -host 192.168.1.100 -bass
soundtouch-cli -host 192.0.2.100 -bass
# Output: Bass Level: 0 (Neutral)
# Category: Flat
# Set bass boost
soundtouch-cli -host 192.168.1.100 -set-bass 6
soundtouch-cli -host 192.0.2.100 -set-bass 6
# Output: ✓ Bass set to 6 (High)
# Reset to neutral
soundtouch-cli -host 192.168.1.100 -set-bass 0
soundtouch-cli -host 192.0.2.100 -set-bass 0
# Output: ✓ Bass set to 0 (Neutral)
# Gradual bass adjustment
soundtouch-cli -host 192.168.1.100 -inc-bass 2
soundtouch-cli -host 192.0.2.100 -inc-bass 2
# Output: ✓ Bass increased to 2 (Slightly High)
```
@@ -316,7 +316,7 @@ err := client.SetBass(15)
#### 2. Device Connection Errors
```bash
soundtouch-cli -host 192.168.1.100 -bass
soundtouch-cli -host 192.0.2.100 -bass
# Error: failed to get bass: API request failed with status 404
```
@@ -370,7 +370,7 @@ go test ./pkg/client -v -run ".*Bass.*"
Test with real hardware:
```bash
SOUNDTOUCH_TEST_HOST=192.168.1.100 go test ./pkg/client -v -run ".*Bass.*Integration.*"
SOUNDTOUCH_TEST_HOST=192.0.2.100 go test ./pkg/client -v -run ".*Bass.*Integration.*"
```
### Manual Testing
+2 -2
View File
@@ -17,7 +17,7 @@ The SoundTouch library supports multiple discovery methods to find devices on yo
You can manually configure known devices in your `.env` file:
```bash
PREFERRED_DEVICES=Living Room:192.168.1.100:8090,Kitchen:192.168.1.101:8090
PREFERRED_DEVICES=Living Room:192.0.2.100:8090,Kitchen:192.0.2.101:8090
```
This method is:
@@ -90,7 +90,7 @@ CACHE_ENABLED=true
CACHE_TTL=60s
# Known devices (fastest method)
PREFERRED_DEVICES=Living Room:192.168.1.100:8090,Kitchen:192.168.1.101:8090,Bedroom:192.168.1.102
PREFERRED_DEVICES=Living Room:192.0.2.100:8090,Kitchen:192.0.2.101:8090,Bedroom:192.0.2.102
```
## Usage Examples
+10 -10
View File
@@ -16,16 +16,16 @@ The SoundTouch API client now includes intelligent feature mapping that:
### Basic Feature Overview
```bash
# Get device feature overview (default view)
soundtouch-cli --host 192.168.1.100 supported-urls
soundtouch-cli --host 192.0.2.100 supported-urls
# Show detailed feature mapping with CLI commands
soundtouch-cli --host 192.168.1.100 supported-urls --features
soundtouch-cli --host 192.0.2.100 supported-urls --features
# Show complete endpoint list
soundtouch-cli --host 192.168.1.100 supported-urls --verbose
soundtouch-cli --host 192.0.2.100 supported-urls --verbose
# Get comprehensive device analysis with recommendations
soundtouch-cli --host 192.168.1.100 analyze
soundtouch-cli --host 192.0.2.100 analyze
```
## Understanding Feature Categories
@@ -80,7 +80,7 @@ Device system settings:
### Premium Device Example
```bash
$ soundtouch-cli --host 192.168.1.100 analyze
$ soundtouch-cli --host 192.0.2.100 analyze
🔍 Device Capability Analysis:
Device ID: 08DF1F0BA325
@@ -99,7 +99,7 @@ $ soundtouch-cli --host 192.168.1.100 analyze
💡 Recommendations:
🏠 This device supports multiroom - you can create speaker groups
Try: soundtouch-cli zone create --master 192.168.1.100 --members <other-devices>
Try: soundtouch-cli zone create --master 192.0.2.100 --members <other-devices>
⭐ Save your favorite content as presets for quick access
Try: soundtouch-cli preset store-current --slot 1
📻 Browse and discover new content from streaming services
@@ -120,7 +120,7 @@ $ soundtouch-cli --host 192.168.1.100 analyze
### Basic Device Example
```bash
$ soundtouch-cli --host 192.168.1.101 analyze
$ soundtouch-cli --host 192.0.2.101 analyze
🔍 Device Capability Analysis:
Device ID: 4C569D123456
@@ -341,9 +341,9 @@ soundtouch-cli preset remove --slot 1 # Remove preset 1
```bash
# Zone Management
soundtouch-cli zone list # List current zones
soundtouch-cli zone create --master 192.168.1.100 --members 192.168.1.101,192.168.1.102
soundtouch-cli zone add --member 192.168.1.103 # Add member to zone
soundtouch-cli zone remove --member 192.168.1.103 # Remove from zone
soundtouch-cli zone create --master 192.0.2.100 --members 192.0.2.101,192.0.2.102
soundtouch-cli zone add --member 192.0.2.103 # Add member to zone
soundtouch-cli zone remove --member 192.0.2.103 # Remove from zone
```
## Feature Detection Patterns
+17 -17
View File
@@ -133,39 +133,39 @@ allKeys := models.GetAllValidKeys()
```bash
# Media controls
soundtouch-cli -host 192.168.1.100 -play
soundtouch-cli -host 192.168.1.100 -pause
soundtouch-cli -host 192.168.1.100 -stop
soundtouch-cli -host 192.168.1.100 -next
soundtouch-cli -host 192.168.1.100 -prev
soundtouch-cli -host 192.0.2.100 -play
soundtouch-cli -host 192.0.2.100 -pause
soundtouch-cli -host 192.0.2.100 -stop
soundtouch-cli -host 192.0.2.100 -next
soundtouch-cli -host 192.0.2.100 -prev
# Volume controls
soundtouch-cli -host 192.168.1.100 -volume-up
soundtouch-cli -host 192.168.1.100 -volume-down
soundtouch-cli -host 192.0.2.100 -volume-up
soundtouch-cli -host 192.0.2.100 -volume-down
# Preset selection
soundtouch-cli -host 192.168.1.100 -preset 1
soundtouch-cli -host 192.168.1.100 -preset 6
soundtouch-cli -host 192.0.2.100 -preset 1
soundtouch-cli -host 192.0.2.100 -preset 6
```
### Generic Key Command
```bash
# Send any valid key using the -key flag
soundtouch-cli -host 192.168.1.100 -key PLAY
soundtouch-cli -host 192.168.1.100 -key STOP
soundtouch-cli -host 192.168.1.100 -key PRESET_3
soundtouch-cli -host 192.0.2.100 -key PLAY
soundtouch-cli -host 192.0.2.100 -key STOP
soundtouch-cli -host 192.0.2.100 -key PRESET_3
```
### Error Handling
```bash
# Invalid key validation
$ soundtouch-cli -host 192.168.1.100 -key INVALID
$ soundtouch-cli -host 192.0.2.100 -key INVALID
Failed to send key command: invalid key value: INVALID
# Multiple commands rejected
$ soundtouch-cli -host 192.168.1.100 -play -pause
$ soundtouch-cli -host 192.0.2.100 -play -pause
Failed to send key command: only one key command can be sent at a time
# Missing host
@@ -193,8 +193,8 @@ go test ./pkg/models/...
### Integration Testing
Tested with real SoundTouch devices:
- **SoundTouch 10** (192.168.1.10:8090) ✅
- **SoundTouch 20** (192.168.1.11:8090) ✅
- **SoundTouch 10** (192.0.2.10:8090) ✅
- **SoundTouch 20** (192.0.2.11:8090) ✅
All key commands successfully sent and executed on both devices.
@@ -213,7 +213,7 @@ import (
func main() {
// Create client
soundtouchClient := client.NewClientFromHost("192.168.1.100")
soundtouchClient := client.NewClientFromHost("192.0.2.100")
// Play music
if err := soundtouchClient.Play(); err != nil {
+4 -4
View File
@@ -29,7 +29,7 @@ Bose SoundTouch devices support up to 6 presets that can store favorite music so
```bash
# Get all configured presets
soundtouch-cli -host 192.168.1.10 -presets
soundtouch-cli -host 192.0.2.10 -presets
```
**Example Output:**
@@ -66,7 +66,7 @@ import (
func main() {
// Create client
soundtouchClient := client.NewClientFromHost("192.168.1.10")
soundtouchClient := client.NewClientFromHost("192.0.2.10")
// Get all presets
presets, err := soundtouchClient.GetPresets()
@@ -204,8 +204,8 @@ While you cannot create presets via API, you can select existing presets:
### Via Key Commands
```bash
# Select preset 1-6 using key commands
soundtouch-cli -host 192.168.1.10 -preset 1
soundtouch-cli -host 192.168.1.10 -key PRESET_3
soundtouch-cli -host 192.0.2.10 -preset 1
soundtouch-cli -host 192.0.2.10 -key PRESET_3
```
### Via Go Library
+11 -11
View File
@@ -49,7 +49,7 @@ import "github.com/gesellix/bose-soundtouch/pkg/client"
// Create client
config := client.ClientConfig{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
}
c := client.NewClient(config)
@@ -131,28 +131,28 @@ if err != nil {
```bash
# Select source using generic method
soundtouch-cli -host 192.168.1.100 -select-source SPOTIFY -source-account "your_account"
soundtouch-cli -host 192.0.2.100 -select-source SPOTIFY -source-account "your_account"
# Select source with convenience flags
soundtouch-cli -host 192.168.1.100 -spotify -source-account "your_account"
soundtouch-cli -host 192.168.1.100 -bluetooth
soundtouch-cli -host 192.168.1.100 -aux
soundtouch-cli -host 192.0.2.100 -spotify -source-account "your_account"
soundtouch-cli -host 192.0.2.100 -bluetooth
soundtouch-cli -host 192.0.2.100 -aux
```
### Real Examples
```bash
# Check available sources first
soundtouch-cli -host 192.168.1.100 -sources
soundtouch-cli -host 192.0.2.100 -sources
# Select Spotify with account
soundtouch-cli -host 192.168.1.100 -spotify -source-account "your_account"
soundtouch-cli -host 192.0.2.100 -spotify -source-account "your_account"
# Select TuneIn
soundtouch-cli -host 192.168.1.100 -select-source TUNEIN
soundtouch-cli -host 192.0.2.100 -select-source TUNEIN
# Select AUX input
soundtouch-cli -host 192.168.1.100 -aux
soundtouch-cli -host 192.0.2.100 -aux
```
### CLI Flags
@@ -180,7 +180,7 @@ soundtouch-cli -host 192.168.1.100 -aux
Use the sources endpoint to discover available accounts:
```bash
soundtouch-cli -host 192.168.1.100 -sources
soundtouch-cli -host 192.0.2.100 -sources
```
This shows account names for each source:
@@ -299,7 +299,7 @@ go test ./pkg/client -v -run ".*SelectSource.*"
Test with real hardware:
```bash
SOUNDTOUCH_TEST_HOST=192.168.1.100 go test ./pkg/client -v -run ".*Integration.*"
SOUNDTOUCH_TEST_HOST=192.0.2.100 go test ./pkg/client -v -run ".*Integration.*"
```
### Manual Testing
+10 -10
View File
@@ -62,7 +62,7 @@ import (
func main() {
config := &client.Config{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
}
@@ -87,7 +87,7 @@ func main() {
```go
func main() {
config := &client.Config{
Host: "192.168.1.100",
Host: "192.0.2.100",
Port: 8090,
}
@@ -150,7 +150,7 @@ func main() {
```bash
# Basic TTS (English)
soundtouch-cli speaker tts --text "Hello World" --app-key YOUR_KEY --host 192.168.1.100
soundtouch-cli speaker tts --text "Hello World" --app-key YOUR_KEY --host 192.0.2.100
# TTS with volume and language
soundtouch-cli speaker tts \
@@ -158,7 +158,7 @@ soundtouch-cli speaker tts \
--app-key YOUR_KEY \
--volume 70 \
--language FR \
--host 192.168.1.100
--host 192.0.2.100
```
### URL Content Playback
@@ -168,7 +168,7 @@ soundtouch-cli speaker tts \
soundtouch-cli speaker url \
--url "https://example.com/audio.mp3" \
--app-key YOUR_KEY \
--host 192.168.1.100
--host 192.0.2.100
# URL playback with custom metadata
soundtouch-cli speaker url \
@@ -178,13 +178,13 @@ soundtouch-cli speaker url \
--message "Beautiful Song" \
--reason "Artist Name" \
--volume 60 \
--host 192.168.1.100
--host 192.0.2.100
```
### Notification Beep
```bash
soundtouch-cli speaker beep --host 192.168.1.100
soundtouch-cli speaker beep --host 192.0.2.100
```
### Help
@@ -294,13 +294,13 @@ client.PlayURL(
```bash
# Test connectivity
soundtouch-cli speaker beep --host 192.168.1.100
soundtouch-cli speaker beep --host 192.0.2.100
# Test TTS functionality
soundtouch-cli speaker tts --text "Testing TTS functionality" --app-key test-key --host 192.168.1.100
soundtouch-cli speaker tts --text "Testing TTS functionality" --app-key test-key --host 192.0.2.100
# Test URL playback
soundtouch-cli speaker url --url "https://www.soundjay.com/misc/sounds/bell-ringing-05.wav" --app-key test-key --host 192.168.1.100
soundtouch-cli speaker url --url "https://www.soundjay.com/misc/sounds/bell-ringing-05.wav" --app-key test-key --host 192.0.2.100
```
## Troubleshooting
+20 -20
View File
@@ -34,7 +34,7 @@ fmt.Printf("Timezone: %s\n", clockTime.GetZone())
**CLI Usage:**
```bash
soundtouch-cli -host 192.168.1.100 -clock-time
soundtouch-cli -host 192.0.2.100 -clock-time
```
### POST /clockTime
@@ -64,10 +64,10 @@ err := client.SetClockTime(request)
**CLI Usage:**
```bash
# Set to current system time
soundtouch-cli -host 192.168.1.100 -set-clock-time now
soundtouch-cli -host 192.0.2.100 -set-clock-time now
# Set to specific Unix timestamp
soundtouch-cli -host 192.168.1.100 -set-clock-time 1609459200
soundtouch-cli -host 192.0.2.100 -set-clock-time 1609459200
```
### GET /clockDisplay
@@ -94,7 +94,7 @@ fmt.Printf("Auto-Dim: %v\n", clockDisplay.IsAutoDimEnabled())
**CLI Usage:**
```bash
soundtouch-cli -host 192.168.1.100 -clock-display
soundtouch-cli -host 192.0.2.100 -clock-display
```
### POST /clockDisplay
@@ -132,14 +132,14 @@ err := client.SetClockDisplay(request)
**CLI Usage:**
```bash
# Enable/disable clock display
soundtouch-cli -host 192.168.1.100 -enable-clock
soundtouch-cli -host 192.168.1.100 -disable-clock
soundtouch-cli -host 192.0.2.100 -enable-clock
soundtouch-cli -host 192.0.2.100 -disable-clock
# Set clock format (12, 24, auto)
soundtouch-cli -host 192.168.1.100 -clock-format 24
soundtouch-cli -host 192.0.2.100 -clock-format 24
# Set brightness (0-100)
soundtouch-cli -host 192.168.1.10 -clock-brightness 75
soundtouch-cli -host 192.0.2.10 -clock-brightness 75
```
**Clock Formats:**
@@ -166,7 +166,7 @@ Retrieves comprehensive network information including interfaces, connectivity s
```xml
<networkInfo wifiProfileCount="2">
<interfaces>
<interface type="WIFI_INTERFACE" name="wlan0" macAddress="AA:BB:CC:DD:EE:FF" ipAddress="192.168.1.10" ssid="MyHomeNetwork" frequencyKHz="5500000" state="NETWORK_WIFI_CONNECTED" signal="EXCELLENT_SIGNAL" mode="STATION"/>
<interface type="WIFI_INTERFACE" name="wlan0" macAddress="AA:BB:CC:DD:EE:FF" ipAddress="192.0.2.10" ssid="MyHomeNetwork" frequencyKHz="5500000" state="NETWORK_WIFI_CONNECTED" signal="EXCELLENT_SIGNAL" mode="STATION"/>
<interface type="WIFI_INTERFACE" name="wlan1" macAddress="AA:BB:CC:DD:EE:01" state="NETWORK_WIFI_DISCONNECTED"/>
</interfaces>
</networkInfo>
@@ -176,7 +176,7 @@ Retrieves comprehensive network information including interfaces, connectivity s
```xml
<networkInfo wifiProfileCount="3">
<interfaces>
<interface type="ETHERNET_INTERFACE" name="eth0" macAddress="AA:BB:CC:DD:EE:FF" ipAddress="192.168.1.10" state="NETWORK_ETHERNET_CONNECTED"/>
<interface type="ETHERNET_INTERFACE" name="eth0" macAddress="AA:BB:CC:DD:EE:FF" ipAddress="192.0.2.10" state="NETWORK_ETHERNET_CONNECTED"/>
</interfaces>
</networkInfo>
```
@@ -224,7 +224,7 @@ if stats := networkInfo.GetStatistics(); stats != nil {
**CLI Usage:**
```bash
soundtouch-cli -host 192.168.1.100 -network-info
soundtouch-cli -host 192.0.2.100 -network-info
```
**CLI Output Example (WiFi Device):**
@@ -237,7 +237,7 @@ Network Information:
Interface 1:
• Type: WIFI_INTERFACE (wlan0)
• MAC Address: AA:BB:CC:DD:EE:FF
• IP Address: 192.168.1.10
• IP Address: 192.0.2.10
• State: WiFi Connected ✓
• SSID: MyHomeNetwork
• Signal: Excellent (90%)
@@ -254,7 +254,7 @@ Interface 2:
Active WiFi Connection:
• Network: MyHomeNetwork (Excellent, 5GHz)
• Interface: wlan0
• IP Address: 192.168.1.10
• IP Address: 192.0.2.10
Connectivity Summary:
✓ WiFi Available (Connected)
@@ -514,17 +514,17 @@ All system endpoints are fully integrated into the CLI tool with comprehensive h
soundtouch-cli -help
# Device time management
soundtouch-cli -host 192.168.1.100 -clock-time
soundtouch-cli -host 192.168.1.100 -set-clock-time now
soundtouch-cli -host 192.0.2.100 -clock-time
soundtouch-cli -host 192.0.2.100 -set-clock-time now
# Clock display configuration
soundtouch-cli -host 192.168.1.100 -clock-display
soundtouch-cli -host 192.168.1.100 -enable-clock
soundtouch-cli -host 192.168.1.100 -clock-format 24
soundtouch-cli -host 192.168.1.100 -clock-brightness 75
soundtouch-cli -host 192.0.2.100 -clock-display
soundtouch-cli -host 192.0.2.100 -enable-clock
soundtouch-cli -host 192.0.2.100 -clock-format 24
soundtouch-cli -host 192.0.2.100 -clock-brightness 75
# Network diagnostics
soundtouch-cli -host 192.168.1.100 -network-info
soundtouch-cli -host 192.0.2.100 -network-info
```
## Testing
+10 -10
View File
@@ -146,7 +146,7 @@ name := models.GetVolumeLevelName(25) // Returns "Quiet"
```bash
# Get current volume information
soundtouch-cli -host 192.168.1.100:8090 -volume
soundtouch-cli -host 192.0.2.100:8090 -volume
```
**Output:**
@@ -162,8 +162,8 @@ Current Volume:
```bash
# Set volume to specific level (0-100)
soundtouch-cli -host 192.168.1.100:8090 -set-volume 25
soundtouch-cli -host 192.168.1.100:8090 -set-volume 0 # Mute
soundtouch-cli -host 192.0.2.100:8090 -set-volume 25
soundtouch-cli -host 192.0.2.100:8090 -set-volume 0 # Mute
```
**Safety Features:**
@@ -174,12 +174,12 @@ soundtouch-cli -host 192.168.1.100:8090 -set-volume 0 # Mute
```bash
# Increase volume by amount (1-10, default: 2)
soundtouch-cli -host 192.168.1.100:8090 -inc-volume 3
soundtouch-cli -host 192.168.1.100:8090 -inc-volume # Uses default: 2
soundtouch-cli -host 192.0.2.100:8090 -inc-volume 3
soundtouch-cli -host 192.0.2.100:8090 -inc-volume # Uses default: 2
# Decrease volume by amount (1-20, default: 2)
soundtouch-cli -host 192.168.1.100:8090 -dec-volume 5
soundtouch-cli -host 192.168.1.100:8090 -dec-volume # Uses default: 2
soundtouch-cli -host 192.0.2.100:8090 -dec-volume 5
soundtouch-cli -host 192.0.2.100:8090 -dec-volume # Uses default: 2
```
### CLI Safety Features
@@ -211,8 +211,8 @@ go test ./pkg/models/volume*
### Integration Testing
Tested with real SoundTouch devices:
- **SoundTouch 10** (192.168.1.10:8090) ✅
- **SoundTouch 20** (192.168.1.11:8090) ✅
- **SoundTouch 10** (192.0.2.10:8090) ✅
- **SoundTouch 20** (192.0.2.11:8090) ✅
All volume operations successfully tested on both devices.
@@ -232,7 +232,7 @@ import (
func main() {
// Create client
soundtouchClient := client.NewClientFromHost("192.168.1.100")
soundtouchClient := client.NewClientFromHost("192.0.2.100")
// Get current volume
volume, err := soundtouchClient.GetVolume()
+11 -11
View File
@@ -33,7 +33,7 @@ import (
func main() {
// Create SoundTouch client
soundTouchClient := client.NewClientFromHost("192.168.1.10")
soundTouchClient := client.NewClientFromHost("192.0.2.10")
// Create WebSocket client with default configuration
wsClient := soundTouchClient.NewWebSocketClient(nil)
@@ -70,16 +70,16 @@ The recommended way to monitor WebSocket events is through the built-in CLI comm
```bash
# Monitor all events from a specific device
soundtouch-cli --host 192.168.1.10 events subscribe
soundtouch-cli --host 192.0.2.10 events subscribe
# Monitor only volume and now playing events
soundtouch-cli --host 192.168.1.10 events subscribe --filter volume,nowPlaying
soundtouch-cli --host 192.0.2.10 events subscribe --filter volume,nowPlaying
# Monitor for 5 minutes with verbose output
soundtouch-cli --host 192.168.1.10 events subscribe --duration 5m --verbose
soundtouch-cli --host 192.0.2.10 events subscribe --duration 5m --verbose
# Monitor zone events without automatic reconnection
soundtouch-cli --host 192.168.1.10 events subscribe --filter zone --no-reconnect
soundtouch-cli --host 192.0.2.10 events subscribe --filter zone --no-reconnect
```
### Using the CLI Demo (Alternative)
@@ -91,13 +91,13 @@ For development or testing purposes, you can also use the standalone demo:
go run ./cmd/websocket-demo -discover
# Connect to specific device
go run ./cmd/websocket-demo -host 192.168.1.10
go run ./cmd/websocket-demo -host 192.0.2.10
# Monitor only volume changes for 5 minutes
go run ./cmd/websocket-demo -host 192.168.1.10 -filter volume -duration 5m
go run ./cmd/websocket-demo -host 192.0.2.10 -filter volume -duration 5m
# Monitor multiple event types with verbose logging
go run ./cmd/websocket-demo -host 192.168.1.10 -filter nowPlaying,volume -verbose
go run ./cmd/websocket-demo -host 192.0.2.10 -filter nowPlaying,volume -verbose
```
## Configuration
@@ -427,7 +427,7 @@ The WebSocket connects to:
- **Port**: `8080` (different from HTTP API port 8090)
- **Path**: `/`
Example: `ws://192.168.1.10:8080/`
Example: `ws://192.0.2.10:8080/`
### Message Format
@@ -493,10 +493,10 @@ Use the CLI demo to test WebSocket functionality:
```bash
# Test with verbose output
go run ./cmd/websocket-demo -host 192.168.1.10 -verbose
go run ./cmd/websocket-demo -host 192.0.2.10 -verbose
# Test reconnection by temporarily disconnecting device
go run ./cmd/websocket-demo -host 192.168.1.10 -verbose -duration 5m
go run ./cmd/websocket-demo -host 192.0.2.10 -verbose -duration 5m
```
## Performance Considerations
+23 -23
View File
@@ -31,7 +31,7 @@ import (
func main() {
// Connect to SoundTouch device
soundTouchClient := client.NewClientFromHost("192.168.1.10")
soundTouchClient := client.NewClientFromHost("192.0.2.10")
// Get current zone information
zone, err := soundTouchClient.GetZone()
@@ -54,25 +54,25 @@ func main() {
```bash
# Get zone information
go run ./cmd/soundtouch-cli -host 192.168.1.10 -zone
go run ./cmd/soundtouch-cli -host 192.0.2.10 -zone
# Check zone status for this device
go run ./cmd/soundtouch-cli -host 192.168.1.10 -zone-status
go run ./cmd/soundtouch-cli -host 192.0.2.10 -zone-status
# List all zone members
go run ./cmd/soundtouch-cli -host 192.168.1.10 -zone-members
go run ./cmd/soundtouch-cli -host 192.0.2.10 -zone-members
# Create a new zone
go run ./cmd/soundtouch-cli -host 192.168.1.10 -create-zone MASTER123,MEMBER456,MEMBER789
go run ./cmd/soundtouch-cli -host 192.0.2.10 -create-zone MASTER123,MEMBER456,MEMBER789
# Add device to existing zone
go run ./cmd/soundtouch-cli -host 192.168.1.10 -add-to-zone DEVICE456@192.168.1.11
go run ./cmd/soundtouch-cli -host 192.0.2.10 -add-to-zone DEVICE456@192.0.2.11
# Remove device from zone
go run ./cmd/soundtouch-cli -host 192.168.1.10 -remove-from-zone DEVICE456
go run ./cmd/soundtouch-cli -host 192.0.2.10 -remove-from-zone DEVICE456
# Dissolve current zone
go run ./cmd/soundtouch-cli -host 192.168.1.10 -dissolve-zone
go run ./cmd/soundtouch-cli -host 192.0.2.10 -dissolve-zone
```
## Zone Concepts
@@ -112,8 +112,8 @@ for i, member := range zone.Members {
**Response Structure:**
```xml
<zone master="ABCD1234EFGH">
<member ipaddress="192.168.1.11">EFGH5678IJKL</member>
<member ipaddress="192.168.1.12">IJKL9012MNOP</member>
<member ipaddress="192.0.2.11">EFGH5678IJKL</member>
<member ipaddress="192.0.2.12">IJKL9012MNOP</member>
</zone>
```
@@ -162,8 +162,8 @@ if err != nil {
```go
masterID := "ABCD1234EFGH"
members := map[string]string{
"EFGH5678IJKL": "192.168.1.11",
"IJKL9012MNOP": "192.168.1.12",
"EFGH5678IJKL": "192.0.2.11",
"IJKL9012MNOP": "192.0.2.12",
}
err := client.CreateZoneWithIPs(masterID, members)
@@ -176,7 +176,7 @@ if err != nil {
```go
// Add device with IP address
err := client.AddToZone("DEVICE789", "192.168.1.13")
err := client.AddToZone("DEVICE789", "192.0.2.13")
if err != nil {
log.Fatal(err)
}
@@ -207,7 +207,7 @@ if err != nil {
```go
zoneRequest, err := models.NewZoneBuilder("MASTER123").
WithMember("DEVICE456", "192.168.1.11").
WithMember("DEVICE456", "192.0.2.11").
WithMemberByDeviceID("DEVICE789").
Build()
@@ -226,8 +226,8 @@ if err != nil {
```go
// Create zone request manually
zoneRequest := models.NewZoneRequest("MASTER123")
zoneRequest.AddMember("DEVICE456", "192.168.1.11")
zoneRequest.AddMember("DEVICE789", "192.168.1.12")
zoneRequest.AddMember("DEVICE456", "192.0.2.11")
zoneRequest.AddMember("DEVICE789", "192.0.2.12")
// Validate before sending
if err := zoneRequest.Validate(); err != nil {
@@ -262,9 +262,9 @@ if zone.IsMember("DEVICE456") {
}
// Find device by IP
member, found := zone.GetMemberByIP("192.168.1.11")
member, found := zone.GetMemberByIP("192.0.2.11")
if found {
fmt.Printf("Device at 192.168.1.11 is %s\n", member.DeviceID)
fmt.Printf("Device at 192.0.2.11 is %s\n", member.DeviceID)
}
// Get all device IDs
@@ -305,7 +305,7 @@ defer wsClient.Disconnect()
### Zone-Specific Errors
```go
err := client.AddToZone("INVALID_DEVICE", "192.168.1.99")
err := client.AddToZone("INVALID_DEVICE", "192.0.2.99")
if err != nil {
// Handle specific zone errors
if zoneErr, ok := err.(*models.ZoneError); ok {
@@ -411,11 +411,11 @@ func createRoomZones() {
kitchenMembers := []string{"KITCHEN_COUNTER"}
// Create living room zone
livingRoomClient := client.NewClientFromHost("192.168.1.10")
livingRoomClient := client.NewClientFromHost("192.0.2.10")
livingRoomClient.CreateZone(livingRoomMaster, livingRoomMembers)
// Create kitchen zone
kitchenClient := client.NewClientFromHost("192.168.1.20")
kitchenClient := client.NewClientFromHost("192.0.2.20")
kitchenClient.CreateZone(kitchenMaster, kitchenMembers)
}
```
@@ -434,7 +434,7 @@ func enablePartyMode() {
master := allDevices[0]
members := allDevices[1:]
masterClient := client.NewClientFromHost("192.168.1.10")
masterClient := client.NewClientFromHost("192.0.2.10")
err := masterClient.CreateZone(master, members)
if err != nil {
log.Printf("Failed to create party zone: %v", err)
@@ -444,7 +444,7 @@ func enablePartyMode() {
func disablePartyMode() {
// Dissolve all zones
for _, ip := range []string{"192.168.1.10", "192.168.1.11", "192.168.1.12"} {
for _, ip := range []string{"192.0.2.10", "192.0.2.11", "192.0.2.12"} {
client := client.NewClientFromHost(ip)
client.DissolveZone()
}
+1 -1
View File
@@ -472,7 +472,7 @@ Filter: if `margeAccountID` is set in state, only include speakers whose
Result payload per speaker:
```json
{"uID": "AA:BB:CC:DD:EE:FF", "ip": "192.168.1.10"}
{"uID": "AA:BB:CC:DD:EE:FF", "ip": "192.0.2.10"}
```
Push incremental results as they arrive (push one device at a time via the
+6 -6
View File
@@ -16,7 +16,7 @@ The SoundTouch device can store credentials for various music streaming services
1. Update the device IP address in `main.go`:
```go
config := &client.Config{
Host: "192.168.1.100", // Replace with your device IP
Host: "192.0.2.100", // Replace with your device IP
Port: 8090,
Timeout: 10 * time.Second,
}
@@ -102,15 +102,15 @@ After setting up accounts programmatically, you can also manage them via the CLI
```bash
# List configured accounts
soundtouch-cli --host 192.168.1.10 account list
soundtouch-cli --host 192.0.2.10 account list
# Add accounts via CLI
soundtouch-cli --host 192.168.1.10 account add-spotify --user user@spotify.com --password mypass
soundtouch-cli --host 192.168.1.10 account add-pandora --user pandora_user --password pandora_pass
soundtouch-cli --host 192.168.1.10 account add-nas --user "guid/0" --name "My NAS"
soundtouch-cli --host 192.0.2.10 account add-spotify --user user@spotify.com --password mypass
soundtouch-cli --host 192.0.2.10 account add-pandora --user pandora_user --password pandora_pass
soundtouch-cli --host 192.0.2.10 account add-nas --user "guid/0" --name "My NAS"
# Remove accounts
soundtouch-cli --host 192.168.1.10 account remove-spotify --user user@spotify.com
soundtouch-cli --host 192.0.2.10 account remove-spotify --user user@spotify.com
```
## Network Music Libraries
+6 -6
View File
@@ -46,14 +46,14 @@ This example demonstrates the advanced content selection features of the Bose So
go run main.go <device_ip>
# Example
go run main.go 192.168.1.100
go run main.go 192.0.2.100
```
## Example Output
```
🎵 SoundTouch Content Selection Example
📱 Device: 192.168.1.100:8090
📱 Device: 192.0.2.100:8090
📻 Step 1: Demonstrating LOCAL_INTERNET_RADIO with streamUrl format...
📡 Using streamUrl format with proxy server...
@@ -126,25 +126,25 @@ These API methods are also available via the CLI:
```bash
# Internet radio with streamUrl format
soundtouch-cli --host 192.168.1.100 source internet-radio \
soundtouch-cli --host 192.0.2.100 source internet-radio \
--location "http://contentapi.gmuth.de/station.php?name=MyStation&streamUrl=https://stream.example.com/radio" \
--name "My Station" \
--artwork "https://example.com/art.png"
# Local music content
soundtouch-cli --host 192.168.1.100 source local-music \
soundtouch-cli --host 192.0.2.100 source local-music \
--location "album:983" \
--account "3f205110-4a57-4e91-810a-123456789012" \
--name "Welcome to the New"
# Stored music content
soundtouch-cli --host 192.168.1.100 source stored-music \
soundtouch-cli --host 192.0.2.100 source stored-music \
--location "6_a2874b5d_4f83d999" \
--account "d09708a1-5953-44bc-a413-123456789012/0" \
--name "Christmas Album"
# Generic content selection (advanced)
soundtouch-cli --host 192.168.1.100 source content \
soundtouch-cli --host 192.0.2.100 source content \
--source LOCAL_INTERNET_RADIO \
--location "https://stream.example.com/radio" \
--name "My Stream" \
+5 -5
View File
@@ -18,19 +18,19 @@ The introspect endpoint provides detailed information about music services (like
```bash
# Basic usage - check Spotify status
go run main.go -host 192.168.1.100
go run main.go -host 192.0.2.100
# Check specific service with account
go run main.go -host 192.168.1.100 -source SPOTIFY -account "your_spotify_username"
go run main.go -host 192.0.2.100 -source SPOTIFY -account "your_spotify_username"
# Check Pandora service
go run main.go -host 192.168.1.100 -source PANDORA
go run main.go -host 192.0.2.100 -source PANDORA
# Check TuneIn radio
go run main.go -host 192.168.1.100 -source TUNEIN
go run main.go -host 192.0.2.100 -source TUNEIN
# Custom timeout
go run main.go -host 192.168.1.100 -timeout 5s
go run main.go -host 192.0.2.100 -timeout 5s
```
## Command Line Options
+22 -22
View File
@@ -15,13 +15,13 @@ The introspect functionality is available through three commands in the `source`
### 1. Basic Spotify Introspect
```bash
$ soundtouch-cli --host 192.168.1.100 source introspect --source SPOTIFY
$ soundtouch-cli --host 192.0.2.100 source introspect --source SPOTIFY
```
**Expected Output:**
```
⠎⠕⠥⠝⠙⠤⠞⠕⠥⠉⠓ SoundTouch CLI v1.0.0
🔗 Connecting to SoundTouch device at 192.168.1.100:8090
🔗 Connecting to SoundTouch device at 192.0.2.100:8090
Getting introspect data for SPOTIFY
@@ -58,13 +58,13 @@ Received Playback Request: ❌ No
### 2. Spotify Introspect with Account
```bash
$ soundtouch-cli --host 192.168.1.100 source introspect --source SPOTIFY --account my_spotify_user
$ soundtouch-cli --host 192.0.2.100 source introspect --source SPOTIFY --account my_spotify_user
```
**Expected Output:**
```
⠎⠕⠥⠝⠙⠤⠞⠕⠥⠉⠓ SoundTouch CLI v1.0.0
🔗 Connecting to SoundTouch device at 192.168.1.100:8090
🔗 Connecting to SoundTouch device at 192.0.2.100:8090
Getting introspect data for SPOTIFY
Source Account: my_spotify_user
@@ -102,13 +102,13 @@ Received Playback Request: ✅ Yes
### 3. Spotify Convenience Command
```bash
$ soundtouch-cli --host 192.168.1.100 source introspect-spotify
$ soundtouch-cli --host 192.0.2.100 source introspect-spotify
```
**Expected Output:**
```
⠎⠕⠥⠝⠙⠤⠞⠕⠥⠉⠓ SoundTouch CLI v1.0.0
🔗 Connecting to SoundTouch device at 192.168.1.100:8090
🔗 Connecting to SoundTouch device at 192.0.2.100:8090
Getting Spotify introspect data
@@ -148,13 +148,13 @@ Received Playback Request: ✅ Yes
### 4. Inactive Service Example
```bash
$ soundtouch-cli --host 192.168.1.100 source introspect-spotify
$ soundtouch-cli --host 192.0.2.100 source introspect-spotify
```
**Expected Output (when Spotify is not set up):**
```
⠎⠕⠥⠝⠙⠤⠞⠕⠥⠉⠓ SoundTouch CLI v1.0.0
🔗 Connecting to SoundTouch device at 192.168.1.100:8090
🔗 Connecting to SoundTouch device at 192.0.2.100:8090
Getting Spotify introspect data
@@ -186,13 +186,13 @@ Subscription Type:
### 5. All Services Introspect
```bash
$ soundtouch-cli --host 192.168.1.100 source introspect-all
$ soundtouch-cli --host 192.0.2.100 source introspect-all
```
**Expected Output:**
```
⠎⠕⠥⠝⠙⠤⠞⠕⠥⠉⠓ SoundTouch CLI v1.0.0
🔗 Connecting to SoundTouch device at 192.168.1.100:8090
🔗 Connecting to SoundTouch device at 192.0.2.100:8090
Getting introspect data for all services
@@ -234,7 +234,7 @@ Getting introspect data for all services
#### Missing Source Parameter
```bash
$ soundtouch-cli --host 192.168.1.100 source introspect
$ soundtouch-cli --host 192.0.2.100 source introspect
```
**Output:**
@@ -265,13 +265,13 @@ host is required. Use --host flag or set SOUNDTOUCH_HOST environment variable
#### Invalid Service
```bash
$ soundtouch-cli --host 192.168.1.100 source introspect --source INVALID_SERVICE
$ soundtouch-cli --host 192.0.2.100 source introspect --source INVALID_SERVICE
```
**Expected Output:**
```
⠎⠕⠥⠝⠙⠤⠞⠕⠥⠉⠓ SoundTouch CLI v1.0.0
🔗 Connecting to SoundTouch device at 192.168.1.100:8090
🔗 Connecting to SoundTouch device at 192.0.2.100:8090
⚠️ Service INVALID_SERVICE may not be available, but continuing with introspect request...
@@ -287,28 +287,28 @@ The introspect commands work well with other CLI commands:
### 1. Check Availability First
```bash
# Check what services are available
$ soundtouch-cli --host 192.168.1.100 source availability
$ soundtouch-cli --host 192.0.2.100 source availability
# Then introspect specific services
$ soundtouch-cli --host 192.168.1.100 source introspect --source SPOTIFY
$ soundtouch-cli --host 192.0.2.100 source introspect --source SPOTIFY
```
### 2. Activate Service After Introspect
```bash
# Check service status
$ soundtouch-cli --host 192.168.1.100 source introspect-spotify
$ soundtouch-cli --host 192.0.2.100 source introspect-spotify
# If inactive, activate it
$ soundtouch-cli --host 192.168.1.100 source select --source SPOTIFY
$ soundtouch-cli --host 192.0.2.100 source select --source SPOTIFY
```
### 3. Compare Sources and Introspect Data
```bash
# Compare configured sources vs available services
$ soundtouch-cli --host 192.168.1.100 source compare
$ soundtouch-cli --host 192.0.2.100 source compare
# Get detailed introspect data for specific services
$ soundtouch-cli --host 192.168.1.100 source introspect-all
$ soundtouch-cli --host 192.0.2.100 source introspect-all
```
## Environment Variables
@@ -321,7 +321,7 @@ The introspect commands respect the same environment variables as other CLI comm
**Example:**
```bash
export SOUNDTOUCH_HOST=192.168.1.100
export SOUNDTOUCH_HOST=192.0.2.100
soundtouch-cli source introspect-spotify
```
@@ -379,7 +379,7 @@ soundtouch-cli --host $DEVICE source introspect --source SPOTIFY --account speci
3. **Batch operations**: Use shell scripting to check multiple devices:
```bash
for device in 192.168.1.100 192.168.1.101; do
for device in 192.0.2.100 192.0.2.101; do
echo "=== Device $device ==="
soundtouch-cli --host $device source introspect-spotify
done
@@ -387,7 +387,7 @@ soundtouch-cli --host $DEVICE source introspect --source SPOTIFY --account speci
4. **Environment setup**: Set up your environment for easier usage:
```bash
export SOUNDTOUCH_HOST=192.168.1.100
export SOUNDTOUCH_HOST=192.0.2.100
alias st='soundtouch-cli'
st source introspect-spotify
```
+8 -8
View File
@@ -43,7 +43,7 @@ go run ./cmd/soundtouch-cli discover devices
cd examples/navigation-station-demo
# Run with your device IP
go run . 192.168.1.100
go run . 192.0.2.100
```
## What the Demo Does
@@ -61,7 +61,7 @@ go run . 192.168.1.100
```
🎵 SoundTouch Navigation & Station Management Demo
📱 Device: 192.168.1.100:8090
📱 Device: 192.0.2.100:8090
📻 Step 1: Browsing TuneIn stations...
📡 Getting TuneIn stations (first 10)...
@@ -173,23 +173,23 @@ This example shows programmatic usage. For command-line usage:
```bash
# Browse TuneIn stations
go run ./cmd/soundtouch-cli --host 192.168.1.100 browse tunein
go run ./cmd/soundtouch-cli --host 192.0.2.100 browse tunein
# Search for jazz stations
go run ./cmd/soundtouch-cli --host 192.168.1.100 station search-tunein --query "jazz"
go run ./cmd/soundtouch-cli --host 192.0.2.100 station search-tunein --query "jazz"
# Add a station from search results
go run ./cmd/soundtouch-cli --host 192.168.1.100 station add \
go run ./cmd/soundtouch-cli --host 192.0.2.100 station add \
--source TUNEIN \
--token "c121508" \
--name "Jazz FM"
# Browse Pandora stations (requires account)
go run ./cmd/soundtouch-cli --host 192.168.1.100 browse pandora \
go run ./cmd/soundtouch-cli --host 192.0.2.100 browse pandora \
--source-account "your_pandora_username"
# Search Spotify content (requires account)
go run ./cmd/soundtouch-cli --host 192.168.1.100 station search-spotify \
go run ./cmd/soundtouch-cli --host 192.0.2.100 station search-spotify \
--source-account "your_spotify_username" \
--query "workout playlist"
```
@@ -265,7 +265,7 @@ The demo handles common error cases:
### "Device not responding"
```bash
# Test basic connectivity first
go run ./cmd/soundtouch-cli --host 192.168.1.100 info
go run ./cmd/soundtouch-cli --host 192.0.2.100 info
```
### "Search returns no results"
+8 -8
View File
@@ -40,7 +40,7 @@ go run ./cmd/soundtouch-cli discover devices
cd examples/preset-management
# Run with your device IP
go run . 192.168.1.100
go run . 192.0.2.100
```
## What the Example Does
@@ -60,7 +60,7 @@ go run . 192.168.1.100
```
🎵 SoundTouch Preset Management Example
📱 Device: 192.168.1.100:8090
📱 Device: 192.0.2.100:8090
📋 Step 1: Getting current presets...
📻 Found 2 configured presets:
@@ -191,7 +191,7 @@ Location: "https://stream.example.com/radio"
```bash
# Show current content details (includes location)
go run ./cmd/soundtouch-cli --host 192.168.1.100 play now
go run ./cmd/soundtouch-cli --host 192.0.2.100 play now
```
### Method 2: From Spotify URLs
@@ -215,23 +215,23 @@ This example shows programmatic usage. For command-line usage:
```bash
# List presets
go run ./cmd/soundtouch-cli --host 192.168.1.100 preset list
go run ./cmd/soundtouch-cli --host 192.0.2.100 preset list
# Store current content
go run ./cmd/soundtouch-cli --host 192.168.1.100 preset store-current --slot 1
go run ./cmd/soundtouch-cli --host 192.0.2.100 preset store-current --slot 1
# Store specific content
go run ./cmd/soundtouch-cli --host 192.168.1.100 preset store \
go run ./cmd/soundtouch-cli --host 192.0.2.100 preset store \
--slot 2 \
--source SPOTIFY \
--location "spotify:playlist:37i9dQZF1DXcBWIGoYBM5M" \
--name "My Playlist"
# Select preset
go run ./cmd/soundtouch-cli --host 192.168.1.100 preset select --slot 1
go run ./cmd/soundtouch-cli --host 192.0.2.100 preset select --slot 1
# Remove preset
go run ./cmd/soundtouch-cli --host 192.168.1.100 preset remove --slot 6
go run ./cmd/soundtouch-cli --host 192.0.2.100 preset remove --slot 6
```
## Troubleshooting
+18 -18
View File
@@ -17,22 +17,22 @@ The recents endpoint provides access to the device's recently played content his
```bash
# Basic usage - show last 10 items
go run main.go -host 192.168.1.100
go run main.go -host 192.0.2.100
# Show detailed information for all items
go run main.go -host 192.168.1.100 -detailed -limit 0
go run main.go -host 192.0.2.100 -detailed -limit 0
# Filter by source (show only Spotify items)
go run main.go -host 192.168.1.100 -source SPOTIFY
go run main.go -host 192.0.2.100 -source SPOTIFY
# Filter by content type (show only tracks)
go run main.go -host 192.168.1.100 -type track
go run main.go -host 192.0.2.100 -type track
# Show statistics only
go run main.go -host 192.168.1.100 -stats
go run main.go -host 192.0.2.100 -stats
# Combined filters with custom limit
go run main.go -host 192.168.1.100 -source LOCAL_MUSIC -type track -limit 5 -detailed
go run main.go -host 192.0.2.100 -source LOCAL_MUSIC -type track -limit 5 -detailed
```
## Command Line Options
@@ -49,7 +49,7 @@ go run main.go -host 192.168.1.100 -source LOCAL_MUSIC -type track -limit 5 -det
### Basic Listing
```
Getting recent items from 192.168.1.100
Getting recent items from 192.0.2.100
📊 Recent Items Summary:
Showing: 5 items (of 15 total)
@@ -146,31 +146,31 @@ Overall Statistics:
### 1. Recently Played Music Discovery
```bash
# Find recently played Spotify tracks
go run main.go -host 192.168.1.100 -source SPOTIFY -type track -detailed
go run main.go -host 192.0.2.100 -source SPOTIFY -type track -detailed
```
### 2. Radio Station History
```bash
# See what radio stations were recently played
go run main.go -host 192.168.1.100 -type station -detailed
go run main.go -host 192.0.2.100 -type station -detailed
```
### 3. Content Analytics
```bash
# Get detailed listening statistics
go run main.go -host 192.168.1.100 -stats
go run main.go -host 192.0.2.100 -stats
```
### 4. Preset Candidates
```bash
# Find content that can be saved as presets
go run main.go -host 192.168.1.100 -type presetable -limit 6
go run main.go -host 192.0.2.100 -type presetable -limit 6
```
### 5. Local vs Streaming Analysis
```bash
# Compare local vs streaming content usage
go run main.go -host 192.168.1.100 -stats
go run main.go -host 192.0.2.100 -stats
```
## API Integration
@@ -231,12 +231,12 @@ go run main.go -host 192.168.255.255
# Output: Failed to get recent items: connection timeout
# Test with unknown source
go run main.go -host 192.168.1.100 -source UNKNOWN
go run main.go -host 192.0.2.100 -source UNKNOWN
# Output: 📭 No items found for source: UNKNOWN
# 💡 Available sources: SPOTIFY, LOCAL_MUSIC, TUNEIN
# Test with unknown type
go run main.go -host 192.168.1.100 -type unknown
go run main.go -host 192.0.2.100 -type unknown
# Output: ❌ Unknown type filter: unknown
# 💡 Available types: track, station, playlist, album, presetable
```
@@ -259,16 +259,16 @@ This recents data is useful for:
```bash
# List recent items using CLI
soundtouch-cli --host 192.168.1.100 recents list
soundtouch-cli --host 192.0.2.100 recents list
# Filter recent items by source
soundtouch-cli --host 192.168.1.100 recents filter --source SPOTIFY
soundtouch-cli --host 192.0.2.100 recents filter --source SPOTIFY
# Get recent items statistics
soundtouch-cli --host 192.168.1.100 recents stats
soundtouch-cli --host 192.0.2.100 recents stats
# Show most recent item only
soundtouch-cli --host 192.168.1.100 recents latest
soundtouch-cli --host 192.0.2.100 recents latest
```
## API Documentation
+3 -3
View File
@@ -12,15 +12,15 @@ This is different from the `/sources` endpoint, which shows currently configured
### Method 1: Command Line Argument
```bash
go run main.go 192.168.1.100
go run main.go 192.0.2.100
```
### Method 2: Environment Variable
```bash
SOUNDTOUCH_HOST=192.168.1.100 go run main.go
SOUNDTOUCH_HOST=192.0.2.100 go run main.go
```
Replace `192.168.1.100` with your SoundTouch device's IP address.
Replace `192.0.2.100` with your SoundTouch device's IP address.
## Example Output
+9 -9
View File
@@ -25,7 +25,7 @@ This allows Spotify applications to automatically discover available speakers wi
http://[SPEAKER_IP]:8200/zc?action=[ACTION]&[PARAMETERS]
```
Example: `http://192.168.1.100:8200/zc?action=getInfo`
Example: `http://192.0.2.100:8200/zc?action=getInfo`
## The getInfo Action
@@ -158,7 +158,7 @@ The `version` parameter is optional but recommended for compatibility.
```bash
# Check if Spotify is active
curl -s "http://192.168.1.100:8200/zc?action=getInfo" | \
curl -s "http://192.0.2.100:8200/zc?action=getInfo" | \
grep -o '"activeUser" *: *"[^"]*"' | \
sed 's/"activeUser" *: *"//;s/"$//'
```
@@ -167,7 +167,7 @@ curl -s "http://192.168.1.100:8200/zc?action=getInfo" | \
```bash
# Get device name and ID
info=$(curl -s "http://192.168.1.100:8200/zc?action=getInfo")
info=$(curl -s "http://192.0.2.100:8200/zc?action=getInfo")
device_name=$(echo "$info" | grep -o '"remoteName" *: *"[^"]*"' | sed 's/"remoteName" *: *"//;s/"$//')
device_id=$(echo "$info" | grep -o '"deviceID" *: *"[^"]*"' | sed 's/"deviceID" *: *"//;s/"$//')
```
@@ -176,7 +176,7 @@ device_id=$(echo "$info" | grep -o '"deviceID" *: *"[^"]*"' | sed 's/"deviceID"
```bash
# Check multiroom status
group_status=$(curl -s "http://192.168.1.100:8200/zc?action=getInfo" | \
group_status=$(curl -s "http://192.0.2.100:8200/zc?action=getInfo" | \
grep -o '"groupStatus" *: *"[^"]*"' | \
sed 's/"groupStatus" *: *"//;s/"$//')
```
@@ -186,7 +186,7 @@ group_status=$(curl -s "http://192.168.1.100:8200/zc?action=getInfo" | \
The ZeroConf API supports the `addUser` action for Spotify authentication:
```bash
curl -X POST "http://192.168.1.100:8200/zc" \
curl -X POST "http://192.0.2.100:8200/zc" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "action=addUser&userName=${SPOTIFY_USER}&blob=${ACCESS_TOKEN}&clientKey=&tokenType=accesstoken"
```
@@ -252,7 +252,7 @@ See `spotify-prime-speaker.sh` for standalone token injection:
```bash
#!/bin/bash
# Health check script
SPEAKER_IP="192.168.1.100"
SPEAKER_IP="192.0.2.100"
info=$(curl -sf --max-time 5 "http://${SPEAKER_IP}:8200/zc?action=getInfo" 2>/dev/null)
if [ $? -eq 0 ]; then
@@ -290,14 +290,14 @@ fi
```bash
# Test basic connectivity
curl -sf --max-time 5 "http://192.168.1.100:8200/zc?action=getInfo"
curl -sf --max-time 5 "http://192.0.2.100:8200/zc?action=getInfo"
# Check detailed response
curl -s "http://192.168.1.100:8200/zc?action=getInfo" | jq .
curl -s "http://192.0.2.100:8200/zc?action=getInfo" | jq .
# Monitor authentication status
while true; do
active=$(curl -s "http://192.168.1.100:8200/zc?action=getInfo" | \
active=$(curl -s "http://192.0.2.100:8200/zc?action=getInfo" | \
grep -o '"activeUser" *: *"[^"]*"' | sed 's/"activeUser" *: *"//;s/"$//')
echo "$(date): activeUser = '$active'"
sleep 10