Read the statement by Michael Teeuw here.
MMM-MplayerRadio
-
@wishmaster270 Now if I put this in the config file:
{ module: "MMM-MplayerRadio", header: "Radio", position: "top_center", config: { customCommand: "", customCommandArgs: ["", "", ""], stations: [ { title: "KissFM", url: "", logo: "https://upload.wikimedia.org/wikipedia/ro/8/86/Logo_Kiss_FM.png", customCommand: "/home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/KissFM.sh", customCommandArgs: ["", "", ""], }, ], }, },
and this in KissFM.sh
#!/bin/bash xmms2 stop xmms2 clear xmms2 add https://live.kissfm.ro/kissfm.aacp xmms2 play
it’s working when i want to start radio but nothing happens when i touch the stop button just a short flickering of your module(I use a 10" touchescreen).
Thank you. -
Hi,
as i wrote in the documentation you need to make sure that your script runs as long as the station is active and needs to stop the playback if it gets a kill signal.
Maybe i will find a short tutorial about catching the kill signal. -
If you change your script to (playRadio.bash):
#!/bin/bash URL=$1 RUN=1 exit_script() { echo "Stopping playback" xmms2 stop xmms2 clear RUN=0 } trap exit_script SIGINT SIGTERM xmms2 stop xmms2 clear xmms2 add $URL xmms2 play while [ $RUN -gt 0 ]; do echo "Still running" sleep 1 done
and the config to
{ module: "MMM-MplayerRadio", header: "Radio", position: "top_center", config: { stations: [ { title: "KissFM", url: "https://live.kissfm.ro/kissfm.aacp", logo: "https://upload.wikimedia.org/wikipedia/ro/8/86/Logo_Kiss_FM.png", customCommand: "/home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/playRadio.bash", customCommandArgs: ["###URL###"], }, ], }, },
You can then reuse the same script for different stations only by adding the url as first parameter in the config
Edit: Added url back to the config
-
@wishmaster270 it’s working now thanks.
-
@electros Perfect.
I think I will check in the script into the repository so you can easy update to upcoming versions -
@wishmaster270 Thank you
-
@wishmaster270 Hi, I’m newbie and know almost nothing about coding. I have installed your module successfully, but what should I do to start it (without touchscreen)? It is shown on my mirror but not played. I put only one Station.
I want to start it automatically if I start my mirror.
Thanks. -
@bryan_1 Hi, currently there is no autoplay feature implemented. But I will check it the next days. Maybe it is not a big deal
-
Hi,
just published an new version (0.0.3) which provides an autoplay feature. Simply add the station index you want to play to the config option “autoplay”. If you only configured one station it is 0. The station will start to play after about 1 second after the mirror started.
-
hi @wishmaster270 ,
if you want me to create a vocal control with MMM-GoogleAssistant, just tell me.
I can create a special sub-code for your modulecan do:
- volume control (no api found)
- change stations (next/previous/play/toogle,etc) from your api