@elleclouds Hi, do you see any output of the Gpio module in the log file?
Read the statement by Michael Teeuw here.

Posts
-
RE: PIR sensor to turn monitor off. Nothing works :(
-
RE: PIR sensor to turn monitor off. Nothing works :(
-
RE: PIR sensor to turn monitor off. Nothing works :(
Hi,
i recently wrote a tutorial of how to use two of my modules to turn on/off the display with an PIR sensor.
I do not have much time to support at the moment but maybe it helps…
-
RE: MMM-MplayerRadio
@electros Perfect.
I think I will check in the script into the repository so you can easy update to upcoming versions -
RE: MMM-MplayerRadio
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
-
RE: MMM-MplayerRadio
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. -
RE: MMM-MplayerRadio
It pushed a new development version to the repo.
You can change to it if you do the following commands:cd ~/MagicMirror/modules/MMM-MplayerRadio git checkout development git pull
In the new version you can add “customCommand” and “customCommandArgs” to either the whole module or to every station.
You then can use any script you like to play either all stations (by passing the url to it) or a special script for each station.Example:
{ module: "MMM-MplayerRadio", header: "Radio", position: "top_center", config: { customCommand: "/home/pi/doSomething.bash", customCommandArgs: ["one", "two", "###URL###"], stations: [ { title: "Antenne.de", url: "http://www.surfmusik.de/m3u/antenne-bayern,922.m3u", logo: "https://upload.wikimedia.org/wikipedia/commons/a/ac/Antenne-bayern-logo.png", customCommand: "/home/pi/doSomethingElse.bash", customCommandArgs: ["one", "###URL###", "three"], }, ], }, },
In this example for all stations the script “/home/pi/doSomething.bash one two http://…” is called.
But “Antenne.de” uses the script “/home/pi/doSomethingElse.bash” with different args.The only condition the customCommand-Script needs to meet is that it stays active as long as the station is running and stops the playback if it gets killed.
-
RE: MMM-MplayerRadio
Hi,
my problem is that i messed up my audio configuration as i tried to configure pulseaudio to make it possible to play music either on my local HifiBerry speakers or on a bluetooth speaker.
Mplayer still works fine but i can`t get any sound from xmms2.
The other problem is that there are a lot of known problems of xmms2 but xmms2 is dead since 2017.
Thats why i tried omxplayer which is still maintained.Currently the module supports local playlist files but not calling any other player. You can change the binary that is called but it still sets the args as mplayer will need it.
-
RE: MMM-MplayerRadio
Hi,
gave it a new try today. But i can`t get xmms2 to run on my pi. Looks like the xmms alsa plugin has some problems with my HifiBerry.
Also tried omxplayer but it has problems with internet streams. -
RE: MMM-MplayerRadio
@electros
mplayer -cache 256 -playlist PLAYLISTFILEI will try to reduce the flickering but I don’t think this will stop the problem of your stations not being played.
I spent the last hour to read more about Xmms2. I don’t think that I can implement an easy way to switch between the two players. One of the main problems is that Xmms2 does not provide the current stream info of the station.