Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Sonos Roam Bluetooth Pairing
#1
I thought I would start a new thread. Thanks to help from the Forum I have managed to use bluetooth to connect my Moode/RPI4 to a Arcam MiniBlink and play internet radio from my Moode radio station list. This is great for going on vacation. But I use the bluetooth speaker for music via Spotify. So I bought a Sonos Roam to give me both Sonos play and another bluetooth speaker for general use.
I am stuck however at the pairing stage with my Moode/RPI4. It works fine for my Arcam but the pairing just stalls with Moode/Sonos and I have to switch off the RPI4 and restart to get back to the web UI. So keystrokes are: set the Sonos Roam to ready to pair (blue light flashing). Open Moode Bluetooth Control pick scan including LE devices. Pick the Sonos Roam from the list. Hit pair. The Moode UI says reconnect (usually I wait and this happens automatically). But the UI never comes back and the Moode cannot be reached until I switch the RPI4 off/on. 
I cannot find much on the Fourm about Sonos. I admit this is rather weird way of working - why not just use the Sonos App? But I have problems with internet radio when on vacation in other countries. And I wanted to use the radios curated by Moode to see if they were more stable. It looks like I need to buy a non-Sonos bluetooth speaker but before I do that I thought I would check the Forum for ideas. Thanks!
Reply
#2
You could try from the command line and see if there are any errors. My Anker SoundCore is already paired but I did include an example SCAN dnd PAIR command below. Also some Bluetooth speakers have a factory reset button. You might want to try that.

Code:
# SCAN
pi@moode:~ $ sudo /var/www/util/blu-control.sh -s
** Scanning for only BR/EDR devices (20 seconds)
**
** Trust expires in 90 seconds
** A4:77:58:09:EE:C8 Anker SoundCore
**

# PAIR
pi@moode:~ $ sudo /var/www/util/blu-control.sh -P A4:77:58:09:EE:C8

# HELP
pi@moode:~ $ sudo /var/www/util/blu-control.sh
** blu-control.sh version 1.6
**
** Bluetooth has a range of around 30 feet (10 meters) but range
** will vary depending on obstacles (metal, wall, etc.), device signal
** strength and quality, and level of electromagnetic interferrence.
**
** Usage: blu-control.sh [OPTION]
**
** -i Initialize/reset controller
** -s Scan (BR/EDR only) and trust devices
** -S Scan (LE and BR/EDR) and trust devices
** -p List paired devices
** -c List connected devices
** -l List trusted devices
** -d Disconnect device <MAC addr>
** -r Remove paired device <MAC addr>
** -P Pair with device <MAC addr>
** -C Connect to device <MAC addr>
** -D Disconnect all devices
** -R Remove all devices
** -h Help

ETA: Also check Sonos support and see if there is a firmware update for the speaker.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(12-21-2022, 07:24 PM)Tim Curtis Wrote: You could try from the command line and see if there are any errors. My Anker SoundCore is already paired but I did include an example SCAN dnd PAIR command below. Also some Bluetooth speakers have a factory reset button. You might want to try that.

Code:
# SCAN
pi@moode:~ $ sudo /var/www/util/blu-control.sh -s
** Scanning for only BR/EDR devices (20 seconds)
**
** Trust expires in 90 seconds
** A4:77:58:09:EE:C8 Anker SoundCore
**

# PAIR
pi@moode:~ $ sudo /var/www/util/blu-control.sh -P A4:77:58:09:EE:C8

# HELP
pi@moode:~ $ sudo /var/www/util/blu-control.sh
** blu-control.sh version 1.6
**
** Bluetooth has a range of around 30 feet (10 meters) but range
** will vary depending on obstacles (metal, wall, etc.), device signal
** strength and quality, and level of electromagnetic interferrence.
**
** Usage: blu-control.sh [OPTION]
**
** -i Initialize/reset controller
** -s Scan (BR/EDR only) and trust devices
** -S Scan (LE and BR/EDR) and trust devices
** -p List paired devices
** -c List connected devices
** -l List trusted devices
** -d Disconnect device <MAC addr>
** -r Remove paired device <MAC addr>
** -P Pair with device <MAC addr>
** -C Connect to device <MAC addr>
** -D Disconnect all devices
** -R Remove all devices
** -h Help

