gauravsacc / MMM-GoogleAssistant

Google Assistant module for magic mirror https://github.com/MichMich/MagicMirror
MIT License
117 stars 40 forks source link

Attempting to run assistant.py after boot #40

Open Naoki95957 opened 6 years ago

Naoki95957 commented 6 years ago

I'm not exactly sure what is going on here. I had a hard time with the instructions and I don't really have any input/output transactions going on with pubnub and MagicMirror. That being said I had some success following the readme and am trying to at least keep the python script running so that google assistant is usable.

However this has me confused and I'm just seeking advice at this point:

pi@raspberrypi3:~ $ chmod +x assistant.py 
pi@raspberrypi3:~ $ sudo python ./assistant.py 
pubnub subscription completed
[FATAL:audio_input_stream.cc(47)] Input device could not be opened: default
Aborted
pi@raspberrypi3:~ $ sudo ./assistant.py 
pubnub subscription completed
[FATAL:audio_input_stream.cc(47)] Input device could not be opened: default
Aborted
pi@raspberrypi3:~ $ python assistant.py
pubnub subscription completed
No handlers could be found for logger "pubnub"

(The last one is in working order)

I actually get the same thing running the script in either python 2 or 3...

Everything works and I have no issues with arecord/aplay so I'm not sure what the audio error is either.

I'm just having issues automating it. I don't want to have to explicitly go through this every time I start the mirror

gauravsacc commented 6 years ago

Are you able to run the sample correctly? https://developers.google.com/assistant/sdk/prototype/getting-started-pi-python/run-sample

Axachi commented 6 years ago

Yes this works for me.. All google assistant works .. Bu I get another error . Iport error No Mudule named google.outh2.credentials ??

nikhil-gupta89 commented 5 years ago

@Axach, configure the OAuth consent screen for your project in the Cloud Platform Console - https://developers.google.com/assistant/sdk/guides/library/python/embed/config-dev-project-and-account And it should work fine.

Hope it helps.

Naoki95957 commented 5 years ago

I had the same for sometime. Unfortunately I really don't remember what I did @Axachi. Sometimes I ran into an issue with it and VNC too tho. Whether it was truly multiple instances running or whatever idk because I had it attempt roughly 5 times with 10s between attempts (to wait for a wifi connection).

I noticed sometimes it would be running yet the terminal would show errors for me as if it failed. I got it fixed and I honestly don't remember completely what I did. My problem for some oddball reason was that in boot it would very inconsistently run. But when I ran the python script in terminal, I never had an issue.

I think I ended up going root and executing the program in a "rc.local" (as root) to open the terminal, then in file ".bashrc" I added the execution for the py script. It was just strange that it was 2-step for me and I could never get it to run in the "rc.local". I never got the complete module working but like a Google home speaker, display isn't really necessary. The mirror was a gift so I don't really have it on me to check what I did.

GregoryRohmer commented 5 years ago

Hi all,

I just installed GA and it works fine, I just am getting stuck at the integration of the module and GA. Does anyone have more details on the edit of assistant.py? I'm getting the following error when i execute it:

pi@raspberrypi:~/MagicMirror/modules/MMM-GoogleAssistant/pi $ python ./assistant.py Traceback (most recent call last): File "./assistant.py", line 31, in from pubnub.callbacks import SubscribeCallback ImportError: No module named pubnub.callbacks

thanks in advance for any help!

varadwattamwar commented 3 years ago

Hi all,

I just installed GA and it works fine, I just am getting stuck at the integration of the module and GA. Does anyone have more details on the edit of assistant.py? I'm getting the following error when i execute it:

pi@raspberrypi:~/MagicMirror/modules/MMM-GoogleAssistant/pi $ python ./assistant.py Traceback (most recent call last): File "./assistant.py", line 31, in from pubnub.callbacks import SubscribeCallback ImportError: No module named pubnub.callbacks

thanks in advance for any help!

Install Pubnub before: pip install 'pubnub>=4.0.13' Hope this works for you