Read the statement by Michael Teeuw here.
PIR Sensor for Raspbian 11
-
I’ve been searching for a solution to my issue for a few days now, but I can’t seem to find one. I am trying to implement a PIR sensor with my Magic Mirror. I’ve had my Magic Mirror since 2021, and it’s been working fine… until now. I recently upgraded to Raspbian 11 Bullseye, and I have since determined that it no longer supports ‘tvservice’ or ‘vcgencmd’. I learned that it uses ‘xrandr’ now, which resulted in a problem with the previous module I was using (EXT-Pir and EXT-Screen from https://github.com/bugsounet?tab=repositories). In an attempt to upgrade my previous modules, I have discovered that it would require implementing a couple of additional modules which I didn’t really require. I would need to install MMM-GoogleAssistant and Gateway in order to continue using these modules. Basically, I have a very simple requirement so I would prefer to use less code to accomplish this.
I found a couple of modules that used ‘xrandr’. I first installed the MMM-PIR-Sensor-Lite module (https://github.com/grenagit/MMM-PIR-Sensor-Lite), which appeared to work but, I soon discovered that it did not appear to support HDMI CEC mode. When it turned off the HDMI, I would get a “No Signal” message from my monitor. Further, if it remained in this state long enough, I would have to intervene with button pushing on the monitor in order to restore my screens. I could verify that the Magic Mirror was running by using VNC Viewer to see what was going on (ie. my monitor remained black, while VNC showed me that the Magic Mirror application was running).
So, I attempted to look for another PIR module that supports HDMI CEC but I haven’t been able to find one. I also tried Tom Hirshberger’s MMM-GPIO-Notifications, and MMM-Screen-Powersave-Notification, but that yielded the same results.
One observation that I’ve made is that I am seeing an error message on starting the Magic Mirror:
MESA-LOADER: failed to retrieve device informationBut, from what I’ve read, this may be expected as it is a reference to loading some video files related to the older drivers (I assume tvservice or vcgencmd?). Here are my version numbers:
Magic Mirror: 2.23.0
node: 17.9.0
OS: Raspbian 11 (bullseye arm)
npm: 8.5.5
Raspberry Pi 4BHere is a log from the start for my Magic Mirror:
magicmirror@2.23.0 start
DISPLAY=“${DISPLAY:=:0}” ./node_modules/.bin/electron js/electron.js[25.05.2023 13:13.46.897] [LOG] Starting MagicMirror: v2.23.0
[25.05.2023 13:13.46.904] [LOG] Loading config …
[25.05.2023 13:13.46.908] [DEBUG] config template file not exists, no envsubst
[25.05.2023 13:13.46.914] [LOG] Loading module helpers …
[25.05.2023 13:13.46.916] [LOG] No helper found for module: alert.
[25.05.2023 13:13.46.934] [LOG] Initializing new module helper …
[25.05.2023 13:13.46.935] [LOG] Module helper loaded: updatenotification
[25.05.2023 13:13.46.936] [LOG] No helper found for module: clock.
[25.05.2023 13:13.47.185] [LOG] Initializing new module helper …
[25.05.2023 13:13.47.186] [LOG] Module helper loaded: calendar
[25.05.2023 13:13.47.187] [LOG] No helper found for module: calendar_monthly.
[25.05.2023 13:13.47.190] [LOG] Initializing new module helper …
[25.05.2023 13:13.47.191] [LOG] Module helper loaded: MMM-PIR-Sensor-Lite
[25.05.2023 13:13.47.206] [LOG] Initializing new module helper …
[25.05.2023 13:13.47.207] [LOG] Module helper loaded: MMM-Weather
[25.05.2023 13:13.47.297] [LOG] Initializing new module helper …
[25.05.2023 13:13.47.297] [LOG] Module helper loaded: MMM-Tools
[25.05.2023 13:13.47.318] [LOG] Initializing new module helper …
[25.05.2023 13:13.47.318] [LOG] Module helper loaded: newsfeed
[25.05.2023 13:13.47.319] [LOG] All module helpers loaded.
[25.05.2023 13:13.47.337] [LOG] Starting server on port 8080 …
[25.05.2023 13:13.47.598] [LOG] Server started …
[25.05.2023 13:13.47.600] [LOG] Connecting socket for: updatenotification
[25.05.2023 13:13.47.601] [LOG] Starting module helper: updatenotification
[25.05.2023 13:13.47.601] [LOG] Connecting socket for: calendar
[25.05.2023 13:13.47.602] [LOG] Starting node helper for: calendar
[25.05.2023 13:13.47.603] [LOG] Connecting socket for: MMM-PIR-Sensor-Lite
[25.05.2023 13:13.47.603] [LOG] Connecting socket for: MMM-Weather
[25.05.2023 13:13.47.605] [LOG] Connecting socket for: MMM-Tools
[25.05.2023 13:13.47.609] [LOG] [Tools] MMM-Tools Version: 2.1.7
[25.05.2023 13:13.47.611] [LOG] Connecting socket for: newsfeed
[25.05.2023 13:13.47.612] [LOG] Starting node helper for: newsfeed
[25.05.2023 13:13.47.613] [LOG] Sockets connected & modules started …
[25.05.2023 13:13.47.648] [LOG] Launching application.
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/arm-linux-gnueabihf/dri:$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/arm-linux-gnueabihf/dri:$${ORIGIN}/dri:/usr/lib/dri)
failed to load swrast driver
[25.05.2023 13:13.51.006] [LOG] Create new calendarfetcher for url: http://www.calendarlabs.com/ical-calendar/ics/39/Canada_Holidays.ics - Interval: 30000
[25.05.2023 13:13.51.164] [LOG] Create new newsfetcher for url: https://rss.cbc.ca/lineup/canada.xml - Interval: 300000
[25.05.2023 13:13.51.172] [LOG] Create new newsfetcher for url: https://rss.cbc.ca/lineup/canada-toronto.xml - Interval: 300000
[25.05.2023 13:13.51.180] [LOG] Create new newsfetcher for url: https://rss.cbc.ca/lineup/sports-nhl.xml - Interval: 300000
[25.05.2023 13:13.51.186] [LOG] [WEATHER] MMM-WEATHER Version: 1.0.6
[25.05.2023 13:13.51.194] [INFO] Checking git for module: calendar_monthly
[25.05.2023 13:13.51.256] [INFO] Checking git for module: MMM-PIR-Sensor-Lite
[25.05.2023 13:13.51.298] [INFO] Checking git for module: MMM-Weather
[25.05.2023 13:13.51.393] [INFO] Checking git for module: MMM-Tools
[25.05.2023 13:13.51.475] [INFO] Checking git for module: MagicMirror
[25.05.2023 13:13.52.967] [INFO] Calendar-Fetcher: Broadcasting 119 events.
[25.05.2023 13:13.53.297] [INFO] Newsfeed-Fetcher: Broadcasting 20 items.
[25.05.2023 13:13.53.549] [INFO] Calendar-Fetcher: Broadcasting 8 events.
[25.05.2023 13:13.59.798] [INFO] Newsfeed-Fetcher: Broadcasting 20 items.
[25.05.2023 13:13.59.904] [INFO] Newsfeed-Fetcher: Broadcasting 30 items.Most of the solutions that I’ve found were created years ago and they will not work with the latest version of the OS. And the newer ones don’t seem to provide a solution for HDMI CEC control.
So my question is, “Is there a PIR sensor module that works with Raspbian 11 and supports HDMI CEC?”. Thanks in advance.
-
@Freddy_boy said in PIR Sensor for Raspbian 11:
MESA-LOADER: failed to retrieve device information
that is a gpu driver problem,
in the script that starts MM add
export ELECTRION_DISABLE_GPU=1
before the line that does npm start
-
@Freddy_boy you have to manually install the cecclient
-
Yes, I saw that suggestion to disable the GPU driver, and I have implemented it in my shell script (/home/pi/mm.sh). I was just wondering if it was ok, or am I just masking a real problem…
I also have installed the HDMI CEC client previously. However, when I attempt to run the command to identify the device, I don’t get any results.
pi@raspberrypi:~/MagicMirror $ echo ‘scan’ | cec-client -s -d 1
opening a connection to the CEC adapter…
ERROR: [ 656] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 656] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 942] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 942] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
requesting CEC bus information …
ERROR: [ 1800] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1800] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1800] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1800] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
CEC bus information===================
device #1: Recorder 1
address: 1.0.0.0
active source: no
vendor: Pulse Eight
osd string: CECTester
CEC version: 1.4
power status: on
language: engcurrently active source: unknown (-1)
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1801] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1802] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1802] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1802] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
ERROR: [ 1802] CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=00 errno=64
pi@raspberrypi:~/MagicMirror $ -
-
solution posted here:
https://forum.magicmirror.builders/topic/17813/mmm-pir-sensor-lite-modification/22