• 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-Navigate, Navigation inside MagicMirror with Rotary Encoder

Scheduled Pinned Locked Moved System
45 Posts 6 Posters 16.9k 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.
  • E Offline
    Eisblume
    last edited by Eisblume May 23, 2019, 12:12 PM May 23, 2019, 11:23 AM

    @AxLed
    Also after clean install with nothing more, the default modules and MMM-Navigate and MMM-Remote-Controll it doesn’t work.

    Here you can see: https://youtu.be/G2eRoPxRPjU

    Only when I remove ground, the press action works. But then, the cw and cww doesn’t work…

    1 Reply Last reply Reply Quote 0
    • A Offline
      AxLed Module Developer
      last edited by May 23, 2019, 7:20 PM

      @Eisblume
      Thanks for your reply, i tested at my pi with disconnected ground cable, but there is no press, cw or ccw working at all.
      My last ideas:

      • can you messure your 5 cables if maybe one is interrupted
      • maybe there are two versions of KY-040 on the marked, i have this one Amazon
      • is your second rotary encoder shows same symptoms?
      • did you connect + of rotary encoder to 5V once (which would be wrong and maybe damaged your GPIO PINs/chip)?

      AxLED

      1 Reply Last reply Reply Quote 0
      • E Offline
        Eisblume
        last edited by May 24, 2019, 5:53 AM

        @AxLed
        Do not think that I am lying ;-), but it works fine, when I start MagicMirror and after that I start the python - script from here https://github.com/martinohanlon/KY040.

        cw, cww and press works absolutely fine.

        It is very strange.

        1 Reply Last reply Reply Quote 0
        • E Offline
          Eisblume
          last edited by Eisblume May 24, 2019, 10:40 AM May 24, 2019, 7:01 AM

          @AxLed
          Ok, i fix it now for me.

          I know, it is a dirty code, but don’t found another solution :dizzy_face:

          I attached the KY040 python script in the node_helper.js. Then everything works fine.

          //node_helper.js
          /* Magic Mirror
           * Node Helper: {MMM-Navigate}
           *
           * By {AxLED}
           * {MIT} Licensed.
           */
          
           //Debugging
           //tail -f ~/.pm2/logs/mm-out-0.log
           //tail -f ~/.pm2/logs/mm-error-0.log 
          
          const Gpio = require('onoff').Gpio;
          ...
          const spawn = require("child_process").spawn;
          //Variables
          ...
            start: function() {
          		var self = this;
          		this.loaded = false;
          		var process = spawn("python", ["/home/pi/Downloads/KY040/examples/python3.py"]);
          	},
          	
          ...
          });
          
          
          1 Reply Last reply Reply Quote 0
          • A Offline
            AxLed Module Developer
            last edited by May 24, 2019, 6:34 PM

            @Eisblume
            No Problem, i am glad it works for you now, so you also did your first coding experiance.

            AxLED

            1 Reply Last reply Reply Quote 0
            • E Offline
              Eisblume
              last edited by May 25, 2019, 5:47 PM

              @AxLed
              Yes very interesting experiences :-) !

              Could you explain my how to start “Tagesschau in 100 Sekunden” in MMM-Navigate ??

              1 Reply Last reply Reply Quote 0
              • A Offline
                AxLed Module Developer
                last edited by May 25, 2019, 6:22 PM

                @Eisblume
                You need two things:

                • first: a modules which is able to stream 100Sec Tagesschau, i made a fork see MMM-Podcast2
                • second: the right config (i posting only the relevant part)
                ....
                {
                			module: 'MMM-Podcast2',
                			config: {
                				// See 'Configuration options' for more information.
                				omxargs: ' --win 0,0,1920,1080  -o both '
                			}
                		},
                {
                			module: "MMM-Navigate",
                			header: "Navigation",
                			position: "top_right",
                			config: {
                					Alias: [
                						'Tagesschau 100 Sekunden',
                						'Herunterfahren'
                					],
                					Action: [
                						{notification:'BUTTON_PRESSED',payload:''},
                						{notification: "REMOTE_ACTION", payload: {action: "SHUTDOWN"}}
                					],
                					GPIOPins: [26,20,19]//rotary cw, rotary ccw, rotary press (BCM Numbering)
                					},
                		},
                ...
                

                AxLED

                E 1 Reply Last reply May 25, 2019, 8:40 PM Reply Quote 0
                • E Offline
                  Eisblume @AxLed
                  last edited by May 25, 2019, 8:40 PM

                  @AxLed said in MMM-Navigate, Navigation inside MagicMirror with Rotary Encoder:

                  {notification:‘BUTTON_PRESSED’,payload:‘’},

                  Thanks. Works perfect !!!

                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    keineAhnung123
                    last edited by Jan 8, 2021, 5:08 PM

                    Hello @AxLed ,

                    Two things:

                    First

                    I have the same issue like @Eisblume :

                    The click doesnt work.
                    When i then start a sample code to test the rotary encoder (from like here), the click works in the sample code.
                    If i start the Magic Mirror after that again, then the click works there too.

                    Maybe there is a missing initialization of the rotary encoder in your code?

                    Second

                    Is there a possibility to get more config possibilities?
                    Like starting the module hidden or shortening the time of the hiding process?

                    Thanks in advance :)

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      AxLed Module Developer
                      last edited by Jan 8, 2021, 6:36 PM

                      @keineAhnung123,

                      to your first issue:

                      • is only click not working or is rotation also not working?
                        Because rotation and click (Button press) uses the same library (onOff).
                      • on which pin is click connected, as the pi GPIO Pins have different features?
                      • what versions you are using (pi, OS, MM-Version)?

                      To your second issue.

                      • MMM-Navigate uses the MM notification system, so you can do almost everything you want. What are you trying to to, maybe i can give you a sample for your config.js
                      • for shortening time of hidding see MM Docs -> search for hide, there is a parameter for speed.

                      Regards

                      AxLED

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