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

    schmucke

    @schmucke

    4
    Reputation
    768
    Profile views
    20
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    schmucke Unfollow Follow

    Best posts made by schmucke

    • RE: Where are you from?

      Berlin, Germany

      posted in General Discussion
      S
      schmucke
    • RE: Iframe Module for Webcam

      Ok , i have build my own now - i am not really a javescript programmer - pls dont laugh!!!

      i have the following code, how can i initiate the the startonload() function ist run. if i write this in dom, there will be run, but not shiow the wrapper…

      /* global Module */
      
      /* Magic Mirror
       * Module: MMM-iFrame
       *
       * By Michael Teeuw http://michaelteeuw.nl
       * MIT Licensed.
       */
      
      Module.register("MMM-iFrame",{
      
              // Default module config.
              defaults: {
                      animationSpeed: 1000,
              },
      
              preload: function()
              {
                      this.img.src='http://guest@192.168.188.65/tmpfs/auto.jpg?'+new Date;
              },
      
              changesrc: function()
              {
                      img1.src=img.src;
                      this.preload();
                      setTimeout(changesrc,3500);
              },
      
              update: function()
              {
                      var imgObj = document.getElementById('img1');
      
                      imgObj.src = this.img.src;
                      this.img.src = "http://guest@192.168.188.65/tmpfs/auto.jpg?" + (new Date()).getTime();
              },
      
              takeerror: function()
              {
              this.img.src = "http://guest@192.168.188.65/tmpfs/auto.jpg?" + (new Date()).getTime();
              },
      
              startonload: function()
              {
                      this.img.src = "http://guest@192.168.188.65/tmpfs/auto.jpg?" + (new Date()).getTime();
                      this.img.onerror=this.takeerror();
                      this.img.onload=this.update();
              },
      
              load: function()
              {
                      if (navigator.appName.indexOf("Microsoft IE Mobile") != -1)
                      {
                      this.preload();
                      this.changesrc();
                      return;
                      }
                      this.startonload();
              },
      
              start: function() {
                      Log.info('Starting module: ' + this.name);
                      var self = this;
                      var imgObj = "";
                      var img = new Image();
                      this.img = new Image();
                      this.imgObj;
                      setInterval(function() {
                              self.updateDom();
                      }, this.config.animationSpeed);
      
              },
      
              // Override dom generator.
              getDom: function() {
                      var wrapper = document.createElement("div");
                      var imagewrapper = document.createElement("iFrame");
                      imagewrapper.style = "border:0"
                      imagewrapper.width = 0;
                      imagewrapper.height = 0;
                      imagewrapper.src = "http://guest@192.168.188.65/tmpfs/auto.jpg";
                      wrapper.innerHTML = "<img class="center-ver3" src="http://guest@192.168.188.65/tmpfs/auto.jpg" />";
                      wrapper.appendChild(imagewrapper);
                      return wrapper;
              }
      });
      

      (The iFrame is not visible, it is just for open a Browser session with a user without a password)

      Can anyone help me by my probem?

      thx

      posted in Requests
      S
      schmucke
    • Get pictures from synology NAS - "Rediscover This Day"

      Hey,

      is anyone here who is needing a solution to show own images from the past years? Like the Facebook remember function? The job to sort the images runs on the synology and works with: mysql, exiv2 and copy. I get the Exif data from each image and write it in a sqldb. with bash i get the files in a local folder (incl. resize for the mirror). The raspberry is copy the images in a local folder. Here dit i use the MMM-ImagesPhoto Plugin.

      my solution ist very simple and usable with the latest synology firmware. If anyone want read this, in wich category can i post it?!
      Not the right resolution, but you can see the what i mean…

      screenshot

      posted in General Discussion
      S
      schmucke
    • RE: Get pictures from synology NAS - "Rediscover This Day"

      Hello,

      i help me here very simple. on the Magicmirror side, i have a cronjob what get pictures every day per ssh/scp. To use this, i have add the magicmirror device to the knownhosts on the synology side (google for it).

      on Synology side:
      This Script is get the exif data of the images. write it to a CSV and then, get the path and write it to a mysqldb (This Script i run once every year one time per hand … i dont know it works perfectly… I think, that here are better coding people… this is quick and dirty. But it works for me. I cant show the Magicmirror side now, i am not at home - but you can use every Plugin with a upload folder… i can show my “Plugin” in the next days if you want…

      #!/bin/bash
      # 
      # This script is get the exif data (if set) from all
      # pictures (jpg/JPG) in a define path (recursiv).
      # It writes the data to am MYSQL Database.
      #
      # It works native with Synology DSM (Tested with 6.0.2-xxxx)
      #
      # To use this script, put in the  root folder of your photos
      # chmod 775 ./listimages.sh make the script executable
      # ./listimages.sh execute the scriptfile
      #
      # Where want you present your files?
      imagepath=/volume1/Intern/Fotos/MagicMirror/
      # Variables for the temp files (will delete at End of the Script
      exportcsv=./export.csv
      importcsv=./import.csv
      
      # MySql Data
      
      username=root
      password=PASSWORD
      database=ExifData
      table=Bilder
      
      shopt -s globstar extglob
      exiv2 -pa -g DateTimeOriginal **/*.@(jpg|JPG) |
      awk -v pwd="$PWD/" -v dq='"' -v OFS=',' '{
          fn = substr($0, 1, match($0, / *Exif\.Photo/)-1)
      	    print dq pwd fn dq,  dq $(NF-1) dq, dq $NF dq
      		}' >$exportcsv
      
      mysql -u$username -p$password -e "use $database" -e "
      TRUNCATE Bilder;"
      
      # Write data to mysql
      for f in $exportcsv
      do
      mysql -u$username -p$password -e "use $database" -e "
      		LOAD DATA LOCAL INFILE '$f'
      		INTO TABLE $table
      		FIELDS TERMINATED BY ',' 
      		OPTIONALLY ENCLOSED BY '\"' 
      		LINES TERMINATED BY '\n' 
      		(path,date,time);"
      done
      

      This script is copying and resizing the images:

      importcsv=/volume1/Intern/Fotos/Bilder/import.csv
      imagepath=/volume1/Intern/Fotos/MagicMirror/
      #remove old images
      rm /volume1/Intern/Fotos/Bilder/import.csv
      rm /volume1/Intern/Fotos/MagicMirror/*.*
      #Get Date from tommorow
      DATE=$(date --date='1 day' +%m-%d)
      #DATE=$(date +%m-%d)
      
      #MYSQL Query by date from tomorrow
      id=$(mysql -uroot -pPASSWORD -s -N -e "SELECT path FROM ExifData.Bilder WHERE date like '%$DATE' INTO OUTFILE '$importcsv' FIELDS TERMINATED BY ',' ENCLOSED BY ''")
      # Copy files with exifdata from tomorow before one,two, three or whatever years
      while read p; do
      cp "$p" $imagepath
      done < $importcsv #(DELETE THE SPACE BETWEEN < AND $!!!!)
      
      
      cd $imagepath
      shopt -s nullglob
      i=0
      for f in *.JPG *.jpg *.jpeg; do
        exiv2 -r "$i"_%d.%m.%Y_%H.%M.%S rename ./"$f"
        i=$((i+1))
        done
      
      for f in *.JPG *.jpg *.jpeg; do
      	convert -thumbnail 800 ./"$f" ./"${f%}.jpg"
      	rm ./"$f"
      done
      

      I hope this helps - you can do it! Have fun!

      posted in General Discussion
      S
      schmucke

    Latest posts made by schmucke

    • RE: MMM-Webuntis

      @HeikoGr no Problem.

      Of cource, they have a login - but they dont know they passwords… i just try to get the Information from the teachers. Thank you!

      posted in Education
      S
      schmucke
    • RE: MMM-Webuntis

      @HeikoGr said in MMM-Webuntis:

      @schmucke at the moment this module asks explicitly for the „own“ timetable. So the error is absolutely because of the parents account. I will look, if i can get the students data out of an existing parents account.

      this would be nice! If i can help you to get any debuginfo, tell me.

      Thank you.

      posted in Education
      S
      schmucke
    • RE: MMM-Webuntis

      Hello @HeikoGr ,

      i become the following error:

      [ERROR] [MMM-Webuntis] Error: Error: Can not find person in person array.
          at WebUntisQR._otpLogin (/home/pi/MagicMirror/modules/MMM-Webuntis/node_modules/webuntis/dist/webuntis.js:957:13)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async WebUntisQR.login (/home/pi/MagicMirror/modules/MMM-Webuntis/node_modules/webuntis/dist/webuntis.js:1057:12)
      

      i think, the reason is, i just have a parent account, not a student account. is it possible to use the pearent account?

      Thank you

      posted in Education
      S
      schmucke
    • RE: Get pictures from synology NAS - "Rediscover This Day"

      Yes @yawns,

      this is the plugin what i use. i have only customize the css stuff.

      https://github.com/roramirez/MMM-ImagesPhotos

      posted in General Discussion
      S
      schmucke
    • RE: Get pictures from synology NAS - "Rediscover This Day"

      Hello,

      i help me here very simple. on the Magicmirror side, i have a cronjob what get pictures every day per ssh/scp. To use this, i have add the magicmirror device to the knownhosts on the synology side (google for it).

      on Synology side:
      This Script is get the exif data of the images. write it to a CSV and then, get the path and write it to a mysqldb (This Script i run once every year one time per hand … i dont know it works perfectly… I think, that here are better coding people… this is quick and dirty. But it works for me. I cant show the Magicmirror side now, i am not at home - but you can use every Plugin with a upload folder… i can show my “Plugin” in the next days if you want…

      #!/bin/bash
      # 
      # This script is get the exif data (if set) from all
      # pictures (jpg/JPG) in a define path (recursiv).
      # It writes the data to am MYSQL Database.
      #
      # It works native with Synology DSM (Tested with 6.0.2-xxxx)
      #
      # To use this script, put in the  root folder of your photos
      # chmod 775 ./listimages.sh make the script executable
      # ./listimages.sh execute the scriptfile
      #
      # Where want you present your files?
      imagepath=/volume1/Intern/Fotos/MagicMirror/
      # Variables for the temp files (will delete at End of the Script
      exportcsv=./export.csv
      importcsv=./import.csv
      
      # MySql Data
      
      username=root
      password=PASSWORD
      database=ExifData
      table=Bilder
      
      shopt -s globstar extglob
      exiv2 -pa -g DateTimeOriginal **/*.@(jpg|JPG) |
      awk -v pwd="$PWD/" -v dq='"' -v OFS=',' '{
          fn = substr($0, 1, match($0, / *Exif\.Photo/)-1)
      	    print dq pwd fn dq,  dq $(NF-1) dq, dq $NF dq
      		}' >$exportcsv
      
      mysql -u$username -p$password -e "use $database" -e "
      TRUNCATE Bilder;"
      
      # Write data to mysql
      for f in $exportcsv
      do
      mysql -u$username -p$password -e "use $database" -e "
      		LOAD DATA LOCAL INFILE '$f'
      		INTO TABLE $table
      		FIELDS TERMINATED BY ',' 
      		OPTIONALLY ENCLOSED BY '\"' 
      		LINES TERMINATED BY '\n' 
      		(path,date,time);"
      done
      

      This script is copying and resizing the images:

      importcsv=/volume1/Intern/Fotos/Bilder/import.csv
      imagepath=/volume1/Intern/Fotos/MagicMirror/
      #remove old images
      rm /volume1/Intern/Fotos/Bilder/import.csv
      rm /volume1/Intern/Fotos/MagicMirror/*.*
      #Get Date from tommorow
      DATE=$(date --date='1 day' +%m-%d)
      #DATE=$(date +%m-%d)
      
      #MYSQL Query by date from tomorrow
      id=$(mysql -uroot -pPASSWORD -s -N -e "SELECT path FROM ExifData.Bilder WHERE date like '%$DATE' INTO OUTFILE '$importcsv' FIELDS TERMINATED BY ',' ENCLOSED BY ''")
      # Copy files with exifdata from tomorow before one,two, three or whatever years
      while read p; do
      cp "$p" $imagepath
      done < $importcsv #(DELETE THE SPACE BETWEEN < AND $!!!!)
      
      
      cd $imagepath
      shopt -s nullglob
      i=0
      for f in *.JPG *.jpg *.jpeg; do
        exiv2 -r "$i"_%d.%m.%Y_%H.%M.%S rename ./"$f"
        i=$((i+1))
        done
      
      for f in *.JPG *.jpg *.jpeg; do
      	convert -thumbnail 800 ./"$f" ./"${f%}.jpg"
      	rm ./"$f"
      done
      

      I hope this helps - you can do it! Have fun!

      posted in General Discussion
      S
      schmucke
    • RE: Podcast

      @witschi87

      dit you have resolve the problem? I ave the same issue - i can press the button, in the console appears BUTTON_PRESSED but nothing happen…

      posted in Troubleshooting
      S
      schmucke
    • RE: MMM-Podcast: omxplayer still running. kill forced

      Dit you get it work? What is the solution? I have the same Error?!

      @PtrBld ?

      posted in Troubleshooting
      S
      schmucke
    • RE: MMM-Button dont load

      @yawns thank you, now the module starts.

      thank you very much

      posted in Troubleshooting
      S
      schmucke
    • RE: MMM-Button dont load

      yes, but what is missing? i dont understand it :/

      posted in Troubleshooting
      S
      schmucke
    • MMM-Button dont load

      Hey,

      if i try to use the MMM-Button module i just get this error:

      0|mm       | App threw an error during load
      0|mm       | Error: Module version mismatch. Expected 50, got 49.
      0|mm       |     at Error (native)
      0|mm       |     at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
      0|mm       |     at Object.Module._extensions..node (module.js:583:18)
      0|mm       |     at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
      0|mm       |     at Module.load (module.js:473:32)
      0|mm       |     at tryModuleLoad (module.js:432:12)
      0|mm       |     at Function.Module._load (module.js:424:3)
      0|mm       |     at Module.require (module.js:483:17)
      0|mm       |     at require (internal/module.js:20:19)
      0|mm       |     at bindings (/home/pi/MagicMirror/modules/MMM-Button/node_modules/bindings/bindings.js:76:44)
      0|mm       | Whoops! There was an uncaught exception...
      0|mm       | Error: Module version mismatch. Expected 50, got 49.
      0|mm       |     at Error (native)
      0|mm       |     at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
      0|mm       |     at Object.Module._extensions..node (module.js:583:18)
      0|mm       |     at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
      0|mm       |     at Module.load (module.js:473:32)
      0|mm       |     at tryModuleLoad (module.js:432:12)
      0|mm       |     at Function.Module._load (module.js:424:3)
      0|mm       |     at Module.require (module.js:483:17)
      0|mm       |     at require (internal/module.js:20:19)
      0|mm       |     at bindings (/home/pi/MagicMirror/modules/MMM-Button/node_modules/bindings/bindings.js:76:44)
      
      

      i have install the module right…
      has anyone a idea?

      Thank you

      posted in Troubleshooting
      S
      schmucke