Read the statement by Michael Teeuw here.
MagicMirror Opening after closing cycle
-
I installed the PrayerTime module. Then I wrote the reboot code. After that, the device constantly turns on and off by itself. MagicMirror message appears and closes again. Then it opens again.
edit_1 : ı delete MMM-PrayerTİme and working normally.
-
@semihbakrac I don’t know how you got there, but the npm start command is being done in the home folder, NOT in the home/MagicMirror folder
when u install a modules you do
cd ~/MagicMirror/modules git clone the_module_url cd _the_modulename if package.json is present, do npm install
the return to the MagicMirror folder
cd ~/MagicMirror
then edit the config for the module info
nano config/config.jsthen npm start
-
@sdetweil thanks
-
@semihbakrac did that fix the problem?
-
@sdetweil No. It still turns on and off 3 or 4 times at first, then the mirror opens. I didn’t install any extra modules. Only default modules are loaded.
-
@semihbakrac but you said you install Prayertime… thats extra
-
@sdetweil I delete it. But The problem persisted. It opens after opening and closing 6 or 7 times. I installed the module again but I got this error. I never experienced anything like this with my previous SD card device.
semihbakrac@raspberrypi:~/MagicMirror $ npm start > magicmirror@2.27.0 start > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [2024-05-12 18:05:06.088] [LOG] Starting MagicMirror: v2.27.0 [2024-05-12 18:05:06.206] [LOG] Loading config ... [2024-05-12 18:05:06.227] [LOG] config template file not exists, no envsubst [2024-05-12 18:05:06.248] [LOG] Loading module helpers ... [2024-05-12 18:05:06.258] [LOG] No helper found for module: alert. [2024-05-12 18:05:07.715] [LOG] Initializing new module helper ... [2024-05-12 18:05:07.718] [LOG] Module helper loaded: updatenotification [2024-05-12 18:05:07.721] [LOG] No helper found for module: clock. [2024-05-12 18:05:08.524] [LOG] Initializing new module helper ... [2024-05-12 18:05:08.527] [LOG] Module helper loaded: calendar [2024-05-12 18:05:08.531] [LOG] No helper found for module: weather. [2024-05-12 18:05:09.105] [LOG] Initializing new module helper ... [2024-05-12 18:05:09.107] [LOG] Module helper loaded: MMM-Remote-Control [2024-05-12 18:05:11.882] [ERROR] (node:22393) UnhandledPromiseRejectionWarning: Error: Cannot find module 'request' Require stack: - /home/semihbakrac/MagicMirror/modules/MMM-MyPrayerTimes/node_helper.js - /home/semihbakrac/MagicMirror/js/app.js - /home/semihbakrac/MagicMirror/js/electron.js at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15) at s._resolveFilename (node:electron/js2c/browser_init:2:115690) at Module._resolveFilename (/home/semihbakrac/MagicMirror/node_modules/module-alias/index.js:49:29) at Module._load (node:internal/modules/cjs/loader:908:27) at c._load (node:electron/js2c/node_init:2:13672) at Module.require (node:internal/modules/cjs/loader:1122:19) at require (node:internal/modules/helpers:130:18) at Object.<anonymous> (/home/semihbakrac/MagicMirror/modules/MMM-MyPrayerTimes/node_helper.js:10:17) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1311:10) at Module.load (node:internal/modules/cjs/loader:1098:32) at Module._load (node:internal/modules/cjs/loader:945:12) at c._load (node:electron/js2c/node_init:2:13672) at Module.require (node:internal/modules/cjs/loader:1122:19) at require (node:internal/modules/helpers:130:18) at loadModule (/home/semihbakrac/MagicMirror/js/app.js:183:19) (Use `electron --trace-warnings ...` to show where the warning was created) [2024-05-12 18:05:11.888] [ERROR] (node:22393) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
-
@semihbakrac said in MagicMirror Opening after closing cycle:
Error: Cannot find module ‘request’
yes, old problem, since 2.16 ( we are at 2.27, so 11 releases since then 3 years)
we removed libs that are ‘deprecated’, aka no longer supported, and no longer needed (by the base)
but many modules used OUR copy without knowing, and didn’t document it in their module files…
SO, YOU have to manually fix it.
see
https://forum.magicmirror.builders/topic/15778/fix-for-black-screen-in-2-16-and-laterfor the instructions … note there are 5 or six libs now…
so I am teaching you how to find and fix -
@sdetweil I fixed the module issue. thank you for that. I will write if the self-rebooting problem reoccurs. Great master…