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.

    Further development of the MMM-Swipe module

    Scheduled Pinned Locked Moved Requests
    25 Posts 7 Posters 15.2k Views 7 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.
    • C Offline
      c.keen
      last edited by c.keen

      Same here for me. The one from mochman didn’t work entirely as intended.
      The fork from shbatm I never tried because he wrote that due to problems using the sensor which his dog did not very much liked the module is not finshed yet. I totally understand that he is going to try another way because he won’t be able to use the sensors.

      Hope there will be more people who want that module finished. I think it could be a very effective way to switch between pages once it is running.

      1 Reply Last reply Reply Quote 0
      • N Offline
        nowis
        last edited by

        Hey,
        I tried to use the MMM-Swipe module some month ago, but without any success. No I finally had time to look over it and figured out a way to use the HC-SR04 sensors without sudo. So far the module recognizes if you out your hand in front of a sensor, but I haven’t tried to calibrate a nice “swipe” gesture, yet.
        I would be up to develop the module further, including a switch page functionality.
        Since I took the one from mochman as a starting base, I would ask him if it’s ok if i fork or link to his page in a new repo.
        So if you guys want, I will try to upload my module soon (after cleaning up a little bit).

        1 Reply Last reply Reply Quote 0
        • C Offline
          c.keen
          last edited by

          Hi,
          @nowis: That sounds great!

          Maybe you can also take a look at the module shbatm created. I don’t know what the status of the module is he developed but he wrote that it is up to 90% ready to use.

          Although I have no clue about programming I think it should be possible to use the MMM-Swipe module in connection to the MMM-Pages from edward-shen. He also uses some kind of input (skywriter) to give commands to the pages module to switch pages.
          But for daily use I would prefer the HCSR-04 sensors.

          1 Reply Last reply Reply Quote 0
          • N Offline
            nowis
            last edited by

            I will have a look at both modules sometime the next week. Will keep you updated.

            1 Reply Last reply Reply Quote 0
            • S Offline
              StefanMe
              last edited by

              That would be awesome!

              Thanks! I also would donate it if it works later! Because i really want this feature!

              1 Reply Last reply Reply Quote 0
              • N Offline
                nowis
                last edited by

                Hey,
                I got the module up and running. I forked shbatm’s module and changed the method of how to detect a swipe. It is not perfect, yet, but it works for me.
                There is still more work to do, but I thought I will share it with you already, so you can try it. It works with the MMM-Pages module.
                I will continue working on it the next days. Feel free to share your experience with me, as well as ideas for improvements.
                It took me a while to “learn” the right technique to swipe. I put my hand in front of one sensors (try to make form a flat surface with your hand), stay there for about 400ms (sounds weird, sorry) and then swipe from there over the other sensor. Just practice a little bit. The swipe detection is not trivial.

                Here is the link, have fun! https://github.com/Simon089/MMM-Swipe

                richland007R 1 Reply Last reply Reply Quote 0
                • richland007R Offline
                  richland007 @nowis
                  last edited by

                  @nowis

                  Hi there i followed your instructions step by step and got everything installed from your fork for MMM-Swipe, however when i add the MMM-Swipe config parameters to the MM’s config.js file and start the Magic Mirror i get a blank screen and nothing else .
                  Only after ctr-alt-del and manually killing the MagicMirror instance (ctrl+q does nothing in this case) i am able to get back to Rpi’s desktop.
                  After inspecting the MagicMirror npm start messages i found out that MMM-Swipe and some error with math-statistics module (i do not have a MagicMirror math statistics module) being unavailable that seems to be the culprit of it all, it also seems that the math statistic’s module is a node.js package of MMM-Swipe.
                  If i go back to MagicMirrors nonfig.js and comment out the MMM-Swipe module everything works just fine with my MagicMirror … what do you think it is happening??
                  Does it have anything to do with maybe the physical sensors?? They are wired just as they are supposed to according to the schematics but maybe they are not working?!?!?!
                  I am unable to give it an answer by myself so any help will be greatly appreciated
                  Thank you in advance
                  Denis

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    AxLed Module Developer
                    last edited by

                    @richland007
                    i had the same error on a rpi1 B, here is a solution that worked for me:
                    Change into MagicMirror/modules/MMM-Swipe

                    npm install math-statistics –save
                    

                    After that i got an new error like
                    Error: Module version mismatch. Expected 48, got 50)
                    Solution for this:
                    Change into MagicMirror/modules/MMM-Swipe
                    Rebuild module for the correct elecron version

                    npm rebuild --runtime=electron --target=$(../../node_modules/electron/cli.js --version) --disturl=https://atom.io/download/atom-shell --build-from-source
                    

                    Regards
                    Axled

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      nowis
                      last edited by nowis

                      Hi @richland007,

                      could you figure out a solution with the help of @AxLed by now? If not, let me know and I will try to help you. I should definitely put the math-statistics module in the package.json, sorry for that.
                      Edit: I just saw I removed it from the dependencies at some point, that was a mistake.
                      About the error with electron: Here and there I get the error after adding submodules, but I’m still not sure when and how… When I have time I should check this, but it’s probably a problem with more than just my module.

                      I hope this helps,

                      Simon

                      richland007R 1 Reply Last reply Reply Quote 0
                      • richland007R Offline
                        richland007 @nowis
                        last edited by

                        @nowis Sorry for the late reply i did figure out the math statistic on my own “…the power of research on the internet” :)
                        and also a simple npm install fixes “… the got 53 and expected 48 issue”

                        Everything on my end is working nicely i got no errors on my Magic Mirror and i have a lot of modules… however i can’t test the MMM-Swipe …granted it is not installed in the exact position where it is going to ultimately be. Mirror’s Raspi is still on my desk hooked to the monitor, wired though with the sonic sensors… cause i just got done with the programming part and have not started with the physical built of the mirror yet but i had a couple of question regarding the wiring of the two sonic sensors!!

                        Are both of the trigger pins for both sensors connected to the same Rpi GPIO?? How can i test if my hand movement can move the pages?? I have tried but nothing happens the module on the software side has no errors but i don’t know if it works!!

                        How far apart should the centers of the 2 sensor pairs be from each other ultimately on the mirror frame??

                        Any help will be greatly appreciated
                        thank you
                        Denis

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 3 / 3
                        • 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