Listen to your favourite radios V2
Moderator: leecollings
-
- Posts: 50
- Joined: Monday 08 January 2018 2:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Listen to your favourite radios V2
Seems that your Pi cannot find a bluetooth device... Can you check lspci and lsusb.
-
- Posts: 230
- Joined: Saturday 21 July 2018 19:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Home@Belgium
- Contact:
Re: Listen to your favourite radios V2
status of bluetooth give me this output
did a fresh reinstall BTW
Everything looks working normal
lsusb works lspci not=
did a fresh reinstall BTW
Everything looks working normal
Code: Select all
gianni@xxxxxxx:~ $ systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset
Active: active (running) since Fri 2018-09-21 09:39:36 CEST; 1h 2min ago
Docs: man:bluetoothd(8)
Main PID: 449 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─449 /usr/lib/bluetooth/bluetoothd
sep 21 09:39:36 domotic systemd[1]: Starting Bluetooth service...
sep 21 09:39:36 domotic bluetoothd[449]: Bluetooth daemon 5.43
sep 21 09:39:36 domotic systemd[1]: Started Bluetooth service.
sep 21 09:39:36 domotic bluetoothd[449]: Starting SDP server
sep 21 09:39:36 domotic bluetoothd[449]: Bluetooth management interface 1.14 ini
[color=#FF0000]sep 21 09:39:36 domotic bluetoothd[449]: Failed to obtain handles for "Service C
sep 21 09:39:36 domotic bluetoothd[449]: Sap driver initialization failed.
sep 21 09:39:36 domotic bluetoothd[449]: sap-server: Operation not permitted (1)
sep 21 09:39:37 domotic bluetoothd[449]: Failed to set privacy: Rejected (0x0b)[/color]
lines 1-18/18 (END)
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-09-21 09:39:36 CEST; 1h 2min ago
Docs: man:bluetoothd(8)
Main PID: 449 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─449 /usr/lib/bluetooth/bluetoothd
sep 21 09:39:36 domotic systemd[1]: Starting Bluetooth service...
sep 21 09:39:36 domotic bluetoothd[449]: Bluetooth daemon 5.43
sep 21 09:39:36 domotic systemd[1]: Started Bluetooth service.
sep 21 09:39:36 domotic bluetoothd[449]: Starting SDP server
sep 21 09:39:36 domotic bluetoothd[449]: Bluetooth management interface 1.14 initialized
[color=#FF0000]sep 21 09:39:36 domotic bluetoothd[449]: Failed to obtain handles for "Service Changed" characteristic
sep 21 09:39:36 domotic bluetoothd[449]: Sap driver initialization failed.
sep 21 09:39:36 domotic bluetoothd[449]: sap-server: Operation not permitted (1)
sep 21 09:39:37 domotic bluetoothd[449]: Failed to set privacy: Rejected (0x0b)[/color]
Code: Select all
gianni@xxxxxxxx~ $ lsusb
Bus 001 Device 004: ID 0658:0200 Sigma Designs, Inc.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
gianni@xxxxxxx:~ $ lspci
-bash: lspci: opdracht niet gevonden
gianni@xxxxxx:~ $
Code: Select all
gianni@xxxxxx:~ $ rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
-
- Posts: 50
- Joined: Monday 08 January 2018 2:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Listen to your favourite radios V2
Hi, this is interesting:
Look here:
https://www.raspberrypi.org/forums/view ... p?t=131999
Code: Select all
Sap driver initialization failed.
https://www.raspberrypi.org/forums/view ... p?t=131999
-
- Posts: 230
- Joined: Saturday 21 July 2018 19:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Home@Belgium
- Contact:
Re: Listen to your favourite radios V2
ok first thing solved.
The distance between te bleutooth speaker and the pi was to far.
Put my pi near my speaker and i got music when i exesute the command om my PI
But i still not get it work in Domoticz.
Looks like the os.excecute is not excecute on the pi
The distance between te bleutooth speaker and the pi was to far.
Put my pi near my speaker and i got music when i exesute the command om my PI
But i still not get it work in Domoticz.
Looks like the os.excecute is not excecute on the pi

- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: Listen to your favourite radios V2
have you setted the country in raspi-config or in the wpasupplicant.conf ?
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
-
- Posts: 230
- Joined: Saturday 21 July 2018 19:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Home@Belgium
- Contact:
Re: Listen to your favourite radios V2
yep my country is set correct
but my bleutooth is working now it's only the os-execute that not work.
When i test to make a dir in my homefolder with os-execute the dir does not come in my home folder.
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=BE
When i test to make a dir in my homefolder with os-execute the dir does not come in my home folder.
-
- Posts: 230
- Joined: Saturday 21 July 2018 19:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Home@Belgium
- Contact:
Re: Listen to your favourite radios V2
still not working
it's drive me mad
Reinstall my domoticz and stretch multiple time's.
so short
if i execute direct on my pi manual it's play on my bleutooth speaker.
if i execute this code on domoticz
it's kill the player i started manual.
But if is start this code from domoticz it's not play
so whats the different between the off and the MNM code?
The only thing i can think off is that is delete the PI user and use my own user account?
it's drive me mad

Reinstall my domoticz and stretch multiple time's.
so short
if i execute
Code: Select all
mplayer -noconsolecontrols http://uk2.internet-radio.com:8358/ &> /dev/null
if i execute this code on domoticz
Code: Select all
if device.state == 'Off' then
os.execute ("killall mplayer")
end
But if is start this code from domoticz it's not play
Code: Select all
if device.state == 'MNM' then
os.execute ("killall mplayer")
os.execute ("mplayer -noconsolecontrols http://uk2.internet-radio.com:8358/ &> /dev/null")
end
The only thing i can think off is that is delete the PI user and use my own user account?
-
- Posts: 230
- Joined: Saturday 21 July 2018 19:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Home@Belgium
- Contact:
Re: Listen to your favourite radios V2
i found the problem now i need to find a solution
I create a simple bash script that excecute
if i run mplayer -noconsolecontrols http://uk2.internet-radio.com:8358/ in the console it's works
if i run it from the script i get a pulse connection refused
Starting playback...
I create a simple bash script that excecute
Code: Select all
mplayer -noconsolecontrols http://uk2.internet-radio.com:8358/
Code: Select all
Audio only file format detected.
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
Code: Select all
Audio only file format detected.
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
-
- Posts: 50
- Joined: Monday 08 January 2018 2:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Listen to your favourite radios V2
Hi, I'm not sure. But can you try this:
Code: Select all
sudo adduser <username> audio
-
- Posts: 230
- Joined: Saturday 21 July 2018 19:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Home@Belgium
- Contact:
Re: Listen to your favourite radios V2
gianni@domotic:~ $ sudo adduser gianni audio
De gebruiker `gianni' is reeds lid van `audio'.

toch bedankt om mee te denken
De gebruiker `gianni' is reeds lid van `audio'.

toch bedankt om mee te denken
-
- Posts: 50
- Joined: Monday 08 January 2018 2:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Listen to your favourite radios V2
Oh great
.
Gern geschehen. Viel Spaß
.

Gern geschehen. Viel Spaß

-
- Posts: 230
- Joined: Saturday 21 July 2018 19:03
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Home@Belgium
- Contact:
Re: Listen to your favourite radios V2
hheehehe it's not working,i was already a member of audio 

-
- Posts: 50
- Joined: Monday 08 January 2018 2:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Listen to your favourite radios V2
Ok bad... 

- amplituda
- Posts: 24
- Joined: Thursday 23 August 2018 14:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Finland
- Contact:
Re: Listen to your favourite radios V2
Hello everyone!) Have you tried to switch channels with a radio button from Xiaomi?
that is, you can make the command "next channel" and so on in a circle?
that is, you can make the command "next channel" and so on in a circle?
- ledfreak3d
- Posts: 98
- Joined: Sunday 01 November 2015 15:30
- Target OS: Linux
- Domoticz version: 3.8025
- Location: Hoorn
- Contact:
Re: Listen to your favourite radios V2
bluetooth audio from domoticz seems to be a bit of an issue and i cant find why
from console all works great
from domotiz it does not but only when using bluetooth when using analog or hdmi out no issue
from console all works great
from domotiz it does not but only when using bluetooth when using analog or hdmi out no issue
Unleashe the magic smoke ;)
-
- Posts: 18
- Joined: Wednesday 05 December 2018 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Italy
- Contact:
Re: Listen to your favourite radios V2
Hi all, after some issue I found this solution...
Use to don' block the script and
Use
Code: Select all
io.popen
Code: Select all
runuser -l pi -c
Code: Select all
if domoticz.devices('WebRadio').state == 'Subasio' then
--domoticz.notify('WebRadio','Radio Subasio on air...', domoticz.PRIORITY_NORMAL)
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://onair18.xdevel.com:8152 -volume 100 &> /dev/null'")
domoticz.notify('WebRadio','Radio Subasio on air...', domoticz.PRIORITY_NORMAL)
--os.execute ("runuser -l pi -c \'mplayer -noconsolecontrols http://onair18.xdevel.com:8152 -volume 100 &> /dev/null'")
end
-
- Posts: 18
- Joined: Wednesday 05 December 2018 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Italy
- Contact:
Re: Listen to your favourite radios V2
Finish!
I add two dummy selector switches "WebRadio" and "Volume"
When you change the volume is not necessary to kill and restart...
Change your device with your device...
run to know your...
I add two dummy selector switches "WebRadio" and "Volume"
When you change the volume is not necessary to kill and restart...
Change your device
Code: Select all
"NBY5540 - A2DP"
run
Code: Select all
amixer
Code: Select all
return {
data = {
switchwebradio = { initial = "Off" }
},
on = {
devices = {
'WebRadio',
'Volume'
}
},
execute = function(domoticz, triggeredItem, info)
local volume = domoticz.devices('Volume').level
if (domoticz.devices('Volume').state == "Off") then
volume = 0
end
cmd = 'amixer set "NBY5540 - A2DP" ' ..volume.. '% &> /dev/null'
os.execute ("runuser -l pi -c \'" ..cmd.. "'")
if (domoticz.devices('WebRadio').state ~= domoticz.data.switchwebradio) then
if (domoticz.devices('WebRadio').state == 'Off') then
os.execute ("killall mplayer")
domoticz.notify('WebRadio','WebRadio spenta', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'Subasio' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://onaxr18.xxxxxxxxxxxxxx.com:8152 &> /dev/null'")
domoticz.notify('WebRadio','Radio Subasio on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'RTL' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols https://strex2.xxxxxxxxxx.com/rtl-1025 &> /dev/null'")
domoticz.notify('WebRadio','RTL 102.5 on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == '105' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://icecast.xxxxxxxxxxo.it/Radio105.mp3 &> /dev/null'")
domoticz.notify('WebRadio','Radio 105 on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'RDS' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://icstream.rxxxxxxxxxs.radio/rdsmp3 &> /dev/null'")
domoticz.notify('WebRadio','RDS on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'Deejay' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://raxxxxxxxxxy-lh.akamaihd.net/i/RadioDeejay_Live_1@189857/master.m3u8 &> /dev/null'")
domoticz.notify('WebRadio','Radio Deejay on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'RadioItalia' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols https://radixxxxxxxxxxxxxi-lh.akamaihxxxxxxnet/i/radioitaliasmi_1@329643/master.m3u8 &> /dev/null'")
domoticz.notify('WebRadio','Radio Italia on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'RadioUno' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://icestreamxxxxxxxxx.it/1.mp3 &> /dev/null'")
domoticz.notify('WebRadio','Rai Radio 1 on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'RadioDue' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://icestreaxxxxxxxxxx.it/2.mp3 &> /dev/null'")
domoticz.notify('WebRadio','Rai Radio 2 on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'IsoRadio' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://icestrexxxxxxxxi.it/6.mp3 &> /dev/null'")
domoticz.notify('WebRadio','IsoRadio on air...', domoticz.PRIORITY_NORMAL)
end
if domoticz.devices('WebRadio').state == 'UAO_Kids' then
os.execute ("killall mplayer")
io.popen ("runuser -l pi -c \'mplayer -noconsolecontrols http://nr11.newrxxxxxxxxxxxxxt:9023/stream?1587028574736 &> /dev/null'")
domoticz.notify('WebRadio','UAO Kids radio on air...', domoticz.PRIORITY_NORMAL)
end
end
domoticz.data.switchwebradio = domoticz.devices('WebRadio').state
end
}
-
- Posts: 50
- Joined: Monday 08 January 2018 2:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Contact:
Re: Listen to your favourite radios V2
Cool... With notification 

Who is online
Users browsing this forum: No registered users and 1 guest