Read the statement by Michael Teeuw here.
PIR problem RPi 4B, Bullseye 64 bit
-
@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 -
@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.
-
-
@sdetweil
$ pm2 status│ id │ name │ mode │ ↺ │ status │ cpu │ memory │ 0 │ mm │ fork │ 0 │ online │ 0% │ 2.8mb
-
@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 0so, 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
-
headed to bed, will look in in the morning
-
@sdetweil pm2 info mm
Describing process with id 0 - name mm │ status │ online │ │ name │ mm │ │ namespace │ default │ │ version │ N/A │ │ restarts │ 0 │ │ uptime │ 29m │ │ script path │ /home/pi/mm.sh │ │ script args │ N/A │ │ error log path │ /home/pi/.pm2/logs/mm-error.log │ │ out log path │ /home/pi/.pm2/logs/mm-out.log │ │ pid path │ /home/pi/.pm2/pids/mm-0.pid │ │ interpreter │ bash │ │ interpreter args │ N/A │ │ script id │ 0 │ │ exec cwd │ /home/pi │ │ exec mode │ fork_mode │ │ node.js version │ N/A │ │ node env │ N/A │ │ watch & reload │ ✘ │ │ unstable restarts │ 0 │ │ created at │ 2023-06-28T02:47:15.904Z
I tried putting the command in /home/pi/mm.sh but it’s not working.
-
@wyovino maybe python needs some path info, env setup
-
@sdetweil It’s running the program but the commands to control the monitor are ignored, The program is logging the activity. Here is the scenario that works:
Boot the Pi
Connect via SSH and issue command “pm2 stop mm”
Connect directly to the Pi using a connected keyboard and start my PIR program, then enter “pm2 start mm”This works but is obviously inconvenient as I need to have a keyboard connected to the Magic Mirror. I’m going to see if I can run my program from crontab under the “pi” account. Maybe that’s the issue.
-
@wyovino what do the pm2 logs show?
stop mm via pm2
pm2 stop all
pm2 flush – clear old logspm2 start 0
pm2 logs --lines=50