Documentation for controlling and preserving Bose SoundTouch devices
This document provides a comprehensive analysis of the current SoundTouch device registration and lifecycle management implementation, and proposes enhancements using the /power_on endpoint to reduce dependency on local network connectivity.
The current system uses multiple data collection methods to build a complete device profile:
urn:schemas-upnp-org:service:SoundTouch:1type DiscoveredDevice struct {
Name string // From UPnP friendlyName
Host string // IP address
Port int // Usually 8090
ModelID string // From UPnP modelName
SerialNo string // MAC address from UPnP
UPnPLocation string // Device description URL
UPnPUSN string // Unique service name
}
_soundtouch._tcp services/info Endpoint Enrichmenthttp://device:8090/info<info deviceID="ABCD1234EFGH">
<name>My SoundTouch Device</name>
<type>SoundTouch 10</type>
<margeAccountUUID>3230304</margeAccountUUID>
<components>
<component>
<componentCategory>SCM</componentCategory>
<softwareVersion>27.0.6.46330.5043500...</softwareVersion>
<serialNumber>I6332527703739342000020</serialNumber>
</component>
</components>
<margeURL>https://streaming.bose.com</margeURL>
<networkInfo type="SCM">
<macAddress>AA:BB:CC:DD:EE:FF</macAddress>
<ipAddress>192.168.1.10</ipAddress>
</networkInfo>
<moduleType>sm2</moduleType>
<variant>rhino</variant>
<countryCode>GB</countryCode>
</info>
sequenceDiagram
participant Service as SoundTouch Service
participant UPnP as UPnP Discovery
participant mDNS as mDNS Discovery
participant Device as SoundTouch Device
participant DataStore as Data Store
participant User as User/App
Note over Service,User: Current Device Registration Flow
Service->>UPnP: Start SSDP Discovery
Service->>mDNS: Start mDNS Discovery
UPnP->>UPnP: Send M-SEARCH multicast
Device->>UPnP: Respond with location URL
UPnP->>Device: Fetch device description XML
Device->>UPnP: Return basic device info
mDNS->>mDNS: Query _soundtouch._tcp
Device->>mDNS: Respond with service info
Service->>Service: Merge discovery results
Service->>Device: GET /info (enrich data)
Device->>Service: Return detailed device info
Service->>DataStore: Store discovered device
Note over User,DataStore: User Registration
User->>Service: POST /account/{id}/devices
Note right of User: deviceId + user-friendly name
Service->>DataStore: Link device to account
Note over Service,DataStore: Migration Process
Service->>Device: GET /info (device identification)
Device->>Service: Return device details
Service->>Service: Build migration summary
Service->>Device: Apply configuration changes
The system has distinct phases where device information is collected and enhanced:
Trigger: Automatic network scanning
Data Sources: UPnP + mDNS + /info endpoint
Limitations: ❌ Requires same network segment
Trigger: User adds device to account
Endpoint: POST /streaming/account/{accountId}/devices
Request Format:
<device deviceid="08DF1F0BA325">
<name>Living Room Speaker</name>
</device>
Data Added: ✅ User-friendly name, Account association
Triggers: Device state changes, firmware updates, network changes
Methods: Periodic /info polling, Discovery refresh, User configuration
The system maintains comprehensive device information:
type ServiceDeviceInfo struct {
DeviceID string `json:"device_id"` // MAC or UUID
Name string `json:"name"` // User-friendly name
ProductCode string `json:"product_code"` // Device model
DeviceSerialNumber string `json:"device_serial_number"` // Hardware serial
ProductSerialNumber string `json:"product_serial_number"` // Product serial
FirmwareVersion string `json:"firmware_version"` // Software version
IPAddress string `json:"ip_address"` // Current IP
MacAddress string `json:"mac_address"` // MAC address
AccountID string `json:"account_id"` // Account association
DiscoveryMethod string `json:"discovery_method"` // How discovered
}
| Issue | Impact | Affected Operations |
|---|---|---|
| Same Network Requirement | High | Device discovery, Initial setup |
| Direct Connectivity Need | High | Device enrichment, Migration |
| Firewall/NAT Restrictions | Medium | Corporate networks, Complex setups |
| Multi-VLAN Environments | High | Enterprise deployments |
| Remote Management | Critical | Off-site device support |
The /power_on endpoint receives comprehensive device data that could replace many network-dependent operations:
<device-data>
<device id="A81B6A536A98">
<serialnumber>I6332527703739342000020</serialnumber>
<firmware-version>27.0.6.46330.5043500 epdbuild.trunk.hepdswbld04.2022-08-04T11:20:29</firmware-version>
<product product_code="SoundTouch 10 sm2" type="5">
<serialnumber>069231P63364828AE</serialnumber>
</product>
</device>
<diagnostic-data>
<device-landscape>
<rssi>Excellent</rssi>
<gateway-ip-address>192.168.178.1</gateway-ip-address>
<macaddresses>
<macaddress>A81B6A536A98</macaddress>
<macaddress>A81B6A849D99</macaddress>
</macaddresses>
<ip-address>192.168.178.35</ip-address>
<network-connection-type>Wireless</network-connection-type>
</device-landscape>
<network-landscape>
<network-data xmlns="http://www.Bose.com/Schemas/2012-12/NetworkMonitor/"/>
</network-landscape>
</diagnostic-data>
</device-data>
| Data Field | Current /info |
/power_on |
Gap Assessment |
|---|---|---|---|
| Device ID | ✅ UUID format | ✅ MAC format | Different format |
| Device Name | ✅ Internal name | ❌ Missing | Critical Gap |
| Device Type | ✅ Model string | ✅ Product code | ✅ Available |
| Account ID | ✅ marge UUID | ❌ Missing | Critical Gap |
| Service URL | ✅ marge URL | ❌ Missing | Important Gap |
| Firmware Version | ✅ Full version | ✅ Full version | ✅ Available |
| Serial Numbers | ✅ Component serials | ✅ Device + Product | ✅ Available |
| MAC Addresses | ✅ Interface-specific | ✅ Multiple MACs | ✅ Enhanced |
| IP Address | ✅ Interface IPs | ✅ Current IP | ✅ Available |
| Network Status | ❌ Basic | ✅ Rich diagnostics | ✅ Enhanced |
| Regional Settings | ✅ Country/Region | ❌ Missing | Important Gap |
Implement /power_on processing while maintaining existing discovery methods:
func (s *Server) HandleMargePowerOn(w http.ResponseWriter, r *http.Request) {
// Parse power_on request
var powerOnData models.CustomerSupportRequest
if err := xml.Unmarshal(body, &powerOnData); err != nil {
// Fallback to existing discovery
return s.fallbackToDiscovery(r.RemoteAddr)
}
// Extract device information
deviceMAC := powerOnData.Device.ID
deviceIP := powerOnData.DiagnosticData.DeviceLandscape.IPAddress
// Lookup existing device data
deviceInfo := s.lookupDeviceByMAC(deviceMAC)
if deviceInfo == nil {
// New device - trigger registration flow
deviceInfo = s.createDeviceFromPowerOn(powerOnData)
}
// Update with power_on data
s.updateDeviceFromPowerOn(deviceInfo, powerOnData)
// Determine response actions
response := s.buildPowerOnResponse(deviceInfo)
s.sendResponse(w, response)
}
Address missing data through complementary mechanisms:
sequenceDiagram
participant Device as SoundTouch Device
participant Service as SoundTouch Service
participant DataStore as Data Store
participant User as User/App
Note over Device,User: Enhanced Device Lifecycle
rect rgb(248, 255, 248)
Note over Device,DataStore: 1. Power-On Registration
Device->>Service: POST /power_on (rich device data)
Service->>DataStore: Lookup device by MAC
alt Device Unknown
Service->>DataStore: Create device record
Service->>User: Notify new device found
else Device Known
Service->>DataStore: Update device status
end
Service->>Device: Configuration response
end
rect rgb(255, 248, 240)
Note over User,DataStore: 2. User Registration (Optional)
User->>Service: POST /setup/devices (name + preferences)
Service->>DataStore: Add user metadata to device
Service->>Device: Updated configuration (on next power_on)
end
rect rgb(240, 248, 255)
Note over Device,DataStore: 3. Ongoing Updates
Device->>Service: POST /power_on (status changes)
Service->>Service: Detect firmware/network changes
Service->>DataStore: Update device record
alt Migration Needed
Service->>Device: Migration instructions
Device->>Device: Apply configuration
Device->>Service: POST /power_on (confirm changes)
end
end
rect rgb(255, 248, 255)
Note over Service,User: 4. Remote Management
User->>Service: Management request (any location)
Service->>DataStore: Lookup device status
Service->>User: Current device state
Note over Service: No local network required
end
/info endpoint access for device identification/power_on instead of IP-based /info/power_on response/power_on requeststype PowerOnResponse struct {
ConfigurationUpdates []ConfigUpdate `json:"configuration_updates,omitempty"`
MigrationInstructions *Migration `json:"migration,omitempty"`
RegistrationRequired bool `json:"registration_required,omitempty"`
}
type Migration struct {
Method string `json:"method"` // xml, hosts, resolv_conf
TargetURL string `json:"target_url"`
ProxyURL string `json:"proxy_url,omitempty"`
Options map[string]string `json:"options"`
}
/power_on handler to extract and store comprehensive device data/power_on and existing methods/power_on discovered devices/power_on response mechanism/power_on/power_on events/power_on data is incompleteThe /power_on endpoint provides a significant opportunity to reduce network dependencies while enhancing device management capabilities. By implementing a hybrid approach that leverages /power_on data for primary device identification and status updates while maintaining existing registration workflows for user-controlled metadata, the system can achieve:
The proposed implementation strategy provides a clear path to achieve these benefits while maintaining system reliability and user workflow compatibility.