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-GoogleAssistant autostart

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    46 Posts 3 Posters 31.6k 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.
    • P
      poopyurinal
      last edited by

      yes, the mirror app starts flawlessly with all installed modules. The assistant icon appears on the mirror, but is not activated by “Ok google” unless I type the commands in my OP. I believe pm2 is controlling the Mirror autostart.

      S 1 Reply Last reply
      Reply Quote 0
      • S
        sdetweil @poopyurinal
        last edited by

        @poopyurinal ok, but if yoiu start it manually does it work?

        pm2 stop MagicMirror
        open a terminal window (ctrl-alt-t)
        cd MagicMirror
        npm start

        does it all work?
        I don’t know assistant.py I assume it runs in the background… and somehow talks to the module…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply
        Reply Quote 0
        • S
          sdetweil
          last edited by

          and with mirror running on boot, press ctrl-shit-i to open the developers window, and select the console tab, and scroll up to find any module errors

          there is also a pm2 command to show its log… (I don’t use pm2 myself).

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply
          Reply Quote 0
          • S
            sdetweil @poopyurinal
            last edited by

            @poopyurinal said in MMM-GoogleAssistant autostart:

            I know that to start the module successfully, I can enter the following 3 commands:
            source env/bin/activate
            cd ~/MagicMirror/modules/MMM-GoogleAssistant/pi
            python3 assistant.py

            you are not starting the module… you are starting a background application
            that is included in the module folder

            the ‘module’ only runs inside the MagicMirror environment

            so, you need to create a command that does the startup…
            start the py and then start MM

            and then automate that

            if u stop MM manually and restart it (without doing the assistant.py step) do the GA work thru mirror as u expect?

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply
            Reply Quote 0
            • P
              poopyurinal
              last edited by

              pm2 stop MagicMirror gives me:

              [PM2][ERROR] Process MagicMirror not found
              ┌──────┬────┬──────┬────────┬───┬─────┬──────────┐
              │ Name │ id │ mode │ status │ ↺ │ cpu │ memory │
              ├──────┼────┼──────┼────────┼───┼─────┼──────────┤
              │ mm │ 0 │ fork │ online │ 1 │ 0% │ 2.5 MB │
              └──────┴────┴──────┴────────┴───┴─────┴──────────┘
              Use pm2 show <id|name> to get more details about an app

              Any thoughts? The MagicMirror is running. If I stop it by hitting Alt and closing it via the menu bar, it automatically restarts.

              S 1 Reply Last reply
              Reply Quote 0
              • S
                sdetweil @poopyurinal
                last edited by

                @poopyurinal pm2 list

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply
                Reply Quote 0
                • P
                  poopyurinal
                  last edited by

                  pm2 list
                  ┌──────┬────┬──────┬────────┬───┬─────┬──────────┐
                  │ Name │ id │ mode │ status │ ↺ │ cpu │ memory │
                  ├──────┼────┼──────┼────────┼───┼─────┼──────────┤
                  │ mm │ 0 │ fork │ online │ 1 │ 0% │ 2.5 MB │
                  └──────┴────┴──────┴────────┴───┴─────┴──────────┘
                  Use pm2 show <id|name> to get more details about an app

                  S 1 Reply Last reply
                  Reply Quote 0
                  • S
                    sdetweil @poopyurinal
                    last edited by

                    @poopyurinal pm2 stop mm

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply
                    Reply Quote 0
                    • P
                      poopyurinal
                      last edited by

                      pm2 stop mm
                      [PM2] Applying action stopProcessId on app [mm](ids: 0)
                      [PM2] mm ✓
                      ┌──────┬────┬──────┬─────────┬───┬─────┬────────┐
                      │ Name │ id │ mode │ status │ ↺ │ cpu │ memory │
                      ├──────┼────┼──────┼─────────┼───┼─────┼────────┤
                      │ mm │ 0 │ fork │ stopped │ 1 │ 0% │ 0 B │
                      └──────┴────┴──────┴─────────┴───┴─────┴────────┘
                      Use pm2 show <id|name> to get more details about an app

                      Sorry, limited by new user restriction of one post every 120 seconds

                      S 1 Reply Last reply
                      Reply Quote 0
                      • S
                        sdetweil @poopyurinal
                        last edited by

                        @poopyurinal cool now follow the link i gave about creating a service that will autostart and make it start the assitant.py

                        I don’t understand why the MMM-GoogleAssistant module doesn’t do this… it would be so easy…

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply
                        Reply Quote 0
                        • S
                          sdetweil
                          last edited by

                          in the link it asks for ‘your service name’ make that GoogleAssistant
                          the command is ‘/home/pi/MagicMirror/modulesMMM-GoogleAssistant/python3 assistant.py’

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply
                          Reply Quote 0
                          • S
                            sdetweil
                            last edited by sdetweil

                            once u create the service… make sure assistant.py is not running already

                            ps -ef | grep assistant 
                            

                            the 1st number on the output is the process id
                            pi xxxx yyyy etc…
                            then

                            sudo kill -9 xxxx
                            

                            then do

                            sudo systemctl start GoogleAssistant
                            

                            then

                            ps -ef | grep assistant 
                            

                            to insure assistant is running
                            then start mirror manually with npm start

                            if all is good, reboot

                            service will start the assistant.py script
                            and pm2 will start mirror app

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            1 Reply Last reply
                            Reply Quote 0
                            • P
                              poopyurinal
                              last edited by

                              Many thanks Sam! I’ll need to take a look at your suggestions tomorrow. I appreciate the quick (immediate!) help.

                              S 1 Reply Last reply
                              Reply Quote 0
                              • S
                                sdetweil @poopyurinal
                                last edited by

                                @poopyurinal no problem… let us know either way

                                i use the assistantmk2 module… don’t need that py file

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                1 Reply Last reply
                                Reply Quote 0
                                • P
                                  poopyurinal
                                  last edited by

                                  I’ll have to look at it. Tried the MM-GA module after 3+ failures of Alexa modules. Just would like one of them to work!

                                  S 1 Reply Last reply
                                  Reply Quote 0
                                  • S
                                    sdetweil @poopyurinal
                                    last edited by

                                    @poopyurinal also use the MMM-Alexa module

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    1 Reply Last reply
                                    Reply Quote 0
                                    • P
                                      poopyurinal
                                      last edited by

                                      Tried and failed with MMM-Alexa. Doesn’t mean I can’t try again!

                                      1 Reply Last reply
                                      Reply Quote 0
                                      • P
                                        poopyurinal
                                        last edited by

                                        Looking for some clarifications here. I tried Sam’s suggestion and created a GoogleAssistant.service in /etc/systemd/system. I am a little confused on the command though:

                                        ‘/home/pi/MagicMirror/modulesMMM-GoogleAssistant/python3 assistant.py’

                                        The assistant.py file is located in /home/pi/MagicMirror/modules/MMM-GoogleAssistant/pi. And wouldn’t the “python3” command come first? Could someone clarify?

                                        Then, continuing to follow this post, he suggested running:

                                        ps -ef | grep assistant

                                        to find the process id. However, when i try to kill that process id, is says it “No such process”. If I run the same command several times in a row, I get different process ids each time. Is it trying to run via some other pathway and retrying constantly? It wouldn’t surprise me, as I’ve tried to get this working via many methods. How can I track this down?

                                        Thanks for your help!

                                        S 1 Reply Last reply
                                        Reply Quote 0
                                        • S
                                          sdetweil @poopyurinal
                                          last edited by

                                          @poopyurinal you are right. python3 should come first.

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

                                          1 Reply Last reply
                                          Reply Quote 0
                                          • P
                                            poopyurinal
                                            last edited by

                                            Thanks for clarifying. Any idea on the process id changing with

                                            ps -ef | grep assistant

                                            ??

                                            S 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
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • 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