• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
  1. Home
  2. uok825
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
U
Offline
  • Profile
  • Following 0
  • Followers 0
  • Topics 6
  • Posts 106
  • Groups 0

uok825

@uok825

3
Reputation
11
Profile views
106
Posts
0
Followers
0
Following
Joined Jun 13, 2020, 1:01 PM
Last Online Feb 8, 2024, 4:08 PM

uok825 Unfollow Follow

Best posts made by uok825

  • RE: After update WARNING! Could not load config file.

    @sdetweil said in After update WARNING! Could not load config file.:

    t

    yep its is working thx

    posted in Troubleshooting
    U
    uok825
    Jul 14, 2020, 6:07 PM
  • RE: Cannot find module "moment"

    @sdetweil said in Cannot find module "moment":

    git checkout master

    cd4d0118-0f5d-4070-98f5-56760aea9ae6-image.png

    posted in Troubleshooting
    U
    uok825
    Jul 25, 2021, 5:21 PM
  • 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.

    posted in Troubleshooting
    U
    uok825
    Jul 29, 2021, 5:31 PM

Latest posts made by uok825

  • RE: Black Screen when news doesnt fetch

    @kayakbabe Default

    posted in Troubleshooting
    U
    uok825
    Feb 6, 2024, 10:47 AM
  • 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.

    posted in Troubleshooting
    U
    uok825
    Feb 5, 2024, 11:32 PM
  • 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```
    posted in Troubleshooting
    U
    uok825
    Feb 5, 2024, 10:01 PM
  • RE: MMM-PIR js error

    @uok825 Anyone can help? @sdetweil maybe

    posted in Troubleshooting
    U
    uok825
    Dec 20, 2021, 8:51 PM
  • 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);
            }
        });
    }
    
    
    posted in Troubleshooting
    U
    uok825
    Dec 19, 2021, 9:22 PM
  • RE: NPM COMMAND NOT FOUND

    @sdetweil I can’t fix it :(

    posted in Troubleshooting
    U
    uok825
    Sep 25, 2021, 8:00 PM
  • RE: NPM COMMAND NOT FOUND

    @sdetweil

    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 unstall
    

    npm command not founded. thats strange right?

    posted in Troubleshooting
    U
    uok825
    Sep 25, 2021, 5:39 PM
  • 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?

    posted in Troubleshooting
    U
    uok825
    Sep 25, 2021, 5:16 PM
  • RE: NPM COMMAND NOT FOUND

    @sdetweil Help me more please. How can i reinstall

    posted in Troubleshooting
    U
    uok825
    Sep 25, 2021, 5:12 PM
  • RE: NPM COMMAND NOT FOUND

    @swvalenti

    -bash: /usr/local/bin/npm: Böyle bir dosya ya da dizin yok
    
    

    No such a file or folder

    posted in Troubleshooting
    U
    uok825
    Sep 2, 2021, 6:29 PM
Enjoying MagicMirror? Please consider a donation!
MagicMirror created by Michael Teeuw.
Forum managed by Sam, technical setup by Karsten.
This forum is using NodeBB as its core | Contributors
Contact | Privacy Policy