ETA: Also check Sonos support and see if there is a firmware update for the speaker.

Hi thanks for all the ideas. I am away at the moment but I will try these out as soon as I can and let you know.
Reply
#4
(12-22-2022, 09:57 PM)feh123 Wrote:
(12-21-2022, 07:24 PM)Tim Curtis Wrote: You could try from the command line and see if there are any errors. My Anker SoundCore is already paired but I did include an example SCAN dnd PAIR command below. Also some Bluetooth speakers have a factory reset button. You might want to try that.

Code:
# SCAN
pi@moode:~ $ sudo /var/www/util/blu-control.sh -s
** Scanning for only BR/EDR devices (20 seconds)
**
** Trust expires in 90 seconds
** A4:77:58:09:EE:C8 Anker SoundCore
**

# PAIR
pi@moode:~ $ sudo /var/www/util/blu-control.sh -P A4:77:58:09:EE:C8

# HELP
pi@moode:~ $ sudo /var/www/util/blu-control.sh
** blu-control.sh version 1.6
**
** Bluetooth has a range of around 30 feet (10 meters) but range
** will vary depending on obstacles (metal, wall, etc.), device signal
** strength and quality, and level of electromagnetic interferrence.
**
** Usage: blu-control.sh [OPTION]
**
** -i Initialize/reset controller
** -s Scan (BR/EDR only) and trust devices
** -S Scan (LE and BR/EDR) and trust devices
** -p List paired devices
** -c List connected devices
** -l List trusted devices
** -d Disconnect device <MAC addr>
** -r Remove paired device <MAC addr>
** -P Pair with device <MAC addr>
** -C Connect to device <MAC addr>
** -D Disconnect all devices
** -R Remove all devices
** -h Help

ETA: Also check Sonos support and see if there is a firmware update for the speaker.

Hi thanks for all the ideas. I am away at the moment but I will try these out as soon as I can and let you know.
Hi I have checked the Sonos - the software is up to date and I can bluetooth connect it to my Macbook and Arcam miniblink. I opened the moode ssh terminal and tried the commands you gave me above. The scan sees the Sonos and using the pair command with the mac address from the scan I get the message that the sonos is paired. However when I check the list of paired devices only the Arcam is present. I should say that moode will not play through my Macbook when bluetooth connected. I get error ALSA failed to open no such device for audio out. Quite a mystery to me!
Reply
#5
(12-27-2022, 04:47 PM)feh123 Wrote:
(12-22-2022, 09:57 PM)feh123 Wrote:
(12-21-2022, 07:24 PM)Tim Curtis Wrote: You could try from the command line and see if there are any errors. My Anker SoundCore is already paired but I did include an example SCAN dnd PAIR command below. Also some Bluetooth speakers have a factory reset button. You might want to try that.

Code:
# SCAN
pi@moode:~ $ sudo /var/www/util/blu-control.sh -s
** Scanning for only BR/EDR devices (20 seconds)
**
** Trust expires in 90 seconds
** A4:77:58:09:EE:C8 Anker SoundCore
**

# PAIR
pi@moode:~ $ sudo /var/www/util/blu-control.sh -P A4:77:58:09:EE:C8

# HELP
pi@moode:~ $ sudo /var/www/util/blu-control.sh
** blu-control.sh version 1.6
**
** Bluetooth has a range of around 30 feet (10 meters) but range
** will vary depending on obstacles (metal, wall, etc.), device signal
** strength and quality, and level of electromagnetic interferrence.
**
** Usage: blu-control.sh [OPTION]
**
** -i Initialize/reset controller
** -s Scan (BR/EDR only) and trust devices
** -S Scan (LE and BR/EDR) and trust devices
** -p List paired devices
** -c List connected devices
** -l List trusted devices
** -d Disconnect device <MAC addr>
** -r Remove paired device <MAC addr>
** -P Pair with device <MAC addr>
** -C Connect to device <MAC addr>
** -D Disconnect all devices
** -R Remove all devices
** -h Help

