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

Snowbound on node.js

Scheduled Pinned Locked Moved Solved Troubleshooting
11 Posts 3 Posters 3.1k Views 3 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.
  • S Offline
    sdetweil @grantc66
    last edited by Dec 12, 2018, 2:30 PM

    @grantc66 don’t see anything obvious. But there is also an on.error() callback for spawn you should use. If the running script has a problem

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    G 1 Reply Last reply Dec 12, 2018, 9:05 PM Reply Quote 0
    • ? Offline
      A Former User
      last edited by Dec 12, 2018, 3:07 PM

      There is already snowboy integrated module. (MMM-Hotword). I suggest not to re-invent wheels twice.
      You can emit notifications from MMM-Hotword to your module when your snowboy hotwords are detected. I think that is easier.

      G 1 Reply Last reply Dec 12, 2018, 9:01 PM Reply Quote 1
      • G Offline
        grantc66 @Guest
        last edited by Dec 12, 2018, 9:01 PM

        @sean said in Snowbound on node.js:

        MMM-Hotword

        Tried that, it works but its very slow to respond. With the python script, you can say the hotword and give it instructions seamlessly, passing notifications to seems to take forever to respond.

        What I’m trying to get to is understanding what node is doing with the python that stops external modules working & hopefully find away around it. Bit more of a learning exercise, if I can crack this it’ll open up my ability to expand the functionality.

        ? 1 Reply Last reply Dec 13, 2018, 8:21 AM Reply Quote 0
        • G Offline
          grantc66 @sdetweil
          last edited by Dec 12, 2018, 9:05 PM

          @sdetweil Thanks, had it in there for the pythonshell forgot about it on this version.

          Any pointers on trying exec, my googlefoo is failing to find any help.

          1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User @grantc66
            last edited by Dec 13, 2018, 8:21 AM

            @grantc66
            Of course, Choice is yours. I fully cheer for your trials to skill up.

            By the way, these things I want to point out;

            • Generally NodeJS is dozens of times faster than Python 3
            • Snowboy detection engine is somekind of compiled-binaries from C(C++?) The each language is using its own wrapper, but that is the only difference among them.

            I modified code to measure the time for catching sound, distinguishing hotword, then sending Notification to other modules.
            0_1544688788772_pi.png
            I executed 10 times. Range was 15ms ~ 100ms, Average was around 40ms. This might be not the exact and professional measuring. But I think this is hard to say “VERY SLOW” for real usage.

            Anyway, I wish you good luck. Leave the result of this approach, I have an interest also.

            G 1 Reply Last reply Dec 13, 2018, 12:26 PM Reply Quote 0
            • G Offline
              grantc66 @Guest
              last edited by grantc66 Dec 13, 2018, 4:56 PM Dec 13, 2018, 12:26 PM

              @sean Looks like I’ll be learning how to program in Java script :)

              Thanks for the tips.

              BTW: I found the issue with the python not running, seems the call from node changes the name of the script so main () had a different name to the import. Didn’t cure the snowboy issue (at least it got called, didn’t respond to wake word though 🤔, I’ll ask on the snowboy forum why that might be), but everything else worked.

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