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

    Posts

    Recent Best Controversial
    • MMM-DHT22 Humidity and Temperature Module

      Here is my MMM-DHT22 Module.
      Temperature and Humidity monitoring Module for MagicMirror2 that works for DHT22 and AM2302 sensors.
      https://github.com/Bangee44/MMM-DHT22/

      0_1475234649682_screenshot.jpg

      It’s analog to @psk’s Module: https://forum.magicmirror.builders/topic/726/mmm-temperature-humidity-module-dht11-dht22-and-am2302-sensors

      But I don’t want to run MagicMirror as Root with sudo.

      Bangee

      posted in Utilities
      BangeeB
      Bangee
    • RE: MMM-Temperature/Humidity Module (DHT11, DHT22 and AM2302 sensors.)

      0_1475148058296_DHT22.JPG

      I’m using node-dht-sensor

      As user pi I don’t have an error but after starting MagicMirror thers a crash.

      @psk you should cool down your room :-)

      posted in Utilities
      BangeeB
      Bangee
    • RE: MMM-Temperature/Humidity Module (DHT11, DHT22 and AM2302 sensors.)

      @Jopyth yes, he has, but he’s going to start the MagicMirror with sudo npm start

      for security reasons I try to run everything without sudo commands.

      posted in Utilities
      BangeeB
      Bangee
    • RE: MMM-Temperature/Humidity Module (DHT11, DHT22 and AM2302 sensors.)

      @psk Do you need to run magicmirror as root?

      I try to find a solution to do the same as pi

      posted in Utilities
      BangeeB
      Bangee
    • RE: MMM-PIR-Sensor - White Screen

      Can you post a printscrenn from this folder?
      you can also try to go use these commands:

      cd ~/MagicMirror/modules/MMM-PIR-Sensor/
      git pull
      npm rebuild
      
      posted in Troubleshooting
      BangeeB
      Bangee
    • RE: MMM-PIR-Sensor - White Screen

      @samydp did you maybe reneamed this folder:
      modules/MMM-PIR-Sensor/node_m odules <- is there a space in this name??
      you’ll have to remove this

      posted in Troubleshooting
      BangeeB
      Bangee
    • RE: npm start dev

      hey there
      @ostfilinchen that’s it. to start npm from my shell it need to use this command:
      DISPLAY=:0 npm start dev

      But with this I can not debug my script. Electron crashes alwasy on startup when I’ve activated my new module using const sensorLib = require('node-dht-sensor') in my node_helper.js

      How can I debug this error?

      posted in Troubleshooting
      BangeeB
      Bangee
    • npm start dev

      Hi there

      I try to start my mirror whit npm start dev to do some debugging but there are always a lot of errors. What’s wrong here?

      pi@raspberrypi:~/MagicMirror $ npm start dev
      
      > magicmirror@2.0.0 start /home/pi/MagicMirror
      > electron js/electron.js "dev"
      
      
      npm ERR! Linux 4.4.13-v7+
      npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "dev"
      npm ERR! node v6.4.0
      npm ERR! npm  v3.10.3
      npm ERR! code ELIFECYCLE
      npm ERR! magicmirror@2.0.0 start: `electron js/electron.js "dev"`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the magicmirror@2.0.0 start script 'electron js/electron.js "dev"'.
      npm ERR! Make sure you have the latest version of node.js and npm installed.
      npm ERR! If you do, this is most likely a problem with the magicmirror package,
      npm ERR! not with npm itself.
      npm ERR! Tell the author that this fails on your system:
      npm ERR!     electron js/electron.js "dev"
      npm ERR! You can get information on how to open an issue for this project with:
      npm ERR!     npm bugs magicmirror
      npm ERR! Or if that isn't available, you can get their info via:
      npm ERR!     npm owner ls magicmirror
      npm ERR! There is likely additional logging output above.
      
      npm ERR! Please include the following file with any support request:
      npm ERR!     /home/pi/MagicMirror/npm-debug.log
      
      posted in Troubleshooting
      BangeeB
      Bangee
    • RE: DHT22 Sensor

      I could fix this with the same workaround as the PIR Sensor.

      now its runnig but electron start up everything and crashes after loading all data.

      Any idea howto debug this? ther is nothing in my error logs…

      /var/log/messages:

      pi@raspberrypi:~/MagicMirror/modules/temperature $ tail -f /var/log/messages
      Sep 14 13:16:05 raspberrypi kernel: [706942.834881] gpiomem-bcm2835 3f200000.gpiomem: gpiomem device opened.
      Sep 14 13:16:32 raspberrypi kernel: [706969.575020] gpiomem-bcm2835 3f200000.gpiomem: gpiomem device opened.
      Sep 14 13:17:00 raspberrypi kernel: [706997.192894] gpiomem-bcm2835 3f200000.gpiomem: gpiomem device opened.
      

      thats all… :-(

      node_helper.js:

      'use strict';
      
      /* Magic Mirror
       * Module: temperatur.js
       *
       * By Benjamin Angst 
       * MIT Licensed.
       */
      
      const NodeHelper = require('node_helper');
      const sensorLib = require('node-dht-sensor');
      
      module.exports = NodeHelper.create({
      		 start: function () {
      			 console.log('Temperatur helper started ...');
      		 },
      		 
      		 // Subclass socketNotificationReceived received.
      		 socketNotificationReceived: function(notification, payload) {
      		   const self = this;
      		   if (notification === 'REQUEST') {
      			 var sensor = {
      			     initialize: function () {
      			         return sensorLib.initialize(22, 27);
      			     },
      			     read: function () {
      			         var readout = sensorLib.read();
      			         console.log('Temperature: ' + readout.temperature.toFixed(2) + 'C, ' +
      			             'humidity: ' + readout.humidity.toFixed(2) + '%');
      			         setTimeout(function () {
      			             sensor.read();
      			         }, 2000);
      			         // Send Temperatur
      			         self.sendSocketNotification('DATA',{
      							temp: readout.temperature.toFixed(2),
      							humidity: readout.humidity.toFixed(2)
      					 });
      			     }
      			 };
      			
      			 if (sensor.initialize()) {
      			     sensor.read();
      			 } else {
      			     console.warn('Failed to initialize sensor');
      			 }
      		   }
      		 }
       
      });
      

      temperature.js

      /* Magic Mirror
       * Module: temperatur.js
       *
       * By Benjamin Angst 
       * MIT Licensed.
       */
      
      Module.register("temperature",{
          // Default module config.
          defaults: {
              gpioPIN: 27,
              sensorType: 22, // Can be 22 or 11
              prependString: "Temperatur ",
          },
      
          // Override dom generator.
          getDom: function() {
              var wrapper = document.createElement("div");
              wrapper.innerHTML = "T: " + this.temperature + " °C / H: " + this.humidity + " %";
              return wrapper;
          },
          
          start: function() {
              this.temperature = 'fetching...';
              this.sendSocketNotification('REQUEST');
          },
      
      
          socketNotificationReceived: function(notification, payload) {
          if (notification === 'DATA') {
              this.temperature = payload.temp;
              this.humidity = payload.humidity;
              this.updateDom();
          }
          },
      });
      
      
      posted in Requests
      BangeeB
      Bangee
    • RE: MMM-PIR-Sensor - White Screen

      this works for me too. without formatting and reinstallation.
      I’ve remove the folder node_modules and startet from 4.

      Thanks a lot.

      posted in Troubleshooting
      BangeeB
      Bangee
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 12
    • 13
    • 6 / 13