ETA: Also check Sonos support and see if there is a firmware update for the speaker.

Hi thanks for all the ideas. I am away at the moment but I will try these out as soon as I can and let you know.
Hi I have checked the Sonos - the software is up to date and I can bluetooth connect it to my Macbook and Arcam miniblink. I opened the moode ssh terminal and tried the commands you gave me above. The scan sees the Sonos and using the pair command with the mac address from the scan I get the message that the sonos is paired. However when I check the list of paired devices only the Arcam is present. I should say that moode will not play through my Macbook when bluetooth connected. I get error ALSA failed to open no such device for audio out. Quite a mystery to me!
Just an update. I have another older bluetooth speaker - a Braven 650. I tried this too without success. I have noticed that my Sonos Roam and the Braven are listed as trusted. So some sort of connection happened but these two speakers never fully connect.
Reply
#6
Try the latest moOde 8.2.4 release (fresh image) and see if the problem still occurs. If it does then post the moOde startup log and I'll have a look.

Code:
moodeutl -l
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
Tim CurtisTry the latest moOde 8.2.4 release (fresh image) and see if the problem still occurs. If it does then post the moOde startup log and I'll have a look.

Code:
moodeutl -l

Thanks for your help. I restarted from a fresh 8.2.4 img file. I did not set up the up a library (it's always a struggle tovget my SMB addresses to work). But I have the my radios playing well. I sert up the bluetooth controller but if anything it's now worse. I cannot see the BT for the sonos roam at all. I paste the results (hope it helps!):moodeutl -l
20221230 120336 worker: --                                                                                                      
20221230 120337 worker: -- Start moOde 8 series                                                                                
20221230 120337 worker: --                                                                                                      
20221230 120337 worker: Successfully daemonized                                                                                
20221230 120340 worker: File check (OK)                                                                                        
20221230 120342 worker: Session vacuumed                                                                                        
20221230 120342 worker: Session loaded                                                                                          
20221230 120342 worker: Debug logging (OFF)                                                                                    
20221230 120342 worker: --                                                                                                      
20221230 120342 worker: -- Audio debug                                                                                          
20221230 120342 worker: --                                                                                                      
20221230 120342 worker: ALSA cards: (0Confusedndrpihifiberry | 1:empty | 2:empty | 3:empty                                            
20221230 120342 worker: MPD config: (0:HiFiBerry Digi+ Pro | mixerSadnone) | card:0)                                            
20221230 120342 worker: ALSA mixer actual (none)                                                                                
20221230 120342 worker: ALSA volume (none)                                                                                      
20221230 120342 worker: --                                                                                                      
20221230 120342 worker: -- System                                                                                              
20221230 120342 worker: --                                                                                                      
20221230 120344 worker: Host      (moode)                                                                                      
20221230 120344 worker: moOde     (8.2.4 2022-12-27)                                                                            
20221230 120344 worker: RaspiOS   (11.6)                                                                                        
20221230 120344 worker: Kernel    (5.15.76-v8+ #1597)                                                                          
20221230 120344 worker: Platform  (Pi-3B 1.2 1GB)                                                                              
20221230 120344 worker: ARM arch  (aarch64, 64-bit)                                                                            
20221230 120344 worker: MPD ver   (0.23.11)                                                                                    
20221230 120344 worker: CPU gov   (performance)                                                                                
20221230 120344 worker: USB boot  (not enabled yet)                                                                            
20221230 120344 worker: File sys  (expanded)                                                                                    
20221230 120344 worker: HDMI port (On)                                                                                          
20221230 120344 worker: Sys LED0  (On)                                                                                          
20221230 120344 worker: Sys LED1  (On)                                                                                          
20221230 120344 worker: --                                                                                                      
20221230 120344 worker: -- Network                                                                                              
20221230 120344 worker: --                                                                                                      
20221230 120344 worker: eth0 adapter exists                                                                                    
20221230 120344 worker: eth0 check for address (Off)                                                                            
20221230 120344 worker: eth0 address not assigned                                                                              
20221230 120344 worker: wlan0 adapter exists                                                                                    
20221230 120344 worker: wlan0 country (US)                                                                                      
20221230 120344 worker: wlan0 SSID is "None (activates AP mode)"                                                                
20221230 120344 worker: wlan0 AP mode started                                                                                  
20221230 120354 worker: wlan0 check 0 for IP address                                                                            
20221230 120356 worker: wlan0 check 1 for IP address                                                                            
20221230 120358 worker: wlan0 check 2 for IP address                                                                            
20221230 120400 worker: IP addr (172.24.1.1)                                                                                    
20221230 120400 worker: Netmask (255.255.255.0)                                                                                
20221230 120400 worker: Gateway (192.168.1.1)                                                                                  
20221230 120400 worker: Pri DNS (127.0.0.1)                                                                                    
20221230 120400 worker: Domain  ()                                                                                              
20221230 120400 worker: wlan0 power save disabled                                                                              
20221230 120400 worker: apd0 router mode (Off)                                                                                  
20221230 120400 worker: --                                                                                                      
20221230 120400 worker: -- Software update                                                                                      
20221230 120400 worker: --                                                                                                      
20221230 120400 worker: Automatic check (On)                                                                                    
20221230 120400 worker: Unable to check: No IP address or AP mode is On                                                        
20221230 120400 worker: --                                                                                                      
20221230 120400 worker: -- Audio config                                                                                        
20221230 120400 worker: --                                                                                                      
20221230 120401 worker: MPD conf updated                                                                                        
20221230 120401 worker: ALSA card number (0)                                                                                    
20221230 120401 worker: MPD audio output (HiFiBerry Digi+ Pro)                                                                  
20221230 120401 worker: Audio formats (S16_LE, S24_LE)                                                                          
20221230 120401 worker: ALSA mixer name (none)                                                                                  
20221230 120401 worker: MPD mixer type (software)                                                                              
20221230 120401 worker: Hdwr volume controller not detected                                                                    
20221230 120401 worker: ALSA output mode (Default: plughw)                                                                      
20221230 120401 worker: ALSA loopback (Off)                                                                                    
20221230 120401 worker: Reset renderer active flags                                                                            
20221230 120401 worker: CamillaDSP (off)                                                                                        
20221230 120401 worker: --                                                                                                      
20221230 120401 worker: -- File sharing                                                                                        
20221230 120401 worker: --                                                                                                      
20221230 120401 worker: SMB file sharing (Off)                                                                                  
20221230 120401 worker: NFS file sharing (Off)                                                                                  
20221230 120401 worker: --                                                                                                      
20221230 120401 worker: -- MPD startup                                                                                          
20221230 120401 worker: --                                                                                                      
20221230 120402 worker: MPD started                                                                                            
20221230 120402 worker: MPD accepting connections                                                                              
20221230 120402 worker: MPD output 1 ALSA Default (On)                                                                          
20221230 120402 worker: MPD output 2 ALSA Bluetooth (Off)                                                                      
20221230 120402 worker: MPD output 3 HTTP Server (Off)                                                                          
20221230 120402 worker: MPD crossfade (off)                                                                                    
20221230 120402 worker: MPD ignore CUE files (yes)                                                                              
20221230 120402 worker: --                                                                                                      
20221230 120402 worker: -- Music sources                                                                                        
20221230 120402 worker: --                                                                                                      
20221230 120402 worker: USB sources                                                                                            
20221230 120402 worker: No drives found                                                                                        
20221230 120402 worker: NAS sources                                                                                            
20221230 120402 worker: None configured                                                                                        
20221230 120402 worker: --                                                                                                      
20221230 120402 worker: -- Feature availability                                                                                
20221230 120402 worker: --                                                                                                      
20221230 120402 worker: Input select (available)                                                                                
20221230 120402 worker: Input (MPD)                                                                                            
20221230 120402 worker: Output (HiFiBerry Digi+ Pro)                                                                            
20221230 120402 worker: Bluetooth (available)                                                                                  
20221230 120402 worker: AirPlay renderer (available)                                                                            
20221230 120402 worker: Spotify renderer (available)                                                                            
20221230 120402 worker: Squeezelite (available)                                                                                
20221230 120402 worker: RoonBridge renderer (not installed)                                                                    
20221230 120402 worker: Multiroom sender (available)                                                                            
20221230 120402 worker: Multiroom receiver (available)                                                                          
20221230 120402 worker: UPnP renderer (available)                                                                              
20221230 120402 worker: DLNA server (available)                                                                                
20221230 120402 worker: GPIO button handler (available)                                                                        
20221230 120402 worker: Stream recorder (n/a)                                                                                  
20221230 120402 worker: HTTPS-Only mode (n/a)                                                                                  
20221230 120402 worker: --                                                                                                      
20221230 120402 worker: -- Other                                                                                                
20221230 120402 worker: --                                                                                                      
20221230 120402 worker: USB volume knob (Off)                                                                                  
20221230 120402 worker: USB auto-mounter (udisks-glue)                                                                          
20221230 120402 worker: Saved MPD vol level (0)                                                                                
20221230 120402 worker: Preamp volume level (0)                                                                                
20221230 120402 worker: MPD volume level (0) restored                                                                          
20221230 120402 worker: ALSA volume level (None)                                                                                
20221230 120402 worker: Auto-play (Off)                                                                                        
20221230 120402 worker: LocalUI (Off)                                                                                          
20221230 120402 worker: CoverView toggle (Off)                                                                                  
20221230 120402 worker: On-screen keyboard (Off)                                                                                
20221230 120402 worker: Library scope (all)                                                                                    
20221230 120402 worker: View reset to playback                                                                                  
20221230 120402 worker: Maintenance interval (360 minutes)                                                                      
20221230 120402 worker: Screen saver activation (Never)                                                                        
20221230 120402 worker: Session permissions (OK)                                                                                
20221230 120402 worker: Mount monitor started                                                                                  
20221230 120402 worker: Watchdog started                                                                                        
20221230 120402 worker: Ready                                                                                                  
20221230 120458 worker: Job btsvc                                                                                              
20221230 121151 worker: Job mpdcfg                                                                                              
20221230 121153 worker: Job mpdcfg: devchg|mixchg (0|0), alsavol (none), playstate (paused)                                    
20221230 121322 worker: Job pairing_agent                                                                                      
20221230 122839 worker: Job sourcecfg                                                                                          
20221230 122956 worker: Job sourcecfg                                                                                          
20221230 123029 worker: Job sourcecfg                                                                                          
20221230 123330 worker: Job set_ralogo_image                                                                                    
20221230 123527 worker: Job shellinabox                                                                                        
pi@Moode:~ $
Reply
#8
The Gateway address in the AP mode section is not correct. It should be 0.0.0.0. I'm not sure how Gateway could be set to a completely different network.

Code:
20221230 120344 worker: wlan0 AP mode started
20221230 120354 worker: wlan0 check 0 for IP address
20221230 120356 worker: wlan0 check 1 for IP address
20221230 120358 worker: wlan0 check 2 for IP address
20221230 120400 worker: IP addr (172.24.1.1)
20221230 120400 worker: Netmask (255.255.255.0)
20221230 120400 worker: Gateway (192.168.1.1)
20221230 120400 worker: Pri DNS (127.0.0.1)
20221230 120400 worker: Domain  ()   

As far a the rest of the log goes I don't see anything suspicious.

ETA: I suppose one other thing you could try is to remove the audio HAT just in case it's on-board oscillators are emitting RF in the 2.4GHz band. This was an issue with early hifiberry day pro.

ETA: In addition to removing the audio HAT use an Ethernet or WiFi 5GHz connection instead of AP mode which uses 2.4GHz on default channel 6.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#9
I don't have access to a Sonos Roam speaker but I do to a Sonos Move Speaker. This model also have both WiFi and Bluetooth connectivity.

The Move has been updated to latest OS (aka firmware).

Testing just now with a moOde 8.2.4 player (updated from 8.2.3) on a Pi3A, I successfully scanned and paired with both devices

Code:
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -l
** Discovered devices
**
** F0:F6:C1:5B:15:28 Sonos Move (SONOS 1528)
** 00:1D:DF:AA:27:37 JBL Flip 2
**
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -p
** Paired devices
**
** F0:F6:C1:5B:15:28 Sonos Move (SONOS 1528)
** 00:1D:DF:AA:27:37 JBL Flip 2
**

Try connecting to the JBL

Code:
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -C 00:1D:DF:AA:27:37
** Connecting to device 00:1D:DF:AA:27:37
** Device 00:1D:DF:AA:27:37 connected
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -c
** Connected devices
**
** 00:1D:DF:AA:27:37 JBL Flip 2
**

...and I can play to it.

Now, try connecting to the Sonos

Code:
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -C F0:F6:C1:5B:15:28
** Connecting to device F0:F6:C1:5B:15:28
** Device F0:F6:C1:5B:15:28 connected
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -c
** Connected devices
**
** 00:1D:DF:AA:27:37 JBL Flip 2
**

Huh. The connection process reports success but the connection itself doesn't show up??? This isn't right. (Note: I'm working directly with the Bluetooth subsystem here so it isn't an error that the JBL shows up still in this test, only that the Sonos doesn't.)

Maybe I'll get time later to explore further with low-level tools but this doesn't look like a moOde issue per se. This is the first Bluetooth-enabled speaker or headphone I haven't been able to use with moOde.

Regards,
Kent
Reply
#10
TheOldPresbyopeI don't have access to a Sonos Roam speaker but I do to a Sonos Move Speaker. This model also have both WiFi and Bluetooth connectivity.

The Move has been updated to latest OS (aka firmware).

Testing just now with a moOde 8.2.4 player (updated from 8.2.3) on a Pi3A, I successfully scanned and paired with both devices

Code:
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -l
** Discovered devices
**
** F0:F6:C1:5B:15:28 Sonos Move (SONOS 1528)
** 00:1D:DF:AA:27:37 JBL Flip 2
**
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -p
** Paired devices
**
** F0:F6:C1:5B:15:28 Sonos Move (SONOS 1528)
** 00:1D:DF:AA:27:37 JBL Flip 2
**

Try connecting to the JBL

Code:
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -C 00:1D:DF:AA:27:37
** Connecting to device 00:1D:DF:AA:27:37
** Device 00:1D:DF:AA:27:37 connected
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -c
** Connected devices
**
** 00:1D:DF:AA:27:37 JBL Flip 2
**

...and I can play to it.

Now, try connecting to the Sonos

Code:
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -C F0:F6:C1:5B:15:28
** Connecting to device F0:F6:C1:5B:15:28
** Device F0:F6:C1:5B:15:28 connected
pi@m824p3a:~ $ sudo /var/www/util/blu-control.sh -c
** Connected devices
**
** 00:1D:DF:AA:27:37 JBL Flip 2
**

Huh. The connection process reports success but the connection itself doesn't show up??? This isn't right. (Note: I'm working directly with the Bluetooth subsystem here so it isn't an error that the JBL shows up still in this test, only that the Sonos doesn't.)

Maybe I'll get time later to explore further with low-level tools but this doesn't look like a moOde issue per se. This is the first Bluetooth-enabled speaker or headphone I haven't been able to use with moOde.

Regards,
Kent

Thanks to you and Tim for all your help. A question under Bluetooth control do you set the pairing agent on? I have noticed a few odd things - I need to turn off HDMI to get Spotify to work and I still have issues with the sound output. I have this set to Software but to use Spotify with output to Moode Spotify I have to check my laptop audio is set high otherwise although I have a controller for the audio output (it's a Naim amp) that does not work. I will keep trying to get the Roam to connect - it connects so quickly to my macbook, iphone and ipad that I have to switch the bluetooth off on these devices otherwise I think it's paired to Moode only to find it's connected to my Apple devices! But I do have a backup - the Arcam Miniblink works so I can plug the audio from that into the Braven and that works! I will post if I ever get the Roam to connect. Thanks again.
Reply


Forum Jump: