MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Images & Videos

    Scheduled Pinned Locked Moved Troubleshooting
    19 Posts 2 Posters 16.3k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U Offline
      Ultimatum22 Module Developer
      last edited by

      See my module for displaying images, videos does not work with this module. https://forum.magicmirror.builders/topic/1178/random-background-from-local-folder

      It only has a simple transition animation for now.

      1 Reply Last reply Reply Quote 0
      • Z Offline
        zkab
        last edited by

        Thanks - I will test it and keep up posted …

        1 Reply Last reply Reply Quote 0
        • Z Offline
          zkab
          last edited by

          Some feedback …
          Install gave this warnings:

          pi@mirror:~/MagicMirror/modules $ npm install
          npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/package.json’
          npm WARN enoent ENOENT: no such file or directory, open ‘/home/pi/MagicMirror/modules/node_modules/node_helper/package.json’
          npm WARN modules No description
          npm WARN modules No repository field.
          npm WARN modules No README data
          npm WARN modules No license field.

          Here is my config.js with your module :

          module : ‘MMM-RandomBackground’,
          position : ‘fullscreen_below’, // Any region but this one makes the most sense
          config: {
          animationSpeed: 2000,
          updateInterval: 5000,
          photoDirectories: ‘/nfs/MIRROR’
          }

          As you can see the photos are in a NFS share on my server.
          What I got is a totally black screen …
          Where have I missed ?

          1 Reply Last reply Reply Quote 0
          • U Offline
            Ultimatum22 Module Developer
            last edited by

            You are installing from the wrong directory, the installer is looking for package.json in your modules folder. You should be in home/pi/MagicMirror/modules/MMM-RandomBackground/

            I just noticed my readme is wrong, after git clone you have to execute cd MMM-RandomBackground.

            1 Reply Last reply Reply Quote 0
            • Z Offline
              zkab
              last edited by

              OK - now I got this …

              $ npm install

              magic-mirror-module-random-background@0.0.1 postinstall /home/pi/MagicMirror/modules/MMM-RandomBackground
              ./scripts/post-install.sh

              Post install [in the future this creates a share to photos]
              magic-mirror-module-random-background@0.0.1 /home/pi/MagicMirror/modules/MMM-RandomBackground
              ├── jquery@2.2.4
              └─┬ recursive-readdir@2.1.0
              └─┬ minimatch@3.0.2
              └─┬ brace-expansion@1.1.6
              ├── balanced-match@0.4.2
              └── concat-map@0.0.1

              npm WARN magic-mirror-module-random-background@0.0.1 No repository field.

              But still I don’t get any picture from /nfs/MIRROR … hmmm

              1 Reply Last reply Reply Quote 0
              • U Offline
                Ultimatum22 Module Developer
                last edited by

                That looks good. Are you sure that the share is accesable? Try ls -al /nfs/MIRROR on the commandline of your mirror. Does it show any folders and/or photos?

                1 Reply Last reply Reply Quote 0
                • Z Offline
                  zkab
                  last edited by

                  Sure it is accessible - I just set up the nfs share myself.
                  All the images are listed when I give ls -la /nfs/MIRROR command …

                  $ ls -l /nfs/MIRROR/
                  total 748
                  -rw-rw-r-- 1 pi pi 157448 nov 16 13:18 IMG-20161116-WA0004.jpg
                  -rw-rw-r-- 1 pi pi 90988 nov 18 14:07 IMG-20161118-WA0004.jpg
                  -rw-rw-r-- 1 pi pi 188982 nov 25 13:30 IMG-20161125-WA0002.jpg
                  -rw-rw-r-- 1 pi pi 197352 dec 8 23:55 IMG-20161127-WA0023.jpg
                  -rw-rw-r-- 1 pi pi 117901 dec 14 12:01 IMG.jpg

                  1 Reply Last reply Reply Quote 0
                  • U Offline
                    Ultimatum22 Module Developer
                    last edited by

                    My bad, I just realized that the photoDirectories config is not yet implemented. It only reads photo’s from the photos directory in the module itself. You could make a soft link from your share to /home/pi/MagicMirror/modules/MMM-RandomBackground/photos.

                    1 Reply Last reply Reply Quote 0
                    • Z Offline
                      zkab
                      last edited by

                      OK - it worked … but it is a temporary solution
                      When are you going to implement photoDirectories config …

                      1 Reply Last reply Reply Quote 0
                      • Z Offline
                        zkab
                        last edited by

                        More feedback …
                        The config should also include ‘imageSize’
                        Now the image is full screen and it will hide other information on the screen (despite it is ‘fullscreen_below’)
                        It would be good to have it centered with a customized size …

                        1 Reply Last reply Reply Quote 0
                        • U Offline
                          Ultimatum22 Module Developer
                          last edited by

                          Glad you got it working. I might add imageSize in the future, was ment to be a fullscreen photo gallery tho. Does it hide all your modules or just some? It doesn’t hide any modules at my end. I do see that the other modules are very hard to read with the light colors, I am in the progres of customizing that on my mirror.

                          1 Reply Last reply Reply Quote 0
                          • Z Offline
                            zkab
                            last edited by

                            Maybe I gave confusing information to you.
                            MMM-RandomBackground doesn’t hide any other modules … what I ment was that some text from other modules are hard to read (light text on light background)
                            ‘imageSize’ would solve that problem for me at once
                            If you are going to dig in the code please prioritize this before ‘photoDirectories’ … that works OK as a temporay solution
                            Thanks …

                            1 Reply Last reply Reply Quote 0
                            • Z Offline
                              zkab
                              last edited by

                              I tested MMM-RandomBackground with 40 images and discovered that very often the same image was chosen two times in row.
                              Don’t know how you choose the images order randomly but is there a way to eliminate the random algorithm and just display the images in the file name order they are in the folder …

                              1 Reply Last reply Reply Quote 0
                              • U Offline
                                Ultimatum22 Module Developer
                                last edited by Ultimatum22

                                Yeah the random generator isn’t that random with that few of images. Displaying them in order isn’t that difficult. I will add an option for this. Thank you for your feedback, I am working on the css atm.

                                I have added an option for displaying random photo’s or in order. Go to ~/MagicMirror/modules/MMM-RandomBackground and do git pull. Then add this to your config, randomOrder: false, Set it to true for random order.

                                1 Reply Last reply Reply Quote 0
                                • Z Offline
                                  zkab
                                  last edited by

                                  Thanks for your reply - I update the software with ‘git pull’

                                  pi@mirror:~/MagicMirror/modules/MMM-RandomBackground $ git pull
                                  remote: Counting objects: 5, done.
                                  remote: Compressing objects: 100% (1/1), done.
                                  remote: Total 5 (delta 4), reused 5 (delta 4), pack-reused 0
                                  Unpacking objects: 100% (5/5), done.
                                  From https://github.com/Ultimatum22/MMM-RandomBackground
                                  868fc6c…03e3727 master -> origin/master
                                  Updating 868fc6c…03e3727
                                  Fast-forward
                                  .gitignore | 0
                                  LICENSE | 0
                                  MMM-RandomBackground.js | 33 ++++++++++++++++++++++++±-------
                                  node_helper.js | 21 ++++++++++++++++++±-
                                  package.json | 3 +±
                                  5 files changed, 46 insertions(+), 11 deletions(-)
                                  mode change 100644 => 100755 .gitignore
                                  mode change 100644 => 100755 LICENSE

                                  My ‘config.js’ looks like this:

                                  {
                                  module: ‘MMM-RandomBackground’,
                                  position: ‘fullscreen_below’,
                                  config: {
                                  randomOrder: false,
                                  animationSpeed: 100,
                                  updateInterval: 5000
                                  }

                                  But I get only a white screen … have you change the ‘photoDirectories’ also ?
                                  I still have the link ‘/home/pi/MagicMirror/modules/MMM-RandomBackground/photos’

                                  1 Reply Last reply Reply Quote 0
                                  • U Offline
                                    Ultimatum22 Module Developer
                                    last edited by Ultimatum22

                                    Did you run npm install? Don’t think the packages have changed but just to be sure. Also the config you pasted is wrong, it’s missing a } at the end, is that just a copy paste error from your side?

                                    How do you run MagicMirror, could you try display=:0 npm start dev from the terminal and see for console logs. My mirror works without errors with your config (when I add a } at the end).

                                    Or go to :8080 in your browser, press F12 to open dev tools and check for errors.

                                    1 Reply Last reply Reply Quote 0
                                    • Z Offline
                                      zkab
                                      last edited by

                                      Sorry - my mistake … I forgot to run ‘npm install’
                                      Now it works like a Swiss clock …
                                      Thanks again

                                      1 Reply Last reply Reply Quote 0
                                      • U Offline
                                        Ultimatum22 Module Developer
                                        last edited by

                                        Good to hear. I did forgot I added some functionality that needed new packages.

                                        1 Reply Last reply Reply Quote 0

                                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                        With your input, this post could be even better 💗

                                        Register Login
                                        • 1 / 1
                                        • First post
                                          Last post
                                        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