@kayakbabe Default
Read the statement by Michael Teeuw here.
Posts
-
RE: Black Screen when news doesnt fetch
@sdetweil I understand that but why is going black screen? It can show something like network error on the screen.
-
Black Screen when news doesnt fetch
Hi, as i mentioned i got black screen when the news cant fetch due to wifi(i dont know about that).
Wifi is connected correctly i can ping and browse.- “version”: “2.24.0”,
- Node v16.20.2
- Npm 8.19.4
- Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye - RPi 3B
Here is my logs:
0|MagicMir | [05.02.2024 06:53.10.754] [ERROR] Newsfeed Error. Could not fetch newsfeed: https://t24.com.tr/rss FetchError: request to https://t24.com.tr/rss failed, reason: getaddrinfo EAI_AGAIN t24.com.tr 0|MagicMir | at ClientRequest.<anonymous> (/home/pi/MagicMirror/node_modules/node-fetch/lib/index.js:1501:11) 0|MagicMir | at ClientRequest.emit (node:events:513:28) 0|MagicMir | at TLSSocket.socketErrorListener (node:_http_client:502:9) 0|MagicMir | at TLSSocket.emit (node:events:513:28) 0|MagicMir | at emitErrorNT (node:internal/streams/destroy:151:8) 0|MagicMir | at emitErrorCloseNT (node:internal/streams/destroy:116:3) 0|MagicMir | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 0|MagicMir | type: 'system', 0|MagicMir | errno: 'EAI_AGAIN', 0|MagicMir | code: 'EAI_AGAIN' 0|MagicMir | } 0|MagicMir | [05.02.2024 07:28.12.616] [ERROR] Newsfeed Error. Could not fetch newsfeed: https://t24.com.tr/rss FetchError: request to https://t24.com.tr/rss failed, reason: getaddrinfo EAI_AGAIN t24.com.tr 0|MagicMir | at ClientRequest.<anonymous> (/home/pi/MagicMirror/node_modules/node-fetch/lib/index.js:1501:11) 0|MagicMir | at ClientRequest.emit (node:events:513:28) 0|MagicMir | at TLSSocket.socketErrorListener (node:_http_client:502:9) 0|MagicMir | at TLSSocket.emit (node:events:513:28) 0|MagicMir | at emitErrorNT (node:internal/streams/destroy:151:8) 0|MagicMir | at emitErrorCloseNT (node:internal/streams/destroy:116:3) 0|MagicMir | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 0|MagicMir | type: 'system', 0|MagicMir | errno: 'EAI_AGAIN', 0|MagicMir | code: 'EAI_AGAIN' 0|MagicMir | } 0|MagicMir | [05.02.2024 07:33.12.648] [ERROR] Newsfeed Error. Could not fetch newsfeed: https://t24.com.tr/rss FetchError: request to https://t24.com.tr/rss failed, reason: getaddrinfo EAI_AGAIN t24.com.tr 0|MagicMir | at ClientRequest.<anonymous> (/home/pi/MagicMirror/node_modules/node-fetch/lib/index.js:1501:11) 0|MagicMir | at ClientRequest.emit (node:events:513:28) 0|MagicMir | at TLSSocket.socketErrorListener (node:_http_client:502:9) 0|MagicMir | at TLSSocket.emit (node:events:513:28) 0|MagicMir | at emitErrorNT (node:internal/streams/destroy:151:8) 0|MagicMir | at emitErrorCloseNT (node:internal/streams/destroy:116:3) 0|MagicMir | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 0|MagicMir | type: 'system', 0|MagicMir | errno: 'EAI_AGAIN', 0|MagicMir | code: 'EAI_AGAIN' 0|MagicMir | } 0|MagicMir | [05.02.2024 07:43.12.993] [ERROR] Newsfeed Error. Could not fetch newsfeed: https://t24.com.tr/rss FetchError: request to https://t24.com.tr/rss failed, reason: getaddrinfo EAI_AGAIN t24.com.tr 0|MagicMir | at ClientRequest.<anonymous> (/home/pi/MagicMirror/node_modules/node-fetch/lib/index.js:1501:11) 0|MagicMir | at ClientRequest.emit (node:events:513:28) 0|MagicMir | at TLSSocket.socketErrorListener (node:_http_client:502:9) 0|MagicMir | at TLSSocket.emit (node:events:513:28) 0|MagicMir | at emitErrorNT (node:internal/streams/destroy:151:8) 0|MagicMir | at emitErrorCloseNT (node:internal/streams/destroy:116:3) 0|MagicMir | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 0|MagicMir | type: 'system', 0|MagicMir | errno: 'EAI_AGAIN', 0|MagicMir | code: 'EAI_AGAIN' 0|MagicMir | } 0|MagicMir | [05.02.2024 11:12.12.926] [ERROR] Newsfeed Error. Could not fetch newsfeed: https://www.cumhuriyet.com.tr/rss/son_dakika.xml FetchError: request to https://www.cumhuriyet.com.tr/rss/son_dakika.xml failed, reason: getaddrinfo EAI_AGAIN www.cumhuriyet.com.tr 0|MagicMir | at ClientRequest.<anonymous> (/home/pi/MagicMirror/node_modules/node-fetch/lib/index.js:1501:11) 0|MagicMir | at ClientRequest.emit (node:events:513:28) 0|MagicMir | at TLSSocket.socketErrorListener (node:_http_client:502:9) 0|MagicMir | at TLSSocket.emit (node:events:513:28) 0|MagicMir | at emitErrorNT (node:internal/streams/destroy:151:8) 0|MagicMir | at emitErrorCloseNT (node:internal/streams/destroy:116:3) 0|MagicMir | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 0|MagicMir | type: 'system', 0|MagicMir | errno: 'EAI_AGAIN', 0|MagicMir | code: 'EAI_AGAIN' 0|MagicMir | } 0|MagicMir | [05.02.2024 14:08.56.884] [ERROR] Newsfeed Error. Could not fetch newsfeed: https://t24.com.tr/rss FetchError: request to https://t24.com.tr/rss failed, reason: getaddrinfo EAI_AGAIN t24.com.tr 0|MagicMir | at ClientRequest.<anonymous> (/home/pi/MagicMirror/node_modules/node-fetch/lib/index.js:1501:11) 0|MagicMir | at ClientRequest.emit (node:events:513:28) 0|MagicMir | at TLSSocket.socketErrorListener (node:_http_client:502:9) 0|MagicMir | at TLSSocket.emit (node:events:513:28) 0|MagicMir | at emitErrorNT (node:internal/streams/destroy:151:8) 0|MagicMir | at emitErrorCloseNT (node:internal/streams/destroy:116:3) 0|MagicMir | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 0|MagicMir | type: 'system', 0|MagicMir | errno: 'EAI_AGAIN', 0|MagicMir | code: 'EAI_AGAIN' 0|MagicMir | } 0|MagicMir | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT 0|MagicMir | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT 0|MagicMir | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGINT``` -
MMM-PIR js error
Here is error log:
0|run-star | [17.11.2021 14:03.06.696] [ERROR] Whoops! There was an uncaught exception... 0|run-star | [17.11.2021 14:03.06.782] [ERROR] TypeError: Cannot read property 'callbackScripts' of undefined 0|run-star | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-PIR/node_helper.js:37:45) 0|run-star | at Socket.socket.on (/home/pi/MagicMirror/js/node_helper.js:109:11) 0|run-star | at Socket.emit (events.js:198:13) 0|run-star | at Socket.emitUntyped (/home/pi/MagicMirror/node_modules/socket.io/dist/typed-events.js:69:22) 0|run-star | at process.nextTick (/home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:428:39) 0|run-star | at process._tickCallback (internal/process/next_tick.js:61:11)Here is my node_helper.js
var NodeHelper = require("node_helper"); const exec = require('child_process').exec; const fs = require('fs'); const Gpio = require('onoff').Gpio; var commandDict = { "js": "node", "py": "python", "sh": "sh" }; module.exports = NodeHelper.create({ running: false, socketNotificationReceived: function (notification, payload) { const self = this; if (notification === "CONFIG") { this.config = payload; this.pir = new Gpio(this.config.sensorPin, 'in', 'both'); this.pir.watch(function (err, value) { if (value == 1) { self.sendSocketNotification("USER_PRESENCE", true); if (!self.running) { self.running = true; if (self.config.turnOffDisplay) { execute(buildCommand("/default/ac.py"), function (stdout) { console.log(stdout); }); } } } }); } else if (notification === "TIMER_EXPIRED") { self.running = false; for (var i = 0; i < this.config.callbackScripts.length; i++) { execute(buildCommand(this.config.callbackScripts[i]), function (stdout) { console.log(stdout); }); } if (self.config.turnOffDisplay) { execute(buildCommand("/default/kapat.py"), function (stdout) { console.log(stdout); }); } } }, }); function buildCommand(fileName) { var file = __dirname + "/callbackScripts/" + fileName; var fileExtension = file.split(".").slice(-1).pop(); return commandDict[fileExtension] + " " + file; } function execute(command, callback) { exec(command, function (error, stdout, stderr) { if (error) { console.log(stderr); } else { callback(stdout); } }); } -
RE: NPM COMMAND NOT FOUND
pi@raspberrypi:~ $ sudo npm uninstall npm -g sudo: npm: komut bulunamadı pi@raspberrypi:~ $ npm -bash: npm: komut yok pi@raspberrypi:~ $ npm install -bash: npm: komut yok pi@raspberrypi:~ $ npm unstallnpm command not founded. thats strange right?
-
RE: NPM COMMAND NOT FOUND
@sdetweil I didn’t install the MagicMirror with sudo. I accidently update the npm with sudo command and than this error shows up. Do I still need to reinstall?
-
RE: NPM COMMAND NOT FOUND
@sdetweil Help me more please. How can i reinstall
-
NPM COMMAND NOT FOUND
0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yok 0|MagicMir | /home/pi/MagicMirror/installers/mm.sh: satır 3: npm: komut yokpm2 got errored and here its the logs
-
RE: Cannot find module "moment"
@sdetweil Hi there! Problem solved. New code:
/* Magic Mirror * Module: MMM-LICE * * By Mykle1 * */ const NodeHelper = require('node_helper'); const request = require('request'); const cheerio = require('cheerio'); module.exports = NodeHelper.create({ start: function() { console.log("Starting node_helper for: " + this.name); }, getLICE: function(url) { request({ url: 'https://kur.altin.in/banka', method: 'GET' }, (error, response, body) => { if (!error && response.statusCode == 200) { const $ = cheerio.load(body); var arr = [] var result = $('.fiyat'); result.each((_id,el) => (arr.push(el.children[0]['data']))) var result = $('h2[id=gfiy]'); result.each((_id,el) => (arr.push(el.children[0]['data']))) this.sendSocketNotification('LICE_RESULT', arr); } }); }, socketNotificationReceived: function(notification, payload) { if (notification === 'GET_LICE') { this.getLICE(payload); } } });But i have an another problem. Turkish characters in the news seem broken. I think there is a utf-8 error but it doesn’t write anything in the logs.
Edit: The news site is broken, it’s not a mistake about us. -
RE: Cannot find module "moment"
@sdetweil I just rebuild the module without using request.
-
RE: Cannot find module "moment"
@sdetweil Deleted parents but still same.
0|MagicMirror | [26.07.2021 13:25.47.639] [ERROR] 0|MagicMirror | Whoops! There was an uncaught exception... 0|MagicMirror | [26.07.2021 13:25.47.741] [ERROR] 0|MagicMirror | TypeError: $ is not a function 0|MagicMirror | at Request.request [as _callback] (/home/pi/MagicMirror/mod ules/MMM-LICE/node_helper.js:27:26) 0|MagicMirror | at Request.self.callback (/home/pi/MagicMirror/modules/MMM- LICE/node_modules/request/request.js:185:22) 0|MagicMirror | at Request.emit (events.js:198:13) 0|MagicMirror | at Request.<anonymous> (/home/pi/MagicMirror/modules/MMM-LI CE/node_modules/request/request.js:1154:10) 0|MagicMirror | at Request.emit (events.js:198:13) 0|MagicMirror | at IncomingMessage.<anonymous> (/home/pi/MagicMirror/module s/MMM-LICE/node_modules/request/request.js:1076:12) 0|MagicMirror | at Object.onceWrapper (events.js:286:20) 0|MagicMirror | at IncomingMessage.emit (events.js:203:15) 0|MagicMirror | at endReadableNT (_stream_readable.js:1145:12) 0|MagicMirror | at process._tickCallback (internal/process/next_tick.js:63: 19) 0|MagicMirror | [26.07.2021 13:25.47.770] [ERROR] 0|MagicMirror | MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|MagicMirror | [26.07.2021 13:25.47.788] [ERROR] If you think this really is a n issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror /issues -
RE: Cannot find module "moment"
pi@raspberrypi:~ $ cd ~/MagicMirror/modules/MMM-LICE pi@raspberrypi:~/MagicMirror/modules/MMM-LICE $ ls node_modules/cheerio LICENSE lib package.json Readme.md pi@raspberrypi:~/MagicMirror/modules/MMM-LICE $ -
RE: Cannot find module "moment"
@sdetweil
Still samepi@raspberrypi:~/MagicMirror/modules/MMM-LICE $ pm2 logs [TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option) /home/pi/.pm2/pm2.log last 15 lines: PM2 | 2021-07-26T02:05:51: PM2 log: App [MagicMirror:0] starting in -fork mode- PM2 | 2021-07-26T02:05:52: PM2 log: App [MagicMirror:0] online /home/pi/.pm2/logs/MagicMirror-error.log last 15 lines: 0|MagicMir | [26.07.2021 02:06.21.033] [WARN] The module 'currentweather' is deprecated in favor of the 'weather'-module, please refer to the documentation for a migration path 0|MagicMir | [26.07.2021 02:06.21.065] [WARN] The module 'weatherforecast' is deprecated in favor of the 'weather'-module, please refer to the documentation for a migration path /home/pi/.pm2/logs/MagicMirror-out.log last 15 lines: 0|MagicMir | [26.07.2021 02:06.21.048] [LOG] Connecting socket for: weatherforecast 0|MagicMir | [26.07.2021 02:06.21.074] [LOG] Connecting socket for: newsfeed 0|MagicMir | [26.07.2021 02:06.21.090] [LOG] Starting node helper for: newsfeed 0|MagicMir | [26.07.2021 02:06.21.102] [LOG] Connecting socket for: MMM-cryptocurrency 0|MagicMir | [26.07.2021 02:06.21.112] [LOG] Cryptocurrency module loaded! 0|MagicMir | [26.07.2021 02:06.21.128] [LOG] Connecting socket for: MMM-MyPrayerTimes 0|MagicMir | [26.07.2021 02:06.21.144] [LOG] Starting node_helper for: MMM-MyPrayerTimes 0|MagicMir | [26.07.2021 02:06.21.159] [LOG] Connecting socket for: MMM-LICE 0|MagicMir | [26.07.2021 02:06.21.174] [LOG] Starting node_helper for: MMM-LICE 0|MagicMir | [26.07.2021 02:06.21.187] [LOG] Connecting socket for: MMM-PIR 0|MagicMir | [26.07.2021 02:06.21.202] [LOG] Starting module helper: MMM-PIR 0|MagicMir | [26.07.2021 02:06.21.211] [LOG] Sockets connected & modules started ... 0|MagicMir | [26.07.2021 02:06.21.221] [LOG] 0|MagicMir | Ready to go! Please point your browser to: http://0.0.0.0:8080 0|MagicMir | Starting chromium browser now, have patience, it takes a minute 0|MagicMirror | [26.07.2021 02:08.03.737] [LOG] 0|MagicMirror | Create new calendarfetcher for url: https://calendar.google.com/calendar/ical/10s0ee0h3tb1ko7fqhpf71sfgs%40group.calendar.google.com/private-d3794e10c136ecfea3ad72fe63078acd/basic.ics - Interval: 300000 0|MagicMirror | [26.07.2021 02:08.05.785] [LOG] 0|MagicMirror | Create new newsfetcher for url: https://www.cnnturk.com/feed/rss/turkiye/news - Interval: 300000 0|MagicMirror | [26.07.2021 02:08.07.210] [LOG] 0|MagicMirror | Create new newsfetcher for url: https://www.birgun.net/xml/rss.xml - Interval: 300000 0|MagicMirror | [26.07.2021 02:08.15.652] [ERROR] 0|MagicMirror | Whoops! There was an uncaught exception... 0|MagicMirror | [26.07.2021 02:08.15.761] [ERROR] 0|MagicMirror | TypeError: $ is not a function 0|MagicMirror | at Request.request [as _callback] (/home/pi/MagicMirror/modules/MMM-LICE/node_helper.js:27:27) 0|MagicMirror | at Request.self.callback (/home/pi/MagicMirror/modules/MMM-LICE/node_modules/request/request.js:185:22) 0|MagicMirror | at Request.emit (events.js:198:13) 0|MagicMirror | at Request.<anonymous> (/home/pi/MagicMirror/modules/MMM-LICE/node_modules/request/request.js:1154:10) 0|MagicMirror | at Request.emit (events.js:198:13) 0|MagicMirror | at IncomingMessage.<anonymous> (/home/pi/MagicMirror/modules/MMM-LICE/node_modules/request/request.js:1076:12) 0|MagicMirror | at Object.onceWrapper (events.js:286:20) 0|MagicMirror | at IncomingMessage.emit (events.js:203:15) 0|MagicMirror | at endReadableNT (_stream_readable.js:1145:12) 0|MagicMirror | at process._tickCallback (internal/process/next_tick.js:63:19) 0|MagicMirror | [26.07.2021 02:08.15.803] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|MagicMirror | [26.07.2021 02:08.15.842] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues -
RE: Cannot find module "moment"
@sdetweil Now im doing the npm install request cheerio --save . Should I continue or cancel?
-
RE: Cannot find module "moment"
@sdetweil Thanks man. You are the best. https://github.com/uok825/MagicMirror/tree/master/modules/MMM-LICE
-
RE: Cannot find module "moment"
/* Magic Mirror * Module: MMM-LICE * * By Mykle1 * */ const NodeHelper = require('node_helper'); const request = require('request'); const $ = require('cheerio'); module.exports = NodeHelper.create({ start: function() { console.log("Starting node_helper for: " + this.name); }, getLICE: function(url) { request({ url: 'https://kur.altin.in/banka', method: 'GET' }, (error, response, body) => { if (!error && response.statusCode == 200) { var arr = [] var result = ($('.fiyat',body)); result.each((_id,el) => (arr.push(el.children[0]['data']))) var result = ($('h2[id=gfiy]',body)); result.each((_id,el) => (arr.push(el.children[0]['data']))) this.sendSocketNotification('LICE_RESULT', arr); } }); }, socketNotificationReceived: function(notification, payload) { if (notification === 'GET_LICE') { this.getLICE(payload); } } }); -
RE: Cannot find module "moment"
@sdetweil I’ll delete cointelegraph. Now i am working on LICE module. I am changed that module code.