• 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
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-GroveGestures

Scheduled Pinned Locked Moved System
51 Posts 8 Posters 18.9k Views 12 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.
  • B Offline
    Benjaminh86 @Guest
    last edited by Mar 23, 2019, 5:58 PM

    @Sean as I said, I’m a beginner, and I do not understand everything in programming.
    In addition, I have a synthaxe error on the line “exec: (module, gestures) => {”
    it indicates a problem with the symbol =>.
    Can you help me?

    ? 2 Replies Last reply Mar 23, 2019, 6:11 PM Reply Quote 0
    • ? Offline
      A Former User @Benjaminh86
      last edited by Mar 23, 2019, 6:11 PM

      @Benjaminh86
      Show me your configuration.

      B 1 Reply Last reply Mar 23, 2019, 6:16 PM Reply Quote 0
      • B Offline
        Benjaminh86 @Guest
        last edited by Mar 23, 2019, 6:16 PM

        @Sean

        here is my configuration for your module :

        {
        module: “MMM-GroveGestures”,
        position: “top_right”,
        pages: {‘all’: ‘top_right’},
        config: {
        autoStart: true, //When Mirror starts, recognition will start.
        verbose:false, // If set as true, useful messages will be logged.
        recognitionTimeout: 1000, //Gesture sequence will be ended after this time from last recognized gesture.
        cancelGesture: “WAVE”, //If set, You can cancel gesture sequence with this gesture.
        visible: true, //Recognized gesture sequence will be displayed on position

        idleTimer: 1000*60*30, // `0` for disable, After this time from last gesture, onIdle will be executed.
        onIdle: { // See command section
          moduleExec: {
            module: [],
            exec: (module, gestures) => {
              module.hide(1000, null, {lockstring:"GESTURE"})
        	}
             }
              },
        onDetected: {
          notificationExec: {
            notification: "GESTURE_DETECTED",
          },
          /* You can make Mirror to wake up the modules which were hidden by onIdle with any gestures.
          moduleExec: {
            module: [],
            exec: (module) => {
              module.show(1000, null, {lockstring:"GESTURE"})
            }
          }
          */
        },
        
        gestureMapFromTo: { //When your sensor is installed with rotated direction, you can calibrate with this.
          "Up": "UP",
          "Down": "DOWN",
          "Left": "LEFT",
          "Right": "RIGHT",
          "Forward": "FORWARD",
          "Backward": "BACKWARD",
          "Clockwise": "CLOCKWISE",
          "anti-clockwise": "ANTICLOCKWISE",
          "wave": "WAVE"
        },
        commandSet: {
             "LEFT": {
        	notificationExec: {
        		notification: "PAGE_SELECT",
        		payload: "main",
        	}
             },
              "RIGHT": {
        	notificationExec: {
        		notification: "PAGE_SELECT",
        		payload: "2",
              }
            },
          },
        },
        

        }
        },

        ? 1 Reply Last reply Mar 23, 2019, 6:21 PM Reply Quote 0
        • ? Offline
          A Former User @Benjaminh86
          last edited by Mar 23, 2019, 6:21 PM

          @Benjaminh86
          Your configuration about commandSet has something wrong.

          commandSet: {
            "default" : {
              "LEFT": {
                notificationExec: {
                  notification: "PAGE_SELECT",
                  payload: "main",
                }
              },
              "RIGHT": {
                notificationExec: {
                  notification: "PAGE_SELECT",
                  payload: "2",
                }
              },
            },
          },
          
          1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User @Benjaminh86
            last edited by Mar 23, 2019, 6:23 PM

            @Benjaminh86
            And Have you syntax error? How did you know? Have you used npm check:config? That knows old-fashioned style javascript grammar. So it might not understand new trendy ES6 style grammar.
            Try this to check your javascript syntax.
            http://esprima.org/demo/validate.html

            B 2 Replies Last reply Mar 23, 2019, 6:26 PM Reply Quote 0
            • B Offline
              Benjaminh86 @Guest
              last edited by Mar 23, 2019, 6:26 PM

              @Sean

              I used the command “npm run config: check”

              1 Reply Last reply Reply Quote 0
              • B Offline
                Benjaminh86 @Guest
                last edited by Mar 23, 2019, 8:06 PM

                @Sean I modified my JavaScript and corrected the errors.
                On my Magic Mirror, I can see my left right scan, but the page does not change.
                an idea…

                ? 1 Reply Last reply Mar 23, 2019, 8:09 PM Reply Quote 0
                • ? Offline
                  A Former User @Benjaminh86
                  last edited by A Former User Mar 24, 2019, 12:39 AM Mar 23, 2019, 8:09 PM

                  @Benjaminh86
                  Well, If notification would be emitted properly, remains are MMM-page-selector’s business.
                  You can check whether notification is broadcasted well with npm start dev (before it, stop your pm2) or Ctrl+Shift+i on MM running. You can get some useful messages on dev-console

                  B 1 Reply Last reply Mar 25, 2019, 7:59 AM Reply Quote 0
                  • B Offline
                    Benjaminh86 @Guest
                    last edited by Mar 25, 2019, 7:59 AM

                    Hello @Sean
                    i will watch npm start dev.
                    Thanks for your help.

                    BenH

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      bolish
                      last edited by Mar 25, 2019, 8:18 AM

                      Hi @Benjaminh86

                      If it can help you, this is how I’m dealing with it :

                      • I uses MMM-GroveGestures / MMM-Pages / MMM-Pages indicator / MMM-Notificationtrigger

                      MMM-Pages allows PAGE_INCREMENT / PAGE_DECREMENT notification reception.
                      MMM-Pages is allow able to send you the active page number back is you ask for QUERY_PAGE_NUMBER.

                      So basically, in MMM-GroveGesture , I wanted specific gestures depending on the active page :

                      • I’ve created one command set per page (1/2/3/4/5)

                      • I’ve put PAGE_INCREMENT / DECREMENT as a default gesture (left / right) on all commands sets (as those one are always the same)

                      • I’ve put specific up / down / etc… gestures and related notification in different commands set depending on the page.

                      • I’ve added a specific fire into MMM-NotificationTrigger so that each time “PAGE INCREMENT / DECREMENT” is triggered, it also fires “PAGE NUMBER IS” back (thanks to “PAGE_QUERY_NUMBER”)

                      This way, MMM-GrovesGestures always knows on which page I’m and is using the proper command set.

                      Hope this will help you.

                      B 1 Reply Last reply Mar 25, 2019, 9:26 AM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 2 / 6
                      2 / 6
                      • First post
                        11/51
                        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