• 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.

What's the difference?

Scheduled Pinned Locked Moved Troubleshooting
15 Posts 2 Posters 6.9k Views 2 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.
  • M Offline
    Mykle1 Project Sponsor Module Developer
    last edited by Dec 23, 2017, 1:15 AM

    What’s the difference between these two? This is my guess. That sendSocketNotification communicates with the node_helper and that sendNotification broadcasts to all modules?

    Or, am I so wrong that you’re laughing at me? :-)

    Please shed some light on this for me. Thanks y’all!

    Peace!

    Create a working config
    How to add modules

    S 1 Reply Last reply Dec 23, 2017, 9:59 AM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @Mykle1
      last edited by Dec 23, 2017, 9:59 AM

      @Mykle1 thats correct.

      https://github.com/MichMich/MagicMirror/blob/master/modules/README.md#thissendnotificationnotification-payload

      https://github.com/MichMich/MagicMirror/blob/master/modules/README.md#thissendsocketnotificationnotification-payload

      Please create a github issue if you need help, so I can keep track

      M 2 Replies Last reply Dec 23, 2017, 1:38 PM Reply Quote 2
      • M Offline
        Mykle1 Project Sponsor Module Developer @strawberry 3.141
        last edited by Dec 23, 2017, 1:38 PM

        @strawberry-3.141

        Thank you, mate! :-)

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • M Offline
          Mykle1 Project Sponsor Module Developer @strawberry 3.141
          last edited by Dec 24, 2017, 5:26 PM

          @strawberry-3.141

          I spent a day with the docs that you suggested and I successfully broadcast a notification from MMM-voice using this.sendNotification('HIDE_LUCY'). I successfully received that notification in MMM-EasyPix (test module) this way:

          if (notification === 'HIDE_LUCY') {
              MM.getModules().enumerate((module) => {
                          module.hide(1000);
                      });
          

          However, this resulted in ALL modules being hidden, not just MMM-EasyPix, which was my intention. I then tried
          moduleA.show(0, {force: true});

          if (notification === 'HIDE_LUCY') {
              MMM-EasyPix.hide(0, {force: true});
          

          and

          if (notification === 'HIDE_LUCY') {
              module_0_MMM-EasyPix.hide(0, {force: true});
          

          Nothing changed.

          module_0_MMM-EasyPix I got from examining the elements in dev console. MMM-voice in these trials is module_6_MMM-voice.

          I then removed all edits to MMM-EasyPix. Instead of trying to have MMM-EasyPix hide itself when it receives a notification, I tried to have MMM-voice hide MMM-EasyPix directly using moduleA.hide(0, {lockString: "module_b_identifier"});. One is commented out but both do not work as expected

          else if (notification === 'HIDE_LUCY') {
              //    MMM-EasyPix.hide(0, {lockString: "module_6_MMM-voice"});
                    module_0_MMM-EasyPix.hide(0, {lockString: "module_6_MMM-voice"});    
                  }
          

          I know I’m going about it the wrong way. That’s painfully obvious, but I thought if I could get it to work then I would continue to find a more efficient way of doing it.

          MMM-voice works amazingly well on some laptops that I’m experimenting with. It very intelligently added “LUCY” to the words.json file and the MMM-voice.dic file automatically. I determined this was done in the node_helper via the generateDicLM() and fs.writeFile() functions when all I did was add ‘HIDE LUCY’ and ‘SHOW LUCY’ to the sentences array. Fantastic!

          And lastly, the only other modification I made was to the socketNotificationReceived function of the MMM-voice.js file here

          else if (notification === 'HIDE_MODULES') {
                      MM.getModules().enumerate((module) => {
                          module.hide(1000);
                      });
                  } else if (notification === 'SHOW_MODULES') {
                      MM.getModules().enumerate((module) => {
                          module.show(1000);
                      });
          

          and here

          else if (notification === 'HIDE_LUCY') {
              //    MMM-EasyPix.hide(0, {lockString: "module_6_MMM-voice"});
                    module_0_MMM-EasyPix.hide(0, {lockString: "module_6_MMM-voice"});    
                  }
                  
                  else if (notification === 'SHOW_LUCY') {
               //     MMM-EasyPix.show(0, {lockString: "module_6_MMM-voice"});
                      module_0_MMM-EasyPix.show(0, {lockString: "module_6_MMM-voice"});
                  }
          

          So, if you care to give me some pointers, or point me in the right direction, or simply point out my mistakes so that I might try to correct them, I would greatly and humbly appreciate it. :-)

          Peace!

          Create a working config
          How to add modules

          S 1 Reply Last reply Dec 24, 2017, 11:52 PM Reply Quote 0
          • S Offline
            strawberry 3.141 Project Sponsor Module Developer @Mykle1
            last edited by Dec 24, 2017, 11:52 PM

            @Mykle1 just do that in easypix

            if (notification === 'HIDE_LUCY') {
                this.hide(1000);
            }
            

            Please create a github issue if you need help, so I can keep track

            M 3 Replies Last reply Dec 25, 2017, 12:35 PM Reply Quote 1
            • M Offline
              Mykle1 Project Sponsor Module Developer @strawberry 3.141
              last edited by Mykle1 Dec 25, 2017, 12:36 PM Dec 25, 2017, 12:35 PM

              @strawberry-3.141 said in What’s the difference?:

              just do that in easypix

              Success! :-)

              Now I plan to do it the right way. I’ll take another look at the DEVELOPER document and learn how to properly register my modules with MMM-voice.

              Thank you!

              Peace!

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 0
              • M Offline
                Mykle1 Project Sponsor Module Developer @strawberry 3.141
                last edited by Dec 26, 2017, 3:36 AM

                @strawberry-3.141

                Is there any way to run the bash dependencies.sh command on a Windows machine? I see that it requires sudo, which Windows does not have, so the installation fails immediately.

                Create a working config
                How to add modules

                1 Reply Last reply Reply Quote 0
                • M Offline
                  Mykle1 Project Sponsor Module Developer @strawberry 3.141
                  last edited by Jan 1, 2018, 3:28 AM

                  @strawberry-3.141

                  This is what I tried to get MMM-voice working under windows:
                  I successfully installed MMM-voice on a laptop that is running ubuntu. It works just fine there. So I copied the MMM-voice folder, the pocketsphinx folder and the sphinxbase folder from the ubuntu machine and pasted them in their respective directories on the Windows machine. I did get an “initializing” message once before getting the dreaded “ERROR” message. I tried microphone: 2, (numbers 1 thru 5) but all failed.

                  Anyway, if there is a way to install this under Windows I would really appreciate some direction. Thanks.

                  Peace!

                  Create a working config
                  How to add modules

                  S 1 Reply Last reply Jan 1, 2018, 4:15 PM Reply Quote 0
                  • S Offline
                    strawberry 3.141 Project Sponsor Module Developer @Mykle1
                    last edited by Jan 1, 2018, 4:15 PM

                    @Mykle1 never tried to install it on windows, you need ti install all dependencies manually if they even exist for windows, then make sure when they get used that the path etc is correct

                    Please create a github issue if you need help, so I can keep track

                    M 2 Replies Last reply Jan 1, 2018, 4:17 PM Reply Quote 1
                    • M Offline
                      Mykle1 Project Sponsor Module Developer @strawberry 3.141
                      last edited by Jan 1, 2018, 4:17 PM

                      @strawberry-3.141

                      Ok, thanks. I’m looking into that right now

                      Create a working config
                      How to add modules

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        10/15
                        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