MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Online Radio

    Scheduled Pinned Locked Moved Entertainment
    52 Posts 4 Posters 25.4k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wishmaster270W Offline
      wishmaster270 Module Developer @tanvir586
      last edited by

      @tanvir586 Great if I could help.
      I am not sure how vlc will handle a connection loss. Normally it will try to reconnect but I do not know how long and often it tries.
      Maybe there is a command line option but I think the best option is to try it

      T 3 Replies Last reply Reply Quote 0
      • T Offline
        tanvir586 @wishmaster270
        last edited by

        @wishmaster270 ok. Will try and let you know. Really appreciated. Thanks 😊

        1 Reply Last reply Reply Quote 0
        • T Offline
          tanvir586 @wishmaster270
          last edited by

          @wishmaster270 Hi. Ive just checked it doesn’t go online after radio came back online. the link I gave you before that is 24 hour’s radio. But I used this link https://relay.emasjidlive.uk/kingsheathmasjid

          but it didn’t work. the channel went offline at 4.30pm uk time and came back online at 6.00pm. I pressed stop button and press play and it start working.

          1 Reply Last reply Reply Quote 0
          • T Offline
            tanvir586 @wishmaster270
            last edited by

            @wishmaster270 is there any command I can use for auto reconnect?

            wishmaster270W 1 Reply Last reply Reply Quote 0
            • wishmaster270W Offline
              wishmaster270 Module Developer @tanvir586
              last edited by

              @tanvir586 Sorry, needed a moment to figure things out…

              You can try to add “–http-reconnect” and maybe “–http-continuous” to the options.

              Your config should look something like this then:

              
              
                     {
              		module: "MMM-MplayerRadio",
              		header: "Radio",
              		position: "top_center",
              		config: {
              			//autoplay: 0,
                                      customCommand: "/usr/bin/vlc",
                                      customCommandArgs: ["-I","dummy", "--http-reconnect", "--http-continuous", "###URL###"],
              			stations: [
              				{
              					title: "Al Mubarak",
              					url: "https://relay.emasjidlive.uk/almubarakradio",
              					logo: "https://upload.wikimedia.org/wikipedia/commons/a/ac/Antenne-bayern-logo.png",
              				},
              			],
              		},
              	},
              
              
              T 2 Replies Last reply Reply Quote 0
              • T Offline
                tanvir586 @wishmaster270
                last edited by

                @wishmaster270 thanks mate. I’ll try today.

                1 Reply Last reply Reply Quote 0
                • T Offline
                  tanvir586 @wishmaster270
                  last edited by

                  @wishmaster270 It didn’t work. it do work when I press stop and play agian.

                  config ;-

                  		{
                  	module: "MMM-MplayerRadio",
                  	header: "Radio",
                  	position: "top_center",
                  	config: {
                  		autoplay: 0,
                                      customCommand: "/usr/bin/vlc",
                                      customCommandArgs: ["-I","dummy", "--http-reconnect", "--http-continuous", "###URL###"],
                  		stations: [
                  			{
                  				title: "Al Mubarak",
                  				url: "https://relay.emasjidlive.uk/kingsheathmasjid",
                  				logo: "https://upload.wikimedia.org/wikipedia/commons/a/ac/Antenne-bayern-logo.png",
                  			},
                  		],
                  	},
                  },
                  
                  wishmaster270W 2 Replies Last reply Reply Quote 0
                  • wishmaster270W Offline
                    wishmaster270 Module Developer @tanvir586
                    last edited by

                    @tanvir586 I will try to dig deeper the next days but I can not promise that I will have the time.
                    Maybe I can write a simple wrapper for vlc which ends the process when the streams stops or is unreachable and tries to start the process every few seconds.
                    Did not find any better solution til now.

                    1 Reply Last reply Reply Quote 0
                    • wishmaster270W Offline
                      wishmaster270 Module Developer @tanvir586
                      last edited by

                      @tanvir586
                      I release a new version of MMM-MplayerRadio (0.0.10) a few minutes ago which contains a new script called “streamlinkWrapper.bash” script. This script uses the streamlink tool to wrap the stream and restarts it if the connection gets lost.
                      You will find a example configuration in the examples directory for streamlinkWrapper which contains the configuration needed for your case.

                      Make sure to install streamlink:

                      sudo apt -y update && sudo apt -y install streamlink
                      
                      T 2 Replies Last reply Reply Quote 1
                      • T Offline
                        tanvir586 @wishmaster270
                        last edited by tanvir586

                        @wishmaster270 Thank you so much mate. Even if it’s doesn’t work for me I’m still happy that you made this effort for me. I’ll install the latest version today and will install streamlink

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          tanvir586 @wishmaster270
                          last edited by

                          @wishmaster270 Just updated. Think I’m doing it right. First I’ve installed the streamlink. And then I went to the MMM-MplayerRadio folder and execute git pull.
                          I was bit confused about the streamlink. Didn’t understand where to install it , on the MMM-MplayerRadio folder or just normal installation. Finally I installed normally. Hope I’m doing it right.

                          wishmaster270W 1 Reply Last reply Reply Quote 0
                          • wishmaster270W Offline
                            wishmaster270 Module Developer @tanvir586
                            last edited by

                            @tanvir586
                            Normal installation is the right thing. If you got sound with the new configuration everything is fine.
                            Hope the disconnect will be recognized correctly and your stream restarts now.

                            T 1 Reply Last reply Reply Quote 0
                            • T Offline
                              tanvir586 @wishmaster270
                              last edited by

                              @wishmaster270 I’m not getting any sound.
                              config is right?

                              	{
                              		module: "MMM-MplayerRadio",
                              		header: "Radio",
                              		position: "top_center",
                              		config: {
                              			stations: [
                              				{
                              					title: "Almubarak",
                              					url: "https://relay.emasjidlive.uk/almubarakradio",
                              					logo: "https://almubarakradio.com/wp-content/uploads/2021/04/logorectangle-1024x326.png",
                              					customCommand: "/home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/streamlinkWrapper.bash",
                              					customCommandArgs: ["10", "30", "###URL###"],
                              				},
                              			],
                              		},
                              	},
                              

                              I added this line aswell
                              customCommandArgs: [“-I”,“dummy”, “–http-reconnect”, “–http-continuous”, “###URL###”],

                              but didn’t work

                              T 1 Reply Last reply Reply Quote 0
                              • T Offline
                                tanvir586 @tanvir586
                                last edited by

                                @tanvir586 If I used this config then the sound works but open vlc in separate windows

                                {
                                	module: "MMM-MplayerRadio",
                                	header: "Radio",
                                	position: "top_center",
                                	config: {
                                		stations: [
                                			{
                                				title: "Almubarak",
                                				url: "https://relay.emasjidlive.uk/almubarakradio",
                                				logo: "https://almubarakradio.com/wp-content/uploads/2021/04/logorectangle-1024x326.png",
                                

                                customCommand: “/usr/bin/vlc”,
                                customCommand: “/home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/streamlinkWrapper.bash”,
                                customCommandArgs: [“10”, “30”, “###URL###”],
                                },
                                ],
                                },
                                },

                                1 Reply Last reply Reply Quote 0
                                • T Offline
                                  tanvir586
                                  last edited by

                                  If I use this config then vlc open is separate window and it’s looks like this.

                                  	{
                                  		module: "MMM-MplayerRadio",
                                  		header: "Radio",
                                  		position: "top_center",
                                  		config: {
                                  			stations: [
                                  				{
                                  					title: "Almubarak",
                                  					url: "https://relay.livemasjid.com:8443/activestream",
                                  					logo: "https://almubarakradio.com/wp-content/uploads/2021/04/logorectangle-1024x326.png",
                                  					customCommand: "/home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/streamlinkWrapper.bash",
                                  					customCommand: "/usr/bin/vlc",
                                  					customCommandArgs: ["10", "30", "###URL###"],
                                  				},
                                  			],
                                  		},
                                  	},
                                  

                                  picture ;-
                                  20221025_185152 (1).jpg

                                  wishmaster270W 1 Reply Last reply Reply Quote 0
                                  • wishmaster270W Offline
                                    wishmaster270 Module Developer @tanvir586
                                    last edited by wishmaster270

                                    @tanvir586 Sorry, i am not at my pc at the moment. You only need the first customCommand line. The one with vlc is wrong.
                                    You can try to run the run the command directly on the shell and see what happens.

                                    /home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/streamlinkWrapper.bash 10 30 https://relay.emasjidlive.uk/almubarakradio
                                    

                                    You can end it by pressing CRTL+c

                                    T 1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      tanvir586 @wishmaster270
                                      last edited by

                                      @wishmaster270 Hi, it’s says this

                                      tanvir@raspberrypi:~ $ /home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/streamlinkWrapper.bash 10 30 https://relay.emasjidlive.uk/almubarakradio
                                      bash: /home/pi/MagicMirror/modules/MMM-MplayerRadio/scripts/streamlinkWrapper.bash: No such file or directory

                                      T 1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        tanvir586 @tanvir586
                                        last edited by

                                        @tanvir586 and I installed mplayer.

                                        wishmaster270W 1 Reply Last reply Reply Quote 0
                                        • wishmaster270W Offline
                                          wishmaster270 Module Developer @tanvir586
                                          last edited by

                                          @tanvir586 Are you sure you are running the latest version of the module?
                                          The error says that the wrapper script I added yesterday does not exist.
                                          Can you please check the script folder and check if the file is executable?

                                          T 1 Reply Last reply Reply Quote 0
                                          • T Offline
                                            tanvir586 @wishmaster270
                                            last edited by

                                            @wishmaster270 I’ve updated yesterday. I’ll check again now

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 3 / 3
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy