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 26.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.
    • P Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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 Offline
                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
                • S Offline
                  sdetweil @poopyurinal
                  last edited by sdetweil

                  @poopyurinal sounds like assistant is ending on its own.

                  When u do this manually, do you have to be in the module folder?

                  If you run the python3 path…/assistant.py

                  When u are NOT in the module folder, does it work, or give an error?

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

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

                    I can run the command:

                    python3 /home/pi/MagicMirror/modules/MMM-GoogleAssistant/pi/assistant.py

                    as long as I first run:

                    source /env/bin/activate

                    It works appropriately after running those two commands. Running the top command in this post without running the bottom command results in an error.

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

                      @poopyurinal ok, make a two line script to execute both commands, and use that script as the exec script in the service

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

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

                        Sorry, can you go into a little more detail on that? How would I create that script?

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

                          @poopyurinal edit a new file, add the two lines to it, and save.

                          The do

                          chmod +x ????
                          

                          Where ??? is the name of the file you just created

                          Then make that file name the name of the exec script.

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

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

                            Do you mean a shell script? Or a python script?

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

                              @poopyurinal shell script

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

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

                                In the ExecStart field of the service, what is the command I need to run before the path? My shell script is in /home/pi/testerscript.sh. What command do I need to run that?

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

                                  @poopyurinal edit the script again and add a new 1st line

                                  #!/bin/sh
                                  

                                  Because it is executable, the 1st line will be checked, and if the script processor is defined, it will be used

                                  The default is also /bin/sh

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

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

                                    I edited the script as you suggested, but it is not starting after reboot. If I run it from the command line, I get:

                                    pi@raspberrypi:~ $ /home/pi/testerscript.sh
                                    /home/pi/testerscript.sh: 2: /home/pi/testerscript.sh: source: not found
                                    Traceback (most recent call last):
                                    File “/home/pi/MagicMirror/modules/MMM-GoogleAssistant/pi/assistant.py”, line 25, in
                                    import google.oauth2.credentials
                                    ImportError: No module named ‘google’

                                    The part after the “Traceback” is the same error I got if I tried to run the /path/to/assistant.py without first running:

                                    source /env/bin/activate

                                    It seems like the shell script is not running the second command within the first. If I run source /env/bin/activate, my command line is preceded by (env). Is there some way to force that within the script?

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

                                      @poopyurinal the shell script cannot find the command ‘source’.

                                      so THAT is the 1st problem

                                      try changing line 1 to

                                      #!/bin/bash
                                      

                                      to use bash instead of sh
                                      I see the same problem here using sh

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

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

                                        Sorry for my delayed response, I didn’t have time to look into this yesterday.

                                        Now I get:

                                        /home/pi/testerscript.sh: line 2: /env/bin/activate: No such file or directory
                                        Traceback (most recent call last):
                                        File “/home/pi/MagicMirror/modules/MMM-GoogleAssistant/pi/assistant.py”, line 25, in
                                        import google.oauth2.credentials
                                        ImportError: No module named ‘google’

                                        S gauravsaccG 2 Replies Last reply Reply Quote 0
                                        • S Offline
                                          sdetweil @poopyurinal
                                          last edited by

                                          @poopyurinal I will have to work on this

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

                                          1 Reply Last reply Reply Quote 0
                                          • gauravsaccG Offline
                                            gauravsacc Module Developer @poopyurinal
                                            last edited by

                                            @poopyurinal Have you looked into all closed issues on the github? https://github.com/gauravsacc/MMM-GoogleAssistant/issues/1

                                            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