I attempted to run the CEC commands manually, but that doesn’t work. I just keep getting active source unknown error message. Unfortunately, I don’t have the original EXT-Screen module because I attempted to perform an update on the module, so I only have the updated module. Perhaps the updated module has updated code? But I don’t know where to look for the required commands. I’ve looked at the EXT-Screen.js file and the node_helper.js file and I don’t see anything that looks like a CEC command. Also, the files are difficult to view, as the entire code is written on a single line, so you need to search for text strings to find anything.
Read the statement by Michael Teeuw here.
Posts made by Freddy_boy
-
RE: MMM-PIR-Sensor-Lite modification
-
RE: MMM-PIR-Sensor-Lite modification
Ok. I think I understand the strategy here. I will just need to figure out the proper HDMI CEC code that I need. Thanks. I’ll let you know how things progress…
-
MMM-PIR-Sensor-Lite modification
Re: PIR problem
I have also been experiencing similar problems with my PIR sensor since upgrading to Bullseye. After trying numerous modules, I inquired about suggestions for updated modules that have been known to work with Bullseye and posted a request in the forum (https://forum.magicmirror.builders/topic/17810/pir-sensor-for-raspbian-11). It seems that many have chosen to go with the MMM-PIR-Sensor-Lite module, so I will pose my question here.
My PIR sensor appears to function properly and after the standby timeout, the HDMI output will turn off (I am using the ‘xrandr’ command type). However, this results in my monitor detecting a missing signal and it will put up a “No Signal” indication on the screen. Further, after a certain time, it will turn the monitor OFF, which requires that I need to push buttons in order to turn it back on again. My understanding is that I need to use HDMI CEC commands in order to instruct the monitor to turn off, which will prevent the “No Signal” indication from appearing. This was a completely working feature in my Magic Mirror prior to upgrading to Bullseye.
I used the EXT-Pir and EXT-Screen modules (https://wiki.bugsounet.fr/) in the past and they were able to accomplish the task. However, I don’t have enough skill to examine the code to determine how the commands are being sent to turn off my monitor. The EXT-Screen module simply required that I choose a mode (mode:4 - use HDMI CEC) in the configuration and it successfully controlled the monitor. What I would need is to have these commands implemented in a PIR sensor module, or I would need some guidance on how to implement these codes in the MMM-PIR-Sensor-Lite module.
Any insight you might have would be appreciated…
-
RE: PIR Sensor for Raspbian 11
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 $ -
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.
-
RE: New PIR sensor problem
@mz-ber
Yes, that did it! I didn’t install the EXT-Pir module. Fixed. Thanks very much! -
New PIR sensor problem
I just noticed that my PIR sensor (MMM-NewPIR from bugsounet) stopped working and I got a notification that this module has reached end-of-life. I have been using this module for quite awhile now, and have been happy with the performance. It was simple and reliable. I decided to install the older EXT-Screen module from bugsounet.
Everything appears to install ok, but now I cannot get my PIR sensor to work. I normally see the countdown timer begin at 2 minutes and it will countdown. Any detected movement will reset the clock to 2 minutes again. Here is my old configuration:
// {
// module: ‘MMM-NewPIR’,
// position: ‘bottom_left’,
// configDeepMerge: true,
// config: {
// screen: {
// delay: 2 * 60 * 1000,
// mode: 4,
// text: “Auto Turn Off”,
// displayLastPresence: false
// },
// pir: {
// gpio: 21
// },
// }
// },and here is the new configuration:
{
module: ‘EXT-Screen’,
position: ‘bottom_left’,
configDeepMerge: true,
config: {
screen: {
delay: 2 * 60 * 1000,
mode: 4,
displayStyle: “Text”,
displayLastPresence: false,
gpio: 21
},
}
},The parameters are pretty much identical, so I cannot determine why the sensor is not being recognized. My PIR sensor is wired with an LED, so that whenever it senses movement, the LED will light up. That works still.
However, when I observe the countdown timer, it does not reset to the 2 minute countdown now. It just simply counts down from 2 minutes and turns off the monitor. So, it is acting as if the sensor is not even present (but I have not changed any wiring, and the LED is still working on it). I know that there may be a suggestion to move the sensor GPIO pin, but I don’t understand why that would make a difference, if it has been working properly for months on GPIO 21.
Please let me know if you have any ideas. Thanks.