• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

PIR problem RPi 4B, Bullseye 64 bit

Scheduled Pinned Locked Moved Unsolved Troubleshooting
23 Posts 3 Posters 3.5k Views 3 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.
  • W Offline
    wyovino
    last edited by Jul 6, 2023, 2:44 AM

    I have a python program that turns the monitor off and on. It works, but not when Magic Mirror is running. I’ve tried every trick I’ve found but nothing works. I’m using “sudo xrandr --output HDMI-2 --off” to turn it off and “sudo xrandr --output HDMI-2 --auto” to turn it on. Tvservice doesn’t work in Bullseye.

    Interestingly, if I stop Magic Mirror with “pm2 stop mm” from an ssh session, start my python program, and then restart Magic Mirror (“pm2 start mm”) the PIR program works as expected.

    Where is MagicMirror started and is there a way to insert my program start command before MM starts? Starting my program in crontab @reboot doesn’t work.

    S 2 Replies Last reply Jul 6, 2023, 2:47 AM Reply Quote 0
    • S Away
      sdetweil @wyovino
      last edited by Jul 6, 2023, 2:47 AM

      @wyovino pm2 launches a script in the
      MagicMirror/installers/mm.sh

      pm2 info (the pm2 app name, as shown by pm2 status)

      for example
      pm2 info MagicMirror
      or
      pm2 info 0 (if its the 1st created app in the list)

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      W 1 Reply Last reply Jul 6, 2023, 3:18 AM Reply Quote 0
      • S Away
        sdetweil @wyovino
        last edited by Jul 6, 2023, 3:13 AM

        @wyovino sorry, I hit reject by accident, please resubmit

        are you using pm2? or the manual install startup process editing a service?

        did you use my install script? or the manual install?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        W 1 Reply Last reply Jul 6, 2023, 3:25 AM Reply Quote 0
        • W Offline
          wyovino @sdetweil
          last edited by Jul 6, 2023, 3:18 AM

          @sdetweil I don’t know why but my previous reply was rejected. I added my script to the mm.sh script but I believe that is legacy code that doesn’t get executed. This is the first line of that file:" # This file is still here to keep PM2 working on older installations."

          Any suggestions would be appreciated.

          S 1 Reply Last reply Jul 6, 2023, 3:21 AM Reply Quote 0
          • S Away
            sdetweil @wyovino
            last edited by Jul 6, 2023, 3:21 AM

            @wyovino see my previous reply, I hit reject accidentally. ( I review all posts for members with reputation below 2, to keep out all the scammers, and porn posts)

            anyhow, my install script uses that file with pm2 to launch MM.

            so, as you are using mm as the name, the file is

            ~/MagicMirror/mm.sh

            again, pm2 status

            will show you the apps managed
            pm2 info (the name or line number) will show you the detail, including the name of the thing launched

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • W Offline
              wyovino @sdetweil
              last edited by Jul 6, 2023, 3:25 AM

              @sdetweil I followed the instructions for the manual install and I’m using pm2. MagicMirror is working as expected, but I just can’t get my python script which stops and starts the monitor based on input from a PIR sensor to work unless I stop Magic Mirror, start my program, and then restart MagicMirror.

              At this point I’m thinking of starting from scratch with the previous version of Raspberry Pi OS (Buster) which I believe works with a PIR module for Magic Mirror. That uses TVservice which does not work with Bullseye.

              S 1 Reply Last reply Jul 6, 2023, 3:26 AM Reply Quote 0
              • S Away
                sdetweil @wyovino
                last edited by Jul 6, 2023, 3:26 AM

                @wyovino

                show me the output of

                pm2 status

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                W 1 Reply Last reply Jul 6, 2023, 3:31 AM Reply Quote 0
                • W Offline
                  wyovino @sdetweil
                  last edited by sdetweil Jul 6, 2023, 3:32 AM Jul 6, 2023, 3:31 AM

                  @sdetweil
                  $ pm2 status

                  │ id │ name  │ mode     │ ↺   │ status    │ cpu     │ memory   
                  │ 0  │ mm    │ fork     │ 0   │ online    │ 0%       │ 2.8mb
                  
                  S 1 Reply Last reply Jul 6, 2023, 3:33 AM Reply Quote 0
                  • S Away
                    sdetweil @wyovino
                    last edited by sdetweil Jul 6, 2023, 3:34 AM Jul 6, 2023, 3:33 AM

                    @wyovino said in PIR problem RPi 4B, Bullseye 64 bit:

                    │ 0 │ mm

                    so the managed app name is mm
                    and the managed app number is 0

                    so, now, show me the output of pm2 info 0, or pm2 info mm

                    
                    from my system
                    (base) sam@sams:~/MagicMirror$ pm2 info 1
                     Describing process with id 1 - name MagicMirror 
                    ┌───────────────────┬───────────────────────────────────────────┐
                    │ status            │ stopped                                   │
                    │ name              │ MagicMirror                               │
                    │ namespace         │ default                                   │
                    │ version           │ 2.15.0                                    │
                    │ restarts          │ 27                                        │
                    │ uptime            │ 0                                         │
                    │ script path       │ /home/sam/MagicMirror/installers/mm.sh 
                    ..
                    

                    particularly the script path

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    W 1 Reply Last reply Jul 6, 2023, 3:56 AM Reply Quote 0
                    • S Away
                      sdetweil
                      last edited by Jul 6, 2023, 3:48 AM

                      headed to bed, will look in in the morning

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 1 / 3
                      1 / 3
                      • First post
                        7/23
                        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