Listen to your favourite radios V2

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Gianni
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

Post by Gianni »

just tested
MP3 did not solve my problem

if i go to my terminal then it's work like that(i used without the extra parameters to see my output)

Code: Select all

gianni@xxxxxx:~ $ mplayer http://icecast.vrtcdn.be/mnm_urb-mid.mp3
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing http://icecast.vrtcdn.be/mnm_urb-mid.mp3.
Resolving icecast.vrtcdn.be for AF_INET6...

Couldn't resolve name for AF_INET6: icecast.vrtcdn.be
Resolving icecast.vrtcdn.be for AF_INET...
Connecting to server icecast.vrtcdn.be[5.79.75.39]: 80...

Name   : MNM UrbaNice | Kwaliteit**
Genre  : Urban
Public : no
Bitrate: 64kbit/s
Cache size set to 320 KBytes
Cache fill:  0.00% (0 bytes)
ICY Info: StreamTitle='';
if i run the script in domoticz my terminal get not any input
this is my selector
1.JPG
1.JPG (92.53 KiB) Viewed 2929 times
and this is my code

Code: Select all

--
-- This script play a streaming radio when the device is changed
-- Start files with "mplayer -noconsolecontrols radiostation.mp3 &> /dev/null"
-- Start playlists with "mplayer -noconsolecontrols -playlist radiostation.m3u &> /dev/null"
--
commandArray = {}

if (devicechanged['Radio'] == 'Off') then
    os.execute ("killall mplayer")
end

if (devicechanged['Radio'] == 'MNM') then
    os.execute ("mplayer -noconsolecontrols http://icecast.vrtcdn.be/mnm-mid.mp3 &> /dev/null")
end
if (devicechanged['Radio'] == 'TopRadio') then
    os.execute ("killall mplayer")
    os.execute ("mplayer -noconsolecontrols http://loadbalancing.topradio.be/topradio.mp3 &> /dev/null")
end

return commandArray
0n370uch
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

Post by 0n370uch »

Hi, please try

Code: Select all

-noconsolecontrols
Gianni
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

Post by Gianni »

you mean in my terminal?
this works.
i just try in my terminal without to see the output

if i start mplayer manual in my terminal (putty) en then i select MNM then mplayer get the quit command so that works.
The problem must be in the stream url.

Code: Select all

--
-- This script play a streaming radio when the device is changed
-- Start files with "mplayer -noconsolecontrols radiostation.mp3 &> /dev/null"
-- Start playlists with "mplayer -noconsolecontrols -playlist radiostation.m3u &> /dev/null"
--
commandArray = {}

if (devicechanged['Radio'] == 'Off') then
    os.execute ("killall mplayer")
end

if (devicechanged['Radio'] == 'MNM') then
    os.execute ("killall mplayer")
  --  os.execute ("mplayer -noconsolecontrols http://icecast.vrtcdn.be/mnm-mid.mp3 &> /dev/null")
if i try your solution no test Folder

Code: Select all

if (devicechanged['Radio'] == 'MNM') then
    os.execute ("sudo mkdir ~/test &> /dev/null")
    os.execute ("killall mplayer")
    os.execute ("sudo mplayer -noconsolecontrols http://icecast.vrtcdn.be/mnm-mid.mp3 &> /dev/null")
If i do it manual

Code: Select all

gianni@xxxx:~ $ mkdir ~/test &> /dev/null
gianni@xxxxx:~ $ ls
bluez-5.49  bluez-5.49.tar.xz  bluez-5.49.tar.xz.1  domoticz  habridge  mosquitto-repo.gpg.key  test
gianni@xxxxx:~ $
0n370uch
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

Post by 0n370uch »

I use mplayer without sudo and it works nice. Please test the command without sudo (like in your last example).

I executed this command in Fedora 28 without any problem some seconds ago:

Code: Select all

mplayer -noconsolecontrols http://icecast.vrtcdn.be/mnm-mid.mp3 &> /dev/null
Gianni
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

Post by Gianni »

yeah my fold
my script is without sudo this was just a test if it made any different.

like you say if i executed this command on my pi in putty it's works direct.

Code: Select all

mplayer -noconsolecontrols http://icecast.vrtcdn.be/mnm-mid.mp3 &> /dev/null
if i try it from within domoticz nothing happens :-)
0n370uch
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

Post by 0n370uch »

Oh one Idea. Check the main settings:
Attachments
Screenshot_2018-09-19-08-31-52-678_com.android.chrome.png
Screenshot_2018-09-19-08-31-52-678_com.android.chrome.png (317.25 KiB) Viewed 2894 times
Gianni
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

Post by Gianni »

exact the same ;-)
Knipsel.JPG
Knipsel.JPG (100.94 KiB) Viewed 2890 times
0n370uch
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

Post by 0n370uch »

Very frustrating... I cannot see any sort of configuration mistake. One last idea: check the domoticz log after switching. I hope there is an error message.
Gianni
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

Post by Gianni »

nope just a switch message :-)

Code: Select all

 2018-09-19 11:10:18.526 (Radio) Light/Switch (Radio)
2018-09-19 11:10:18.519 Status: User: Admin initiated a switch command (60/Radio/Set Level)
2018-09-19 11:10:19.968 (Radio) Light/Switch (Radio)
2018-09-19 11:10:19.960 Status: User: Admin initiated a switch command (60/Radio/Set Level)
2018-09-19 11:10:23.444 (Radio) Light/Switch (Radio)
2018-09-19 11:10:23.437 Status: User: Admin initiated a switch command (60/Radio/Set Level) 
where are the log files from domoticz self i cannot find them in my console
Knipsel.JPG
Knipsel.JPG (11.57 KiB) Viewed 2880 times
I'm not home right now but i see in my problem log the test from yesterday and i have 1 line

Code: Select all

2018-09-18 21:52:25.747 Error: EventSystem: Warning!, lua script Radio has been running for more than 10 seconds
0n370uch
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

Post by 0n370uch »

OK. No helpful message there... Sry no idea from my side at the moment.
Gianni
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

Post by Gianni »

np i have no idea 2 but thx for trying to help :-)
0n370uch
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

Post by 0n370uch »

Yeah... Tell me if you find a solution.
Gianni
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

Post by Gianni »

do you know where the log file from domoticz are in the terminal?
0n370uch
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

Post by 0n370uch »

Oh not in the terminal. Just under settings.
Gianni
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

Post by Gianni »

yeah i know but maybe there is a log with more information in the terminal
Gianni
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

Post by Gianni »

the only thing i can think about is the bluetooth driver.
how did you install your speaker?
i have to install bleuz and then pulseaudio to work but every time i reboot i need to redo this.
0n370uch
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

Post by 0n370uch »

I wrote about this on page 2. I think this is a good way... I use this way for one year.
Gianni
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

Post by Gianni »

but i use the stretch lite,so i need to preinstall the Alsa en Pulseaudio?
witch version do you use?
0n370uch
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

Post by 0n370uch »

I only use the latest version from the stock package sources.
Gianni
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

Post by Gianni »

hmm strange if i set my backup back and use the standard version without installing any other software i get this error
agent on error
power on error
etc

ps pic is from google but the same error
images.png
images.png (2.06 KiB) Viewed 3788 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests