Tom-Hirschberger / MMM-MplayerRadio

An MagicMirror² module which playes m3u radio playlists with MPlayer and supports various stations to rotate through
MIT License
7 stars 0 forks source link

MM is not loading page when MMM-Mplayerradio is included in config.js #13

Closed joachim-albers closed 3 years ago

joachim-albers commented 3 years ago

Hi, I use MMM-MplayerRadio with vlc and MMM-Volume. Whenever I include the module MMM-MplayerRadio in the config.js, the page of MM is loading as black screen and no modules are displayed. The mm-out.log does not show any error. What I can see is: [27.06.2021 18:52.08.075] [LOG] MMM-MplayerRadio: Received notification CONFIG [27.06.2021 18:52.08.197] [LOG] [VOLUME] Set Volume To: 50

config.js: { module: "MMM-Volume", classes: "always", position: "top_left", // It is meaningless. but you should set. config: { usePresetScript: null, getVolumeScript: amixer sget 'Master' | awk -F"[][]" '{print ""$2""}' | grep % | awk '{gsub ( /%/, "" ) ; print}', setVolumeScript: amixer sset -M 'Master' #VOLUME#%, volumeOnStart: 50, } }, { module: "MMM-MplayerRadio", classes: "always", header: "Radio", position: "top_left", config: { customCommand: "/usr/bin/vlc", customCommandArgs: ["-I", "dummy", "###URL###"], //autoplay: 0, stations: [ { title: "NDR Info - SH", url: "https://www.ndr.de/resources/metadaten/audio/m3u/ndrinfo_sh.m3u", logo: "https://upload.wikimedia.org/wikipedia/commons/a/a1/NDR_Info_Logo_2019.svg", }, ], displayStationsOnStartup: true },

Do you have any idea/help/hint for me?

Thanks a lot, Joachim

Tom-Hirschberger commented 3 years ago

Hi,

great if you want to use my module. I do not know if you copied one line short from your config.js but at the end there is "}," missing. To me it looks like you want to use MMM-Volume in the PULSE setup. Instead of defining the configuration strings by your self you can use the build-in ones. You may want to comment out the MMM-Volume configuration and try to run the mirror with only MMM-MplayerRadio configured to check which configuration part causes the issues. Please use three backtics if you insert code or configuration parts to github. My suggested configuration would be:

{
    module: "MMM-Volume",
    classes: "always",
    position: "top_left", // It is meaningless. but you should set.
    config: {
        usePresetScript: "PULSE",
        volumeOnStart: 50,
    }
},
{
    module: "MMM-MplayerRadio",
    classes: "always",
    header: "Radio",
    position: "top_left",
    config: {
        customCommand: "/usr/bin/vlc",
        customCommandArgs: ["-I", "dummy", "###URL###"],
        //autoplay: 0,
        stations: [
            {
                title: "NDR Info - SH",
                url: "https://www.ndr.de/resources/metadaten/audio/m3u/ndrinfo_sh.m3u",
                logo: "https://upload.wikimedia.org/wikipedia/commons/a/a1/NDR_Info_Logo_2019.svg",
            },
        ],
        displayStationsOnStartup: true
    },
},
joachim-albers commented 3 years ago

Hi Tom, thanks for your help so far. I have reduced my config.js so that only two modules are used namely


    {
        module: "MMM-MplayerRadio",
        classes: "always",
        header: "Radio",
        position: "top_left",
        config: {
            customCommand: "/usr/bin/vlc",
            customCommandArgs: ["-I", "dummy", "###URL###"],
            //autoplay: 0,
            stations: [
                {
                    title: "NDR Info - SH",
                    url: "https://www.ndr.de/resources/metadaten/audio/m3u/ndrinfo_sh.m3u",
                    logo: "https://upload.wikimedia.org/wikipedia/commons/a/a1/NDR_Info_Logo_2019.svg",
                },
            ],
            displayStationsOnStartup: true
        },
    },
    {
        module: "helloworld",
        classes: "always",
        position: "top_left",   // This can be any of the regions.
        config: {
            // See 'Configuration options' for more information.
            text: "Test"
        }
    },

Still when MM is restarted it shows nothing. When I outcomment the Mplayer module, it shows the text of the helloworld module.

From the mm-out.log: `

magicmirror@2.15.0 start /home/pi/MagicMirror DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js

[28.06.2021 10:09.11.420] [LOG] Starting MagicMirror: v2.15.0 [28.06.2021 10:09.11.428] [LOG] Loading config ... [28.06.2021 10:09.11.437] [LOG] Loading module helpers ... [28.06.2021 10:09.11.454] [LOG] Initializing new module helper ... [28.06.2021 10:09.11.457] [LOG] Module helper loaded: MMM-MplayerRadio [28.06.2021 10:09.11.461] [LOG] No helper found for module: helloworld. [28.06.2021 10:09.11.464] [LOG] All module helpers loaded. [28.06.2021 10:09.11.583] [LOG] Starting server on port 8080 ... [28.06.2021 10:09.11.600] [LOG] Server started ... [28.06.2021 10:09.11.603] [LOG] Connecting socket for: MMM-MplayerRadio [28.06.2021 10:09.11.606] [LOG] Sockets connected & modules started ... [28.06.2021 10:09.11.879] [LOG] Launching application. [28.06.2021 10:09.13.501] [LOG] MMM-MplayerRadio: Received notification CONFIG `

I appreciate any further hint you have.

Thanks, Joachim

Tom-Hirschberger commented 3 years ago

Hi,

i found the problem. It is a bug which is only caused if less than two stations are used. I need a moment but will provide a bugfix release in the next hours.

Tom-Hirschberger commented 3 years ago

Fixed in 0.0.7. Your config now should work as expected. Please use

git pull

in the module folder to update.

joachim-albers commented 3 years ago

It works!

Thank you so much for your help and your fantastic module.

All the best, Joachim

Tom-Hirschberger commented 3 years ago

Perfect. Have a lot of fun with the module. It is great to see that I am not the only one using it.