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

MMM-GoogleAssistant autostart

Scheduled Pinned Locked Moved Unsolved Troubleshooting
46 Posts 3 Posters 19.3k 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 Away
    sdetweil @poopyurinal
    last edited by May 17, 2019, 2:32 AM

    @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 May 17, 2019, 2:35 AM

      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 May 17, 2019, 2:42 AM Reply Quote 0
      • S Away
        sdetweil @poopyurinal
        last edited by May 17, 2019, 2:42 AM

        @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 May 17, 2019, 2:57 AM

          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 May 17, 2019, 3:51 AM Reply Quote 0
          • S Away
            sdetweil @poopyurinal
            last edited by sdetweil May 17, 2019, 3:51 AM May 17, 2019, 3:51 AM

            @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 May 18, 2019, 7:54 PM

              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 G 2 Replies Last reply May 18, 2019, 10:11 PM Reply Quote 0
              • S Away
                sdetweil @poopyurinal
                last edited by May 18, 2019, 10:11 PM

                @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
                • G Offline
                  gauravsacc Module Developer @poopyurinal
                  last edited by May 19, 2019, 2:12 AM

                  @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
                  • P Offline
                    poopyurinal
                    last edited by May 19, 2019, 2:51 AM

                    I just looked at them but am not sure of the implications of them. I was able to get my magicmirror to work with MMM-googleassistant with one command via command line:

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

                    Does that help make it easier to autostart in another script? Definitely beyond my abilities at this point. I definitely appreciate your continued effort!

                    S 1 Reply Last reply May 19, 2019, 3:52 AM Reply Quote 0
                    • S Away
                      sdetweil @poopyurinal
                      last edited by May 19, 2019, 3:52 AM

                      @poopyurinal said in MMM-GoogleAssistant autostart:

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

                      so, put that command as the 1st in the little script you wrote…
                      and the second command starts MM…

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 4 / 5
                      4 / 5
                      • First post
                        37/46
                        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