MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. evroom
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 2
    • Topics 18
    • Posts 494
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: cron job hdmi on and off

      @Sam-0

      You only had to change the 1 into a 0.
      Not to move the lines around, especially not the ones with export.

      #!/bin/bash
      export WAYLAND_DISPLAY=wayland-0
      export XDG_RUNTIME_DIR=/run/user/1000
      wir-randr --output HDMI-A-1 --on
      

      But you are slowly getting there :-)
      Wax on, wax off
      Screen on, screen off.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: cron job hdmi on and off

      @Sam-0 said in cron job hdmi on and off:

      @evroom

      should it be modified in this way?

      output HDMI-A-1 --on
      Into
      output HDMI-A-0 --on

      No, like this:

      export WAYLAND_DISPLAY=wayland-0

      In both scripts.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: cron job hdmi on and off

      @Sam-0

      So as stated before you most probably need to change wayland-1 to wayland-0 in your scripts.
      Give it a try.
      Furthermore the .lock file may cause a problem, but I guess this will show in your error log.
      And temporarily change the times in your cronjob to speed things up a bit.
      Waiting till ten and midnight is not really necessary :-)

      posted in Troubleshooting
      evroomE
      evroom
    • RE: cron job hdmi on and off

      @Sam-0

      In de laatste 2 regels mist een spatie bij /home.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: cron job hdmi on and off

      @Sam-0

      So it seems that the cronjob is okay.

      Can you do:
      ˋˋˋls -als /run/user/1000/wayland*ˋˋˋ

      I think you need wayland-0 iso wayland-1.

      With ˋˋˋ grep username /etc/passwdˋˋˋ (use your username) you can verify that your user has uid 1000.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: cron job hdmi on and off

      @Sam-0 said in cron job hdmi on and off:

      i created two files
      off.sh and on.sh
      they contain the following lines

      wlr-randr --output HDMI-A-1 --off
      wlr-randr --output HDMI-A-1 --on

      Do you have #!/bin/bash or #!/bin/sh at the very beginning of your shell scripts ?

      #! /bin/sh – Execute the file using the Bourne shell, or a compatible shell, assumed to be in the /bin directory
      #! /bin/bash – Execute the file using the Bash shell

      You can also put /bin/bash in the crontab entry (before /home/username/...).
      Then there is no way for cron to not execute it as a shell script and it will even run without the executable bit set.

      And what Sam mentioned: the scripts need to be executable but not necessarily writable (chmod 755).
      This should normally do the trick.

      If you have mail installed (which mail) you can put this at the very beginning of the crontab file:
      MAILTO=username (in my case admin).
      With
      journalctl --since "1 day ago" --unit cron.service --no-pager
      you can see if cron ran your script and with mail you can see more details on the cron job executed.

      Good luck.

      posted in Troubleshooting
      evroomE
      evroom
    • MMM-MPlayer - version 2.0.1

      Hi,

      I just published version 2.0.1 of the MMM-MPlayer module.
      Fixed some issued, added more options.

      https://github.com/evroom/MMM-MPlayer

      Please read the README carefully, especially when you are using the first version.

      If you are a user of version 1 of this module, please be aware that the configuration is slightly different and that more options are available. It is advisable to move a working version of this module before installing the new version.

      Best regards,

      E.J.

      posted in Utilities
      evroomE
      evroom
    • RE: MMM-MPlayer

      @clakkentt said in MMM-MPlayer:

      @evroom
      …
      Sorry for the delay in replying, I don’t get e-mail notices when someone replies to my posts.

      No problem.

      I discovered the reason why it happens and am busy with a new version.
      Hope to release it soon (first need to solve an issue with recalculating the window position).
      Those that are interested can have a look at the README of the dev branch.

      posted in Utilities
      evroomE
      evroom
    • RE: MMM-MPlayer - display issue

      To answer myself:

      I cleaned the array using:

          const mplayerArgumentsArrayFilter = mplayerArgumentsArray.filter(discardEmptyArgument);
          function discardEmptyArgument(value, index, array) {
            return value != '';
          }
      

      Then spawned using that array:

          // Spawn a new mplayer process
          const env = { ...process.env, DISPLAY: ':0' };
          const mplayerProcess = spawn(`mplayer`, mplayerArgumentsArrayFilter, {env: env});
      

      Now it is working correct.

      posted in Troubleshooting
      evroomE
      evroom
    • RE: MMM-MPlayer - display issue

      I found out following:

      When using

          // Spawn a new mplayer process
          const env = { ...process.env, DISPLAY: ':0' };
          const mplayerProcess = spawn(`mplayer`,
             ['-rtsp-stream-over-tcp',
              '-noborder',
              '-monitoraspect', '0',
              '-vf', 'rotate=-1',
              '-geometry', '5:225',
              '-x', '640',
              '-y', '360',
              'rtsp://axisviewer:password@192.168.178.55/axis-media/media.amp?streamprofile=ACC_Low'],
              {env: env});
      

      The stream is correct on the monitor.

      When using

          // Spawn a new mplayer process
          const env = { ...process.env, DISPLAY: ':0' };
          const mplayerProcess = spawn(`mplayer`,
             ['',
              '', '',
              '-rtsp-stream-over-tcp',
              '',
              '', '',
              '-noborder',
              '-monitoraspect', '0',
              '-vf', 'rotate=-1',
              '-geometry', '5:225',
              '-x', '640',
              '-y', '360',
              'rtsp://axisviewer:password@192.168.178.55/axis-media/media.amp?streamprofile=ACC_Low'],
              {env: env});
      

      The stream is NOT correct on the monitor (MPlayer window in the center).

      So the problem is spawning with empty parameters.
      When running it from the command line, this is not an issue, as the shell takes care of the empty places between the arguments.

      I tried with undefined and null iso ''but that does not work.

      Only idea how to solve this ?
      Cleaning the array somehow ?

      posted in Troubleshooting
      evroomE
      evroom
    • RE: MMM-MPlayer

      There is a main branch now that contains the original code.
      And a dev branch that contains the new code.
      The new code needs a different entry in the config.js.

      posted in Utilities
      evroomE
      evroom
    • RE: MMM-MPlayer

      @clakkentt said in MMM-MPlayer:

      @hrmax23
      I don’t know why but the MPlayer header show up in the latest MMM-MPlayer update, at least in my setup, it does not show up in the previous version. I upgraded and then downgraded.

      Hi, could you please sent me the output of

      $ ps -eaf | grep mplayer | grep -v grep
      

      for the version that is working?

      I am currently busy with a new version, but I messed up a bit by not using a development branch.
      Hope to have sorted that out soon.
      The new version will have a bit different configuration setting than the old one.

      Also refer to
      https://forum.magicmirror.builders/topic/19539/mmm-mplayer-display-issue
      for the issue I am facing (related to what you are seeing with the new version).

      posted in Utilities
      evroomE
      evroom
    • MMM-MPlayer - display issue

      Hi,

      I have this issue with MMM-MPlayer, that also has been reported by other users of the module.

      When using the module, the MPlayer window is seen in the middle of the screen and has a MPlayer title.

      This is what is running when using the module:

      admin@MagicPi3b:~/MagicMirror/modules/MMM-MPlayer $ ps -eaf | grep mplayer | grep -v grep
      admin 38919 38729 18 12:17 ? 00:00:01 mplayer -monitoraspect 0  -noborder -vf rotate=-1 -geometry 10:225 -xy 640 -rtsp-stream-over-tcp -vo xv,gl,gl_nosw,vdpau, -nosound rtsp://axisviewer:password@192.168.178.55/axis-media/media.amp?streamprofile=ACC_Low
      

      The value of DISPLAY is: :0

      When I run the same command like this, it is working as expected:

      admin@MagicPi3b:~/MagicMirror/modules/MMM-MPlayer $ DISPLAY=:0 mplayer -monitoraspect 0  -noborder -vf rotate=-1 -geometry 10:225 -xy 640 -rtsp-stream-over-tcp -vo xv,gl,gl_nosw,vdpau, -nosound rtsp://axisviewer:password@192.168.178.55/axis-media/media.amp?streamprofile=ACC_Low
      

      The MMM-MPlayer module uses this to start mplayer:

          const env = { ...process.env, DISPLAY: ':0' };
          const mplayerProcess = spawn(`mplayer`,
             [`${mplayerOption}`, `${mplayerOptionValue}`,
              :
              :
              `${stream}`],
              {env: env});
      

      I cannot get my finger behind this and I have no idea why this happens like this.
      Any ideas ?

      posted in Troubleshooting
      evroomE
      evroom
    • RE: MMM-MPlayer

      When I tested the module, I used a Pi 3b connected to a 4K monitor and it was working okay.
      After reading about the MPlayer window, that appears in the center, I decided to test again.
      And to my surprise I have the same issue.

      It seems that MPlayer is ignoring the window position defined by the module.

      The GUI screen resolution is set to 1920x1080 @60Hz.
      Both xrandr and wlr-randr reflect this.

      On my Pi 4b, connected to a 1600x900 monitor, I do not have this issue.

      I did do an update & upgrade of Debian before looking at the issue, so it can be that something ‘broke’ the module.
      But then again I updated both Pis and only one has this issue.

      I will try to connect the 1600x900 monitor to the Pi 3b, so see if it is a monitor thing.

      All in all very odd.

      posted in Utilities
      evroomE
      evroom
    • RE: MMM-pages - how to know which page index my module has?

      Hi, I notice some requests and other activities,here and on GitHub.
      Due to unforeseen medical issues, I do not have really time, nor the means to respond to everything
      Already happy I have some sort of Internet connection here.
      But with Sam it is in good hands, just make use of his fork.
      Greetings, E.J.

      posted in Development
      evroomE
      evroom
    • RE: MMM-pages - how to know which page index my module has?

      @sdetweil
      Short question:

      There are 2 versions of MMM-pages:

      https://github.com/edward-shen/MMM-pages
      https://github.com/sdetweil/MMM-pages

      They seem in-sync, but which one would be the preferred one to take?

      posted in Development
      evroomE
      evroom
    • RE: MMM-pages - how to know which page index my module has?

      As a workaround, I will make it a requirement to put the MMM-Player on the first page (page index 0).
      When I receive 0, then I will start streaming, otherwise I will stop streaming.
      That seems to work.

      posted in Development
      evroomE
      evroom
    • RE: MMM-pages - how to know which page index my module has?

      @sdetweil
      Yeah, this module is kind of in my foster care.
      I did not come up with the code; only made some tweaks and made it available.
      There is not suspend or resume to been seen in the code.

      But I will study the stuff you mentioned and will try to implement that.

      Thx.

      posted in Development
      evroomE
      evroom
    • MMM-pages - how to know which page index my module has?

      Hi,

      I am currently adopting MMM-MPlayer to interact with MMM-pages.
      Reason is that suspending the module does not suspend (stop) the stream, as it is an overlay.
      As long as MMM-MPlayer is running, it will always display the stream.

      From the config I can deduct the page index (3 in this case):

            modules: [
              ["compliments"], // page 1
              ["MMM-YrThen"], // page 2
              ["calendar"], // page 3
              ["MMM-MPlayer"], // page 4
            ],
      

      And I see that reflected in the log:

      0|MagicMirror  | [2025-01-18 16:13:55.383] [LOG]   [MMM-MPlayer.js:65:15] Received MMM-pages NEW_PAGE 3
      0|MagicMirror  | [2025-01-18 16:13:55.804] [LOG]   [module.js:189:7] compliments is suspended.
      0|MagicMirror  | [2025-01-18 16:13:55.835] [LOG]   [module.js:189:7] calendar is suspended.
      0|MagicMirror  | [2025-01-18 16:13:55.917] [LOG]   [module.js:189:7] MMM-YrThen is suspended.
      0|MagicMirror  | [2025-01-18 16:13:56.395] [LOG]   [module.js:196:7] clock is resumed.
      0|MagicMirror  | [2025-01-18 16:13:56.439] [LOG]   [module.js:196:7] MMM-MPlayer is resumed.
      

      But I would need to see my module name in the payload (MMM-MPlayer in this case), to act on the correct page index.

      Come to think of it, I also would need the keyword suspended or resumedin the payload, in order to know what to do.

      Any thoughts on this ?

      Best regards,

      E.J.

      posted in Development
      evroomE
      evroom
    • 1
    • 2
    • 3
    • 4
    • 5
    • 24
    • 25
    • 2 / 25