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.

    Voice Control using IBM's Watson

    Scheduled Pinned Locked Moved Development
    15 Posts 4 Posters 8.1k Views 4 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.
    • P Offline
      prostko
      last edited by prostko

      Hello guys, in school, and have chosen to make a Smart Mirror for our final project. Since none of us have really gotten to play with the pi before, we decided to download Magic Mirror and lean on the existing code base, and develop a new voice recognition module. We downloaded and configured the Watson conversation app, which is working well. We run it from the command line inside the modules folder, and have gotten the loader to recognize it on startup.

      Here’s my issue: im getting a 'Reference Error: require is not defined '…
      What I’m trying to do now is just run the thing in the background, listening for the hot word. (it can run from the command line with ‘node conversation’ )

      I have read about the node helper, but I’m finding that process very confusing…

      Thanks guys
      Great forum

      Here’s a link to my github, the conversation module I’m working on.
      edit : https://github.com/OniDotun123/MirrorMirror/tree/master/modules/conversation

      strawberry 3.141S M 2 Replies Last reply Reply Quote 0
      • cowboysdudeC Offline
        cowboysdude Module Developer
        last edited by

        Reference Error: require is not defined…

        The require npm model is loaded from the node_helper… I’m sure one of the REALLY great programmers here can point you in the right direction…

        1 Reply Last reply Reply Quote 1
        • strawberry 3.141S Offline
          strawberry 3.141 Project Sponsor Module Developer @prostko
          last edited by

          @prostko first of all you shouldn’t publish any password and usernames on github.

          the module.js in your case conversation.js gets imported into the browser. The browser can’t handle require that’s a node.js only functionality. Did you check the development guide? https://github.com/MichMich/MagicMirror/tree/master/modules or try looking on other modules how they are constructed.

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

          1 Reply Last reply Reply Quote 0
          • P Offline
            prostko
            last edited by prostko

            First - Thanks for taking the time to give it a look over.
            Oops, you’re right… changing that now…
            I’m checking out something that seems to be along the lines of what I’m trying to accomplish as well, https://github.com/dgonano/MMM-AlexaPi , which is just running the voice service on the mirror, as well as pouring over the Docs, but I seem to be unable to grasp the connection or purpose of the node_helper and module.js relationship.
            Also, for (because of my) simplicity, I’d like to focus on sending the speech picked up from the mic into the Watson STT api.
            You said that the browser can’t handle ‘require’, does that mean that node_helper is where we require things?
            So, if I’m catching up correctly,
            node_helper is where the requires happen(watson could service, npm mic…), the watson config(usrnme, psswrd, etc) to send along with the api request happens, and then finally the micInstance gets started, listening.
            Then, the audio gets piped to the api, and the response generated (text) gets handed to the module.js (conversation.js) in the form of sendSocketNotification, and receivedSocketNotification, which will then turn around and resend that same text to all the other modules.

            1 Reply Last reply Reply Quote 0
            • P Offline
              prostko
              last edited by

              Ok, so I’ve managed to get the magic mirror to recognize the new node_helper, and it will run on start of the Magic Mirror.
              https://github.com/OniDotun123/MirrorMirror/tree/watson_listen_on_startup/modules/conversation

              1 Reply Last reply Reply Quote 0
              • P Offline
                prostko
                last edited by

                YES!
                watson is listening on startup and and printing the text from speech into the console!!!
                YESSSSSS

                strawberry 3.141S 1 Reply Last reply Reply Quote 0
                • strawberry 3.141S Offline
                  strawberry 3.141 Project Sponsor Module Developer @prostko
                  last edited by

                  @prostko glad you did it. keep in mind that someone can browse an old commit/state of the repo so i hardly suggest to change the password at the specific services.

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

                  P 1 Reply Last reply Reply Quote 1
                  • P Offline
                    prostko
                    last edited by prostko

                    Attributing this success to aleyak’s super clean code here :
                    https://github.com/alexyak/voicecontrol
                    Very nice.

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      prostko @strawberry 3.141
                      last edited by

                      @strawberry-3.141 Oh crap, good call. Doing that now. Thanks again.

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        makssie @prostko
                        last edited by

                        @prostko Hi man, I would like to create one for my final project.

                        Could you help me?? Passing me your e-mail just to start.

                        Thanks :D

                        P 1 Reply Last reply Reply Quote 0
                        • P Offline
                          prostko @makssie
                          last edited by

                          @makssie Sure. How can I help

                          M 1 Reply Last reply Reply Quote 0
                          • M Offline
                            makssie @prostko
                            last edited by

                            @prostko Thanks for you disposition.

                            What are the crucial points to start this project? Are there a URL showing how to build one SmartMirror?

                            What was hard for you in your project? (for example : need to know about node.js)

                            Thanks again

                            P 1 Reply Last reply Reply Quote 0
                            • P Offline
                              prostko @makssie
                              last edited by

                              @makssie Yeah, so check out the github associated with this forum, it has great documentation and step by step instructions on how to get the mirror installed. There are a ton of videos on how to do this as well. Depending on your comfort level with Javascript, getting Watson to work on your machine will either be difficult or very, very difficult. I used Watson’s conversation app. Sticking points were acclimating to the raspberry pi itself, getting it properly configured. Then understanding the existing code base here. The module structure and everything. Then actually getting Watson to fit in there and respond with usable data. After that, it was smooth sailing.

                              M 1 Reply Last reply Reply Quote 0
                              • M Offline
                                makssie @prostko
                                last edited by

                                @prostko said in Voice Control using IBM’s Watson:

                                properly

                                Very Thanks

                                I really want to implement some watson’s functionality. Is it free? Where can I learn about it to implant on Raspberry?

                                P 1 Reply Last reply Reply Quote 0
                                • P Offline
                                  prostko @makssie
                                  last edited by

                                  @makssie Definitely free. Check out IBM’s Watson TJBot. It also has really great documentation and step by step tutorials.

                                  1 Reply Last reply Reply Quote 0

                                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                  With your input, this post could be even better 💗

                                  Register Login
                                  • 1 / 1
                                  • 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