Closed nkchokshi closed 4 years ago
I need to know the branch you are using. Did you make any changes to the project files ?
I need to know the branch you are using. Did you make any changes to the project files ?
I am using this same branch GassistPi. which you showed on youtube as well. I havent made any changes. I have now installed MagicMirror, but this one i have tried before installing magicmirror.
Please help. thank you for replay.
run the following commands and paste the output here.
source env/bin/activate
pip3 freeze
Me too facing same amounts of errors while turning on service manually. Automatically service is still not being start
I think i found the cause of all that errors. i manually go into the /home/pi/gassistpi/requriments path and ran ./Gassistpi-pip-req.txt and found that many of pip files were no installed. I'll try to install them manually one by one with the exact same version.
run the following commands and paste the output here.
source env/bin/activate pip3 freeze
pi@raspberrypi:~ $ pip3 freeze appdirs==1.4.3 asn1crypto==0.24.0 astroid==2.1.0 asttokens==1.1.13 automationhat==0.2.0 beautifulsoup4==4.7.1 blinker==1.4 blinkt==0.1.2 buttonshim==0.0.2 Cap1xxx==0.1.3 certifi==2018.8.24 chardet==3.0.4 Click==7.0 colorama==0.3.7 colorzero==1.1 cookies==2.2.1 cryptography==2.6.1 cycler==0.10.0 decorator==4.3.0 devscripts==2.19.5+deb10u1 docutils==0.14 drumhat==0.1.0 entrypoints==0.3 envirophat==1.0.0 ExplorerHAT==0.4.2 Flask==1.0.2 fourletterphat==0.1.0 gpg==1.12.0 gpiozero==1.5.1 guizero==0.6.0 html5lib==1.0.1 idna==2.6 ipykernel==4.9.0 ipython==5.8.0 ipython-genutils==0.2.0 isort==4.3.4 itsdangerous==0.24 jedi==0.13.2 Jinja2==2.10 jupyter-client==5.2.3 jupyter-core==4.4.0 keyring==17.1.1 keyrings.alt==3.1.1 kiwisolver==1.0.1 lazy-object-proxy==1.3.1 logilab-common==1.4.2 lxml==4.3.2 MarkupSafe==1.1.0 matplotlib==3.0.2 mccabe==0.6.1 microdotphat==0.2.1 mote==0.0.4 motephat==0.0.3 mypy==0.670 mypy-extensions==0.4.1 nudatus==0.0.4 numpy==1.16.2 oauthlib==2.1.0 olefile==0.46 pantilthat==0.0.7 parso==0.3.1 pexpect==4.6.0 pgzero==1.2 phatbeat==0.1.1 pianohat==0.1.0 picamera==1.13 pickleshare==0.7.5 picraft==1.0 piglow==1.2.5 pigpio==1.44 Pillow==5.4.1 prompt-toolkit==1.0.15 psutil==5.5.1 PyAudio==0.2.11 pycairo==1.16.2 pycodestyle==2.4.0 pycrypto==2.6.1 pyflakes==2.0.0 pygame==1.9.4.post1 Pygments==2.3.1 PyGObject==3.30.4 pyinotify==0.9.6 PyJWT==1.7.0 pylint==2.2.2 pyOpenSSL==19.0.0 pyparsing==2.2.0 pyserial==3.4 python-apt==1.8.4.1 python-dateutil==2.7.3 python-debian==0.1.35 python-magic==0.4.16 pyxdg==0.25 pyzmq==17.1.2 qtconsole==4.3.1 rainbowhat==0.1.0 requests==2.21.0 requests-oauthlib==1.0.0 responses==0.9.0 roman==2.0.0 RPi.GPIO==0.7.0 RTIMULib==7.2.1 scrollphat==0.0.7 scrollphathd==1.2.1 SecretStorage==2.3.1 semver==2.0.1 Send2Trash==1.5.0 sense-emu==1.1 sense-hat==2.2.0 simplegeneric==0.8.1 simplejson==3.16.0 six==1.12.0 skywriter==0.0.7 sn3218==1.2.7 soupsieve==1.8 spidev==3.4 ssh-import-id==5.7 thonny==3.2.6 tornado==5.1.1 touchphat==0.0.1 traitlets==4.3.2 twython==3.7.0 typed-ast==1.3.1 uflash==1.2.4 unicornhathd==0.0.4 unidiff==0.5.4 urllib3==1.24.1 wcwidth==0.1.7 webencodings==0.5.1 Werkzeug==0.14.1 wrapt==1.10.11 pi@raspberrypi:~ $
Can you please follow the instructions. ? you have not run the first command.
I think i found the cause of all that errors. i manually go into the /home/pi/gassistpi/requriments path and ran ./Gassistpi-pip-req.txt and found that many of pip files were no installed. I'll try to install them manually one by one with the exact same version.
RPi.GPIO is not a part of the requirements file. Its installed separately. Installation issues are to be reported with the terminal contents. Even after emphasizing so many times the necessity to stick to issue template, nobody bothers to listen.
I think i found the cause of all that errors. i manually go into the /home/pi/gassistpi/requriments path and ran ./Gassistpi-pip-req.txt and found that many of pip files were no installed. I'll try to install them manually one by one with the exact same version.
RPi.GPIO is not a part of the requirements file. Its installed separately. Installation issues are to be reported with the terminal contents. Even after emphasizing so many times the necessity to stick to issue template, nobody bothers to listen.
Hi I am sorry i am not giving you much info as i am not into much coding, so i have followed exact steps as you showed on youtube. I have not defined, or customized any install options to either enable GPIO or not. or have installed separately.
(env) pi@raspberrypi:~/GassistPi $ source env/bin/activate (env) pi@raspberrypi:~/GassistPi $ pip3 freeze pkg-resources==0.0.0 (env) pi@raspberrypi:~/GassistPi $
this is what i have received from the command you asked. I have formatted Raspberry and installed again, but no luck, same error appearing.
pip3 freeze has yeilded nothing. There is no assistant installed either. Did you get an authentication link ? Did you authenticate ? Golden rule of thumb is to follow the README document.
Sid i have tried and installed it 3 times. i am ending up with same error. I did get auth. code and and after manually adding command to run script i am getting error of GPIO. i have done same way man. If you want i can post a screen shot now on for your reference.
RUn the following commands and post the output:
cd /home/pi/
ls
cd /home/pi/env/
ls
cd /home/pi/env/lib/python3.7/
ls
I really need to see the terminal contents from your installation step.
Are you using the 64 bit version of OS or the usual 32 bit version ?
RUn the following commands and post the output:
cd /home/pi/ ls cd /home/pi/env/ ls cd /home/pi/env/lib/python3.7/ ls
I really need to see the terminal contents from your installation step.
Are you using the 64 bit version of OS or the usual 32 bit version ?
pi@raspberrypi:~ $ cd /home/pi/
pi@raspberrypi:~ $ ls Bookshelf MagicMirror client_secret_562010175920-96vpo5fmeoa9rhg5meo54unnuormejk7.apps.googleusercontent.com.json modelid.txt Desktop Music Documents Pictures Downloads Public env Templates GassistPi Videos install.log
pi@raspberrypi:~ $ cd /home/pi/env/ pi@raspberrypi:~/env $ ls bin etc include lib LICENSE pyvenv.cfg share
pi@raspberrypi:~/env $ cd /home/pi/env/lib/python3.7/ pi@raspberrypi:~/env/lib/python3.7 $ ls site-packages
pi@raspberrypi:~/env/lib/python3.7 $
I am using Raspberry pi 32 bit normal version.
give me the output of:
cd /home/pi/env/lib/python3.7/site-packages/
ls
give me the output of:
cd /home/pi/env/lib/python3.7/site-packages/ ls
cd /home/pi/env/lib/python3.7/site-packages/ pi@raspberrypi:~/env/lib/python3.7/site-packages $ ls Adafruit_IO adafruit_io-2.1.dist-info aftership aftership-1.0.post2.dist-info apiclient appdirs-1.4.4.dist-info appdirs.py argparse-1.4.0.dist-info argparse.py asn1crypto asn1crypto-1.4.0.dist-info beautifulsoup4-4.9.1.dist-info bs4 bs4-0.0.1.dist-info cachetools cachetools-4.1.1.dist-info casttube casttube-0.2.1.dist-info certifi certifi-2020.6.20.dist-info cffi cffi-1.14.1.dist-info _cffi_backend.cpython-37m-arm-linux-gnueabihf.so chardet chardet-3.0.4.dist-info click click-6.7.dist-info colorzero colorzero-1.1.dist-info Cryptodome cryptography cryptography-2.4.2.dist-info dateutil decorator-4.4.2.dist-info decorator.py easy_install.py enum enum34-1.1.10.dist-info ez_setup.py feedparser-5.2.1.dist-info feedparser.py futures-3.1.1.dist-info gmusicapi gmusicapi-13.0.0.dist-info google googleapiclient google_api_core-1.22.0.dist-info google_api_core-1.22.0-py3.8-nspkg.pth google_api_python_client-1.10.0.dist-info googleapis_common_protos-1.52.0.dist-info googleapis_common_protos-1.52.0-py3.8-nspkg.pth google_assistant_grpc-0.2.1.dist-info google_assistant_grpc-0.2.1-py2.7-nspkg.pth google_assistant_library-1.1.0.dist-info google_assistant_library-1.1.0-py2.7-nspkg.pth google_assistant_sdk-0.6.0.dist-info google_assistant_sdk-0.6.0-py3.5-nspkg.pth google_auth-1.20.0.dist-info google_auth-1.20.0-py3.8-nspkg.pth google_auth_httplib2-0.0.4.dist-info google_auth_httplib2.py google_auth_oauthlib google_auth_oauthlib-0.4.1.dist-info google_cloud_speech-0.36.0.dist-info google_cloud_speech-0.36.0-py3.6-nspkg.pth google_cloud_texttospeech-0.3.0.dist-info google_cloud_texttospeech-0.3.0-py3.6-nspkg.pth googlesamples googletrans googletrans-2.3.0.dist-info gpiozero gpiozero-1.5.1.dist-info gpiozerocli gpsoauth gpsoauth-0.4.1.dist-info grpc grpcio-1.30.0.dist-info gtts gTTS-2.0.2.dist-info gtts_token gTTS_token-1.1.3.dist-info httplib2 httplib2-0.18.1.dist-info idna idna-2.10.dist-info ifaddr ifaddr-0.1.7.dist-info kodijson kodi_json-1.0.0.dist-info lxml lxml-4.5.2.dist-info magic.py mechanicalsoup MechanicalSoup-0.12.0.dist-info mock mock-3.0.5.dist-info mutagen mutagen-1.45.0.dist-info numpy numpy-1.19.1.dist-info oauth2client oauth2client-4.1.3.dist-info oauthlib oauthlib-3.1.0.dist-info OpenSSL pafy pafy-0.5.5.dist-info paho paho_mqtt-1.4.0.dist-info pathlib2 pathlib2-2.3.5.dist-info pip pip-20.2.dist-info pkg_resources pkg_resources-0.0.0.dist-info _portaudio.cpython-37m-arm-linux-gnueabihf.so proboscis proboscis-1.2.6.0.dist-info protobuf-3.12.2.dist-info protobuf-3.12.2-nspkg.pth psutil psutil-5.7.2.dist-info pushbullet pushbullet.py-0.11.0.dist-info pyasn1 pyasn1-0.4.8.dist-info pyasn1_modules pyasn1_modules-0.2.8.dist-info PyAudio-0.2.11.dist-info pyaudio.py pycache pychromecast PyChromecast-7.1.2.dist-info pycparser pycparser-2.20.dist-info pycryptodomex-3.7.2.dist-info pyOpenSSL-19.1.0.dist-info python_dateutil-2.8.1.dist-info python_magic-0.4.18.dist-info python_vlc-3.0.11115.dist-info pytz pytz-2020.1.dist-info PyYAML-3.13.dist-info requests requests-2.24.0.dist-info requests_oauthlib requests_oauthlib-1.3.0.dist-info RPi RPi.GPIO-0.6.3.dist-info rsa rsa-4.6.dist-info setuptools setuptools-49.2.0.dist-info six-1.15.0.dist-info six.py sounddevice-0.3.15.dist-info _sounddevice.py sounddevice.py soupsieve soupsieve-2.0.1.dist-info spidev-3.5.dist-info spidev.cpython-37m-arm-linux-gnueabihf.so spotipy spotipy-2.13.0.dist-info tenacity tenacity-4.12.0.dist-info uritemplate uritemplate-3.0.1.dist-info urllib3 urllib3-1.25.10.dist-info validictory validictory-1.1.2.dist-info vlc.py websocket websocket_client-0.57.0.dist-info wheel wheel-0.34.2.dist-info yaml youtube_dl youtube_dl-2020.7.28.dist-info zeroconf zeroconf-0.28.0.dist-info pi@raspberrypi:~/env/lib/python3.7/site-packages $
Here in this line https://github.com/shivasiddharth/GassistPi/blob/1b9ef1b5dae7ae3b2e3e19ad473de0f625c348e1/src/actions.py#L46
add the following
print(GPIO)
now run the assistant and share the output
Here in this line
add the following
print(GPIO)
now run the assistant and share the output
INFO:gmusicapi.Mobileclient1:failed to authenticate
Traceback (most recent call last):
File "/home/pi/GassistPi/src/main.py", line 51, in
Post the contents of your actions.py script.
from kodijson import Kodi, PLAYER_VIDEO from googleapiclient.discovery import build from googleapiclient.errors import HttpError from oauth2client.tools import argparser from spotipy.oauth2 import SpotifyClientCredentials import spotipy.util as util import spotipy.oauth2 as oauth2 from pushbullet import Pushbullet from mediaplayer import api from youtube_search_engine import google_cloud_api_key from googletrans import Translator from youtube_search_engine import youtube_search from youtube_search_engine import youtube_stream_link from google.cloud import texttospeech from gtts import gTTS import requests import mediaplayer import os import os.path try: import RPi.GPIO as GPIO except Exception as e: if str(e) == 'No module named \'RPi\'': GPIO = None import time import re import subprocess import aftership import feedparser import json import urllib.request import pafy import pychromecast import spotipy import pprint import yaml
ROOT_PATH = os.path.realpath(os.path.join(file, '..', '..')) USER_PATH = os.path.realpath(os.path.join(file, '..', '..','..'))
print(GPIO) with open('{}/src/config.yaml'.format(ROOT_PATH),'r', encoding='utf8') as conf: configuration = yaml.load(conf)
with open('{}/src/lang.yaml'.format(ROOT_PATH),'r', encoding='utf8') as lang: langlist = yaml.load(lang)
TTSChoice='' if configuration['TextToSpeech']['Choice']=="Google Cloud": if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): if configuration['TextToSpeech']['Google_Cloud_TTS_Credentials_Path']!="ENTER THE PATH TO YOUR TTS CREDENTIALS FILE HERE": os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = configuration['TextToSpeech']['Google_Cloud_TTS_Credentials_Path'] TTSChoice='GoogleCloud'
client = texttospeech.TextToSpeechClient()
else:
print("Set the path to your Google cloud text to speech credentials in the config.yaml file. Using gTTS for now.....")
TTSChoice='GTTS'
else:
TTSChoice='GoogleCloud'
# Instantiates a client
client = texttospeech.TextToSpeechClient()
else: TTSChoice='GTTS'
domoticz_devices='' Domoticz_Device_Control=False bright='' hexcolour=''
if 'en' in configuration['Language']['Choice']: keywordfile= '{}/src/keywords_en.yaml'.format(ROOT_PATH) elif 'it' in configuration['Language']['Choice']: keywordfile= '{}/src/keywords_it.yaml'.format(ROOT_PATH) elif 'fr' in configuration['Language']['Choice']: keywordfile= '{}/src/keywords_fr.yaml'.format(ROOT_PATH) elif 'de' in configuration['Language']['Choice']: keywordfile= '{}/src/keywords_de.yaml'.format(ROOT_PATH) elif 'es' in configuration['Language']['Choice']: keywordfile= '{}/src/keywords_es.yaml'.format(ROOT_PATH) elif 'nl' in configuration['Language']['Choice']: keywordfile= '{}/src/keywords_nl.yaml'.format(ROOT_PATH) elif 'sv' in configuration['Language']['Choice']: keywordfile= '{}/src/keywords_sv.yaml'.format(ROOT_PATH) else: keywordfile= '{}/src/keywords_en.yaml'.format(ROOT_PATH) with open(keywordfile,'r' , encoding='utf8') as conf: custom_action_keyword = yaml.load(conf)
if configuration['Domoticz']['Domoticz_Control']=='Enabled': Domoticz_Device_Control=True try: domoticz_response = requests.get("https://" + configuration['Domoticz']['Server_IP'][0] + ":" + configuration['Domoticz']['Server_port'][0] + "/json.htm?type=devices&filter=all&order=Name",verify=False) domoticz_devices=json.loads(domoticz_response.text) with open('{}/domoticz_device_list.json'.format(USER_PATH), 'w') as devlist: json.dump(domoticz_devices, devlist) except requests.exceptions.ConnectionError: print("Domoticz server not online") else: Domoticz_Device_Control=False
Spotify_credentials=False Youtube_credentials=False if configuration['Spotify']['client_id']!= 'ENTER YOUR SPOTIFY CLIENT ID HERE' and configuration['Spotify']['client_secret']!='ENTER YOUR SPOTIFY CLIENT SECRET HERE': Spotify_credentials=True if configuration['Google_cloud_api_key']!='ENTER-YOUR-GOOGLE-CLOUD-API-KEY-HERE': Youtube_credentials=True
if Spotify_credentials: client_id = configuration['Spotify']['client_id'] client_secret = configuration['Spotify']['client_secret'] username=configuration['Spotify']['username'] credentials = oauth2.SpotifyClientCredentials(client_id=client_id, client_secret=client_secret) spotify_token = credentials.get_access_token()
vlcplayer=mediaplayer.vlcplayer()
song_ids=[] track_ids=[]
kodiurl=("http://"+str(configuration['Kodi']['ip'])+":"+str(configuration['Kodi']['port'])+"/jsonrpc") kodi = Kodi(kodiurl, configuration['Kodi']['username'], configuration['Kodi']['password']) musicdirectory=configuration['Kodi']['musicdirectory'] videodirectory=configuration['Kodi']['videodirectory'] windowcmd=configuration['Kodi']['windowcmd'] window=configuration['Kodi']['window']
if GPIO!=None: GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False)
var = configuration['Raspberrypi_GPIO_Control']['lightnames']
gpio = configuration['Gpios']['picontrol']
for pin in gpio:
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, 0)
#Servo pin declaration
servopin=configuration['Gpios']['servo'][0]
GPIO.setup(servopin, GPIO.OUT)
pwm=GPIO.PWM(servopin, 50)
pwm.start(0)
#Stopbutton
stoppushbutton=configuration['Gpios']['stopbutton_music_AIY_pushbutton'][0]
GPIO.setup(stoppushbutton, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIOcontrol=True
else: GPIOcontrol=False
stnname=configuration['Radio_stations']['stationnames'] stnlink=configuration['Radio_stations']['stationlinks'] stnradio=configuration['Radio_stations']['stationradio']
ip=configuration['ESP']['IP']
devname=configuration['ESP']['devicename'] devid=configuration['ESP']['deviceid']
playshell = None
clrlist=[] clrlistfullname=[] clrrgblist=[] clrhexlist=[] with open('{}/src/colours.json'.format(ROOT_PATH), 'r') as col: colours = json.load(col) for i in range(0,len(colours)): clrname=colours[i]["name"] clrnameshort=clrname.replace(" ","",1) clrnameshort=clrnameshort.strip() clrnameshort=clrnameshort.lower() clrlist.append(clrnameshort) clrlistfullname.append(clrname) clrrgblist.append(colours[i]["rgb"]) clrhexlist.append(colours[i]["hex"])
number = '' slug=''
worldnews = "http://feeds.bbci.co.uk/news/world/rss.xml" technews = "http://feeds.bbci.co.uk/news/technology/rss.xml" topnews = "http://feeds.bbci.co.uk/news/rss.xml" sportsnews = "http://feeds.feedburner.com/ndtvsports-latest" quote = "http://feeds.feedburner.com/brainyquote/QUOTEBR"
translator = Translator() femalettsfilename="/tmp/female-say.mp3" malettsfilename="/tmp/male-say.wav" ttsfilename="/tmp/gcloud.mp3" language=configuration['Language']['Choice'] translanguage=language.split('-')[0] gender='' if configuration['TextToSpeech']['Voice_Gender']=='Male' and translanguage=='en': gender='Male' elif translanguage=='it': gender='Male' elif configuration['TextToSpeech']['Voice_Gender']=='Male' and translanguage!='en': gender='Female' else: gender='Female'
if configuration['Pushbullet']['Pushbullet_API_KEY']!='ENTER YOUR PUSHBULLET KEY HERE': pb=Pushbullet(configuration['Pushbullet']['Pushbullet_API_KEY']) else: pb=None
def kickstrater_search(query): service = build("customsearch", "v1", developerKey=google_cloud_api_key) res = service.cse().list( q=query, cx = '012926744822728151901:gefufijnci4', ).execute() return res
def gaana_search(query): service = build("customsearch", "v1", developerKey=google_cloud_api_key) res = service.cse().list( q=query, cx = '012926744822728151901:jzpzbzih5hi', ).execute() return res
def gttssay(phrase,saylang,specgender): tts = gTTS(text=phrase, lang=saylang) tts.save(femalettsfilename) if specgender=='Male': os.system('sox ' + femalettsfilename + ' ' + malettsfilename + ' pitch -450') os.remove(femalettsfilename) os.system('aplay ' + malettsfilename) os.remove(malettsfilename) elif specgender=='Female': os.system("mpg123 "+femalettsfilename) os.remove(femalettsfilename)
def gcloudsay(phrase,lang): try: if gender=='Male': gcloudgender=texttospeech.enums.SsmlVoiceGender.MALE else: gcloudgender=texttospeech.enums.SsmlVoiceGender.FEMALE
synthesis_input = texttospeech.types.SynthesisInput(text=phrase)
voice = texttospeech.types.VoiceSelectionParams(
language_code=lang,
ssml_gender=gcloudgender)
audio_config = texttospeech.types.AudioConfig(
audio_encoding=texttospeech.enums.AudioEncoding.MP3)
response = client.synthesize_speech(synthesis_input, voice, audio_config)
with open(ttsfilename, 'wb') as out:
out.write(response.audio_content)
if gender=='Male' and lang=='it-IT':
os.system('sox ' + ttsfilename + ' ' + malettsfilename + ' pitch -450')
os.remove(ttsfilename)
os.system('aplay ' + malettsfilename)
os.remove(malettsfilename)
else:
os.system("mpg123 "+ttsfilename)
os.remove(ttsfilename)
except google.api_core.exceptions.ResourceExhausted:
print("Google cloud text to speech quota exhausted. Using GTTS. Make sure to change the choice in config.yaml")
gttssay(phrase,lang)
def trans(words,destlang,srclang): transword= translator.translate(words, dest=destlang, src=srclang) transword=transword.text transword=transword.replace("Text, ",'',1) transword=transword.strip() print(transword) return transword
def say(words,sourcelang=None,destinationlang=None): if sourcelang!=None and destinationlang!=None: sayword=trans(words,destinationlang,sourcelang) gttssay(sayword,destinationlang,'Female') else: if sourcelang==None: sourcelanguage='en' else: sourcelanguage=sourcelang if sourcelanguage!=translanguage: sayword=trans(words,translanguage,sourcelanguage) else: sayword=words if TTSChoice=='GoogleCloud': gcloudsay(sayword,language) elif TTSChoice=='GTTS': gttssay(sayword,translanguage,gender)
def getcolours(phrase): usrclridx=idx=phrase.find(custom_action_keyword['Dict']['To']) usrclr=query=phrase[usrclridx:] usrclr=usrclr.replace(custom_action_keyword['Dict']['To'],"",1) usrclr=usrclr.replace("'","",1) usrclr=usrclr.replace("}","",1) usrclr=usrclr.strip() usrclr=usrclr.replace(" ","",1) usrclr=usrclr.lower() print(usrclr) try: for colournum, colourname in enumerate(clrlist): if usrclr in colourname: RGB=clrrgblist[colournum] red,blue,green=re.findall('\d+', RGB) hexcode=clrhexlist[colournum] cname=clrlistfullname[colournum] print(cname) break return red,blue,green,hexcode,cname except UnboundLocalError: say("Sorry unable to find a matching colour")
def convert_rgb_xy(red,green,blue): try: red = pow((red + 0.055) / (1.0 + 0.055), 2.4) if red > 0.04045 else red / 12.92 green = pow((green + 0.055) / (1.0 + 0.055), 2.4) if green > 0.04045 else green / 12.92 blue = pow((blue + 0.055) / (1.0 + 0.055), 2.4) if blue > 0.04045 else blue / 12.92 X = red 0.664511 + green 0.154324 + blue 0.162028 Y = red 0.283881 + green 0.668433 + blue 0.047685 Z = red 0.000088 + green 0.072310 + blue * 0.986039 x = X / (X + Y + Z) y = Y / (X + Y + Z) return x,y except UnboundLocalError: say("No RGB values given")
def notify_tts(phrase): word=(custom_action_keyword['Keywords']['notify_TTS'][0]).lower() voice_notify = phrase.replace(word, "") voice_notify.strip() say(voice_notify)
def radio(phrase): conv = None for num, name in reversed(list(enumerate(stnname))): if name.lower() in phrase: station=stnlink[num] conv=stnradio[num] print (station) break if conv is not None: say("Tuning into " + conv) vlcplayer.media_manager(station,'Radio') vlcplayer.media_player(station) else: say("Station not found")
def ESP(phrase): for num, name in enumerate(devname): if name.lower() in phrase: dev=devid[num] if custom_action_keyword['Dict']['On'] in phrase: ctrl='=ON' say("Turning On " + name) elif custom_action_keyword['Dict']['Off'] in phrase: ctrl='=OFF' say("Turning Off " + name) rq = requests.head("http://"+ip + dev + ctrl)
def SetAngle(angle): if GPIOcontrol: duty = angle/18 + 2 GPIO.output(servopin, True) say("Moving motor by " + str(angle) + " degrees") pwm.ChangeDutyCycle(duty) time.sleep(1) pwm.ChangeDutyCycle(0) GPIO.output(servopin, False) else: say("GPIO controls, is not supported for your device.")
def stop(): vlcplayer.stop_vlc()
def track(): text=parcelapi.trackings.get(tracking=dict(slug=slug, tracking_number=number)) numtrack=len(text['trackings']) print("Total Number of Parcels: " + str(numtrack)) if numtrack==0: parcelnotify=("You have no parcel to track") say(parcelnotify) elif numtrack==1: parcelnotify=("You have one parcel to track") say(parcelnotify) elif numtrack>1: parcelnotify=( "You have " + str(numtrack) + " parcels to track") say(parcelnotify) for x in range(0,numtrack): numcheck=len(text[ 'trackings'][x]['checkpoints']) description = text['trackings'][x]['checkpoints'][numcheck-1]['message'] parcelid=text['trackings'][x]['tracking_number'] trackinfo= ("Parcel Number " + str(x+1)+ " with tracking id " + parcelid + " is "+ description) say(trackinfo)
def feed(phrase): if 'world news' in phrase: URL=worldnews elif 'top news' in phrase: URL=topnews elif 'sports news' in phrase: URL=sportsnews elif 'tech news' in phrase: URL=technews elif (custom_action_keyword['Keywords']['RSS'][1]).lower() in phrase: URL=quote numfeeds=10 feed=feedparser.parse(URL) feedlength=len(feed['entries']) print(feedlength) if feedlength<numfeeds: numfeeds=feedlength title=feed['feed']['title'] say(title) if GPIOcontrol:
while GPIO.input(stoppushbutton):
for x in range(0,numfeeds):
content=feed['entries'][x]['title']
print(content)
say(content)
summary=feed['entries'][x]['summary']
print(summary)
say(summary)
if not GPIO.input(stoppushbutton):
break
if x == numfeeds-1:
break
else:
continue
else:
print("GPIO controls, is not supported for your device. You need to wait for feeds to automatically stop")
recivernum=configuration['Clickatell']['Reciever'] clickatell_api=configuration['Clickatell']['Clickatell_API']
def sendClickatell(number, message): response=requests.get('https://platform.clickatell.com/messages/http/send?apiKey=' + clickatell_api + '&to=' + number + '&content=' + message) if response.status_code == 202: say("SMS message sent") else: say("Error sending SMS message. Check your settings")
def sendSMS(query): if clickatell_api != 'ENTER_YOUR_CLICKATELL_API': for num, name in enumerate(configuration['Clickatell']['Name']): if name.lower() in query: conv=recivernum[num] command=(custom_action_keyword['Keywords']['Send_sms_clickatell'][0]).lower() msg=query.replace(command, "") message=msg.replace(name.lower(), "") message=message.strip() print(message + " , " + name + " , " + conv) say("Sends SMS message " + message + " to " + name) sendClickatell(conv, message) else: say("You need to enter Clickatell API")
def mutevolstatus(): status= kodi.Application.GetProperties({"properties": ("volume","muted")}) mutestatus=(status["result"]["muted"]) volstatus=(status["result"]["volume"]) return mutestatus, volstatus
def kodi_youtube(query): urlid = youtube_search(query) if urlid is not None: fullurl = "https://www.youtube.com/watch?v=" + urlid
kodi.Player.open(item={"file":"plugin://plugin.video.youtube/?action=play_video&videoid=" + urlid})
say("Playing YouTube video on Kodi")
def kodialbum(query): albumcontents=[] directories=[] kodi.Playlist.Clear(playlistid=0) songs=kodi.AudioLibrary.GetSongs({ "limits": { "start" : 0, "end": 200 }, "properties": [ "artist", "duration", "album", "track" ], "sort": { "order": "ascending", "method": "track", "ignorearticle": True } }) numsongs=len(songs["result"]["songs"]) print(songs) files=kodi.Files.GetDirectory({"directory": musicdirectory, "media": "music"}) print(files) numfiles=len(files["result"]["files"]) for a in range(0,numfiles): if (files["result"]["files"][a]["filetype"])=="directory": folder=files["result"]["files"][a]["file"] musicfiles=kodi.Files.GetDirectory({"directory": folder, "media": "music"}) print(musicfiles) nummusicfiles=len(musicfiles["result"]["files"]) numsongs=len(songs["result"]["songs"]) for i in range(0,numsongs): if query.lower() in str(songs["result"]["songs"][i]["album"]).lower(): for j in range(0,nummusicfiles): name=musicfiles["result"]["files"][j]["label"] if str(songs["result"]["songs"][i]["label"]).lower() in str(name).lower(): path=musicfiles["result"]["files"][j]["file"] albumcontents.append(songs["result"]["songs"][i]["label"]) kodi.Playlist.Add(playlistid=0, item={"file": path})
elif (files["result"]["files"][a]["filetype"])=="file":
for i in range(0,numsongs):
if query.lower() in str(songs["result"]["songs"][i]["album"]).lower():
name=files["result"]["files"][a]["label"]
if str(songs["result"]["songs"][i]["label"]).lower() in str(name).lower():
path=files["result"]["files"][a]["file"]
albumcontents.append(songs["result"]["songs"][i]["label"])
kodi.Playlist.Add(playlistid=0, item={"file": path})
if len(albumcontents)!=0:
print(albumcontents)
playinginfo=("Playing "+str(len(albumcontents))+" tracks from album "+query)
print(playinginfo)
say(playinginfo)
kodi.Player.open(item={"playlistid": 0},options={"repeat": "all"})
else:
print("Sorry, I could not find tracks from that album")
say("Sorry, I could not find tracks from that album")
def albumretrieve(query): i=0 Albumnames=[] Albums=kodi.AudioLibrary.GetAlbums({ "limits": { "start" : 0, "end": 200 }, "properties": ["playcount", "artist", "genre", "rating", "thumbnail", "year", "mood", "style"], "sort": { "order": "ascending", "method": "album", "ignorearticle": True } }) numalbums=len(Albums["result"]["albums"]) for i in range(0,numalbums): Albumnames.append(Albums["result"]["albums"][i]["label"]) if str(Albums["result"]["albums"][i]["label"]).lower() in str(query).lower(): reqalbum=(Albums["result"]["albums"][i]["label"]) break else: reqalbum="" if reqalbum!="": print(Albumnames) print(reqalbum) feedback=("Album, "+reqalbum+" found") print(feedback) say(feedback) kodialbum(reqalbum)#Calling the function to fetch tracks from the album else: print('Sorry, I could not find that album. But, here is a list of other vailable albums') say("Sorry, I could not find that album. But, here is a list of other vailable albums") for i in range(0,numalbums): Albumname=str(Albums["result"]["albums"][i]["label"]) print(Albumname) say(Albumname)
def kodiartist(query): artistcontents=[] directories=[] kodi.Playlist.Clear(playlistid=0) songs=kodi.AudioLibrary.GetSongs({ "limits": { "start" : 0, "end": 200 }, "properties": [ "artist", "duration", "album", "track" ], "sort": { "order": "ascending", "method": "track", "ignorearticle": True } }) numsongs=len(songs["result"]["songs"]) print(songs) files=kodi.Files.GetDirectory({"directory": musicdirectory, "media": "music"}) print(files) numfiles=len(files["result"]["files"]) for a in range(0,numfiles): if (files["result"]["files"][a]["filetype"])=="directory": folder=files["result"]["files"][a]["file"] musicfiles=kodi.Files.GetDirectory({"directory": folder, "media": "music"}) print(musicfiles) nummusicfiles=len(musicfiles["result"]["files"]) numsongs=len(songs["result"]["songs"]) for i in range(0,numsongs): if query.lower() in str(songs["result"]["songs"][i]["artist"]).lower(): for j in range(0,nummusicfiles): name=musicfiles["result"]["files"][j]["label"] if str(songs["result"]["songs"][i]["label"]).lower() in str(name).lower(): path=musicfiles["result"]["files"][j]["file"] artistcontents.append(songs["result"]["songs"][i]["label"]) kodi.Playlist.Add(playlistid=0, item={"file": path})
elif (files["result"]["files"][a]["filetype"])=="file":
for i in range(0,numsongs):
if query.lower() in str(songs["result"]["songs"][i]["artist"]).lower():
name=files["result"]["files"][a]["label"]
if str(songs["result"]["songs"][i]["label"]).lower() in str(name).lower():
path=files["result"]["files"][a]["file"]
artistcontents.append(songs["result"]["songs"][i]["label"])
kodi.Playlist.Add(playlistid=0, item={"file": path})
if len(artistcontents)!=0:
print(artistcontents)
if len(artistcontents)==1:
playinginfo=("Playing "+str(len(artistcontents))+" track rendered by "+query)
else:
playinginfo=("Playing "+str(len(artistcontents))+" tracks rendered by "+query)
print(playinginfo)
say(playinginfo)
kodi.Player.open(item={"playlistid": 0},options={"repeat": "all"})
else:
print("Sorry, I could not find tracks rendered by that artist")
say("Sorry, I could not find tracks rendered by that artist")
def singleplaykodi(query): kodi.Playlist.Clear(playlistid=0) i=0 idx=query.find(custom_action_keyword['Dict']['Play']) track=query[idx:] track=track.replace("}", "",1) track=track.replace("'", "",1) track = track.replace(custom_action_keyword['Dict']['Play'],'',1) track = track.replace((custom_action_keyword['Keywords']['Kodi_actions'][0]),'',1) track=track.strip() say("Searching for your file") if 'song'.lower() in str(track).lower() or 'track'.lower() in str(track).lower() or 'audio'.lower() in str(track).lower(): if 'song'.lower() in str(track).lower(): track = track.replace('song','',1) elif 'track'.lower() in str(track).lower(): track = track.replace('track','',1) elif 'audio'.lower() in str(track).lower(): track = track.replace('audio','',1) track=track.strip() musicfiles=kodi.Files.GetDirectory({"directory": musicdirectory, "media": "music"}) nummusicfiles=len(musicfiles["result"]["files"]) print("Total number of files: "+ str(nummusicfiles)) for a in range(0,nummusicfiles): if (musicfiles["result"]["files"][a]["filetype"])=="directory": folder=musicfiles["result"]["files"][a]["file"] files=kodi.Files.GetDirectory({"directory": folder, "media": "music"}) numfiles=len(files["result"]["files"]) for i in range(0,numfiles): name=files["result"]["files"][i]["label"] if str(track).lower() in str(name).lower(): print('Matching file found') path=files["result"]["files"][i]["file"] print(path) say("Playing "+name+" song") kodi.Player.open(item={"file": path}) elif (musicfiles["result"]["files"][a]["filetype"])=="file": name=musicfiles["result"]["files"][a]["label"] if str(track).lower() in str(name).lower(): print('Matching file found') path=musicfiles["result"]["files"][a]["file"] print(path) say("Playing "+name+" song") kodi.Player.open(item={"file": path})
elif 'movie'.lower() in str(track).lower() or 'video'.lower() in str(track).lower():
track = track.replace('movie','',1)
track=track.strip()
videofiles=kodi.Files.GetDirectory({"directory": videodirectory, "media": "video"})
numvideofiles=len(videofiles["result"]["files"])
print(videofiles)
print("Total number of files: "+ str(numvideofiles))
for a in range(0,numvideofiles):
if (videofiles["result"]["files"][a]["filetype"])=="directory":
folder=videofiles["result"]["files"][a]["file"]
files=kodi.Files.GetDirectory({"directory": folder, "media": "video"})
print(files)
numfiles=len(files["result"]["files"])
for i in range(0,numfiles):
name=files["result"]["files"][i]["label"]
if str(track).lower() in str(name).lower():
print('Matching file found')
path=files["result"]["files"][i]["file"]
print(path)
say("Playing "+name+" movie")
kodi.Player.open(item={"file": path})
elif (videofiles["result"]["files"][a]["filetype"])=="file":
name=videofiles["result"]["files"][a]["label"]
if str(track).lower() in str(name).lower():
print('Matching file found')
path=videofiles["result"]["files"][a]["file"]
print(path)
say("Playing "+name+" movie")
kodi.Player.open(item={"file": path})
else:
say("Sorry, I am unable to help you with that now")
def whatisplaying(): players=kodi.Player.GetActivePlayers() print(players) if players["result"]==[]: say("Stop kidding, will you?") else: playid=players["result"][0]["playerid"] typeplaying=players["result"][0]["type"] if typeplaying=="video" and playid==1: currentvid=kodi.Player.GetItem({ "properties": ["title", "album", "artist", "season", "episode", "duration", "showtitle", "tvshowid", "thumbnail", "file", "fanart", "streamdetails"], "playerid": 1 }) print(currentvid["result"]["item"]["title"]) playingcontent=("Movie titled, "+(currentvid["result"]["item"]["title"])+", is currently playing") print(playingcontent) say(playingcontent) elif typeplaying=="audio" and playid==0: currentaud=kodi.Player.GetItem({ "properties": ["title", "album", "artist", "duration", "thumbnail", "file", "fanart", "streamdetails"], "playerid": 0 }) print(currentaud["result"]["item"]["title"]) print(currentaud["result"]["item"]["album"]) if (currentaud["result"]["item"]["album"]) !=[] and (currentaud["result"]["item"]["album"]) !=str("") and (currentaud["result"]["item"]["artist"])!=[] and (currentaud["result"]["item"]["artist"])!=str(""): playingcontent=("Song titled, '"+(currentaud["result"]["item"]["title"])+"', from the album "+(currentaud["result"]["item"]["album"])+", by "+str((currentaud["result"]["item"]["artist"][0]))+", is currently playing") print(playingcontent) say(playingcontent) else: playingcontent=("Song titled, "+(currentaud["result"]["item"]["title"])+", is currently playing") print(playingcontent) say(playingcontent) else: print("Is anything even playing") say("Is anything even playing ?")
def shufflekodi(): directories=[] kodi.Playlist.Clear(playlistid=0) files=kodi.Files.GetDirectory({"directory": musicdirectory, "media": "music"}) numfiles=len(files["result"]["files"]) for a in range(0,numfiles): if (files["result"]["files"][a]["filetype"])=="directory": directories.append(files["result"]["files"][a]["file"]) elif (files["result"]["files"][a]["filetype"])=="file": path=files["result"]["files"][a]["file"] kodi.Playlist.Add(playlistid=0, item={"file": path}) for i in range(0,len(directories)): folder=directories[i] songs=kodi.Files.GetDirectory({"directory": folder, "media": "music"}) numsongs=len(songs["result"]["files"]) for j in range(0,numsongs): path=songs["result"]["files"][j]["file"] kodi.Playlist.Add(playlistid=0, item={"file": path}) kodi.Player.open(item={"playlistid": 0},options={"repeat": "all"}) players=kodi.Player.GetActivePlayers() playid=players["result"][0]["playerid"] kodi.Player.SetShuffle({"playerid":playid,"shuffle":True}) say("Shuffling your music")
def kodiactions(phrase): if 'youtube'.lower() in str(phrase).lower(): query=str(phrase).lower() idx=query.find(custom_action_keyword['Dict']['Play']) track=query[idx:] track=track.replace("}", "",1) track=track.replace("'", "",1) track = track.replace(custom_action_keyword['Dict']['Play'],'',1) track = track.replace((custom_action_keyword['Keywords']['Kodi_actions'][0]),'',1) if 'youtube'.lower() in track: track=track.replace('youtube','',1) elif 'video'.lower() in track: track=track.replace('video','',1) else: track=track.strip() print(track) say("Fetching YouTube links for, "+track) kodi_youtube(track) elif 'what'.lower() in str(phrase).lower() and 'playing'.lower() in str(phrase).lower(): whatisplaying() elif custom_action_keyword['Dict']['Play'].lower() in str(phrase).lower() and (custom_action_keyword['Dict']['Album']).lower() in str(phrase).lower(): albumretrieve(phrase) elif custom_action_keyword['Dict']['Play'].lower() in str(phrase).lower() and (custom_action_keyword['Dict']['Artist']).lower() in str(phrase).lower(): query=str(phrase).lower() idx = query.find(custom_action_keyword['Dict']['Artist']) artist = query[idx:] artist = artist.replace("'", "",1) artist = artist.replace("}", "",1) artist = artist.replace(custom_action_keyword['Dict']['Artist'],'',1) artist = artist.replace((custom_action_keyword['Keywords']['Kodi_actions'][0]),'',1) artist = artist.strip() say("Searching for renditions") kodiartist(artist) elif custom_action_keyword['Dict']['Play'].lower() in str(phrase).lower() and ('audio'.lower() in str(phrase).lower() or 'movie'.lower() in str(phrase).lower() or 'song'.lower() in str(phrase).lower() or 'video'.lower() in str(phrase).lower() or 'track'.lower() in str(phrase).lower()): singleplaykodi(phrase) elif 'shuffle'.lower() in str(phrase).lower() and ('audio'.lower() in str(phrase).lower() or 'song'.lower() in str(phrase).lower() or 'track'.lower() in str(phrase).lower() or 'music'.lower() in str(phrase).lower()): shufflekodi() elif 'repeat'.lower() in str(phrase).lower(): players=kodi.Player.GetActivePlayers() playid=players["result"][0]["playerid"] if 'this'.lower() in str(phrase).lower() or 'one'.lower() in str(phrase).lower() or str(1).lower() in str(phrase).lower(): kodi.Player.SetRepeat({"playerid": playid,"repeat": "one"}) elif 'all'.lower() in str(phrase).lower(): kodi.Player.SetRepeat({"playerid": playid,"repeat": "all"}) elif (custom_action_keyword['Dict']['Off']).lower() in str(phrase).lower() or 'disable'.lower() in str(phrase).lower() or 'none'.lower() in str(phrase).lower(): kodi.Player.SetRepeat({"playerid": playid,"repeat": "off"}) elif 'turn'.lower() in str(phrase).lower() and 'shuffle'.lower() in str(phrase).lower(): players=kodi.Player.GetActivePlayers() playid=players["result"][0]["playerid"] cmd=str(phrase).lower() cmd=cmd.replace((custom_action_keyword['Keywords']['Kodi_actions'][0]),'',1) cmd=cmd.strip() if (custom_action_keyword['Dict']['On']).lower() in str(cmd).lower(): kodi.Player.SetShuffle({"playerid": playid,"shuffle":True}) print('Turning on shuffle') elif (custom_action_keyword['Dict']['Off']).lower() in str(cmd).lower(): kodi.Player.SetShuffle({"playerid": playid,"shuffle":False}) print('Turning off shuffle') elif custom_action_keyword['Dict']['Play'].lower() in str(phrase).lower() and 'next'.lower() in str(phrase).lower() or ('audio'.lower() in str(phrase).lower() or 'video'.lower() in str(phrase).lower() or 'movie'.lower() in str(phrase).lower() or 'song'.lower() in str(phrase).lower() or 'track'.lower() in str(phrase).lower()): players=kodi.Player.GetActivePlayers() playid=players["result"][0]["playerid"] kodi.Player.GoTo({"playerid":playid,"to":"next"}) elif custom_action_keyword['Dict']['Play'].lower() in str(phrase).lower() and 'previous'.lower() in str(phrase).lower() or ('audio'.lower() in str(phrase).lower() or 'video'.lower() in str(phrase).lower() or 'movie'.lower() in str(phrase).lower() or 'song'.lower() in str(phrase).lower() or 'track'.lower() in str(phrase).lower()): players=kodi.Player.GetActivePlayers() playid=players["result"][0]["playerid"] kodi.Player.GoTo({"playerid":playid,"to":"previous"}) elif 'scroll'.lower() in str(phrase).lower(): players=kodi.Player.GetActivePlayers() playid=players["result"][0]["playerid"] if 'back'.lower() in str(phrase).lower() or 'backward'.lower() in str(phrase).lower(): if 'a bit'.lower() in str(phrase).lower() or 'little'.lower() in str(phrase).lower(): kodi.Player.Seek({ "playerid": playid, "value": "smallbackward" }) else: kodi.Player.Seek({ "playerid": playid, "value": "bigbackward" }) elif 'front'.lower() in str(phrase).lower() or 'forward'.lower() in str(phrase).lower(): if 'a bit'.lower() in str(phrase).lower() or 'little'.lower() in str(phrase).lower(): kodi.Player.Seek({ "playerid": playid, "value": "smallforward" }) else: kodi.Player.Seek({ "playerid": playid, "value": "bigforward" }) elif (custom_action_keyword['Dict']['Set']).lower() in str(phrase).lower() and 'volume'.lower() in str(phrase).lower(): for s in re.findall(r'\b\d+\b', phrase): kodi.Application.SetVolume({"volume": int(s)}) with open('{}/.volume.json'.format(USER_PATH), 'w') as f: json.dump(int(s), f) elif 'toggle mute'.lower() in str(phrase).lower(): status=mutevolstatus() if status[0]==False: kodi.Application.SetMute({"mute": True}) say("Muting Kodi") elif status[0]==True: kodi.Application.SetMute({"mute": False}) say("Disabling mute on Kodi") elif 'get'.lower() in str(phrase).lower() and 'volume'.lower() in str(phrase).lower(): status=mutevolstatus() vollevel=status[1] say("Currently, Kodi's volume is set at: "+str(vollevel)) elif 'go to'.lower() in str(phrase).lower() or 'open'.lower() in str(phrase).lower(): for num, name in enumerate(windowcmd): if name.lower() in str(phrase).lower(): activwindow=window[num] kodi.GUI.ActivateWindow({"window": activwindow}) elif 'pause'.lower() in str(phrase).lower(): players=kodi.Player.GetActivePlayers() if players["result"]==[]: say("There is nothing playing") else: playid=players["result"][0]["playerid"] kodi.Player.PlayPause({"playerid": playid,"play": False}) elif 'resume'.lower() in str(phrase).lower(): players=kodi.Player.GetActivePlayers() if players["result"]==[]: say("There is nothing playing") else: playid=players["result"][0]["playerid"] kodi.Player.PlayPause({"playerid": playid,"play": True}) elif 'stop'.lower() in str(phrase).lower(): players=kodi.Player.GetActivePlayers() if players["result"]==[]: say("There is nothing playing") else: playid=players["result"][0]["playerid"] kodi.Player.Stop({"playerid": playid}) elif 'move'.lower() in str(phrase).lower() or 'show'.lower(): if 'left'.lower() in str(phrase).lower(): kodi.Input.Left() elif 'right'.lower() in str(phrase).lower(): kodi.Input.Right() elif 'up'.lower() in str(phrase).lower(): kodi.Input.Up() elif 'down'.lower() in str(phrase).lower(): kodi.Input.Down() elif 'back'.lower() in str(phrase).lower(): kodi.Input.Back() elif 'select'.lower() in str(phrase).lower(): kodi.Input.Select() elif 'info'.lower() in str(phrase).lower(): kodi.Input.Info() elif 'player'.lower() in str(phrase).lower(): kodi.Input.ShowOSD
def fetchautoplaylist(url,numvideos): videourl=url autonum=numvideos autoplay_urls=[] autoplay_urls.append(videourl) for i in range(0,autonum): response=urllib.request.urlopen(videourl) webContent = response.read() webContent = webContent.decode('utf-8') idx=webContent.find("Up next") getid=webContent[idx:] idx=getid.find('<a href="/watch?v=') getid=getid[idx:] getid=getid.replace('<a href="/watch?v=',"",1) getid=getid.strip() idx=getid.find('"') videoid=getid[:idx] videourl=('https://www.youtube.com/watch?v='+videoid) if not videourl in autoplay_urls: i=i+1 autoplay_urls.append(videourl) else: i=i-1 continue
return autoplay_urls
def loadsonglist(): song_ids=[] if os.path.isfile("{}/songs.json".format(USER_PATH)): with open('{}/songs.json'.format(USER_PATH),'r') as input_file: songs_list= json.load(input_file)
else:
songs_list= api.get_all_songs()
with open('{}/songs.json'.format(USER_PATH), 'w') as output_file:
json.dump(songs_list, output_file)
for i in range(0,len(songs_list)):
song_ids.append(songs_list[i]['id'])
songsnum=len(songs_list)
return song_ids, songsnum
def loadartist(artistname): song_ids=[] artist=str(artistname) if os.path.isfile("{}/songs.json".format(USER_PATH)): with open('{}/songs.json'.format(USER_PATH),'r') as input_file: songs_list= json.load(input_file)
else:
songs_list= api.get_all_songs()
with open('{}/songs.json'.format(USER_PATH), 'w') as output_file:
json.dump(songs_list, output_file)
for i in range(0,len(songs_list)):
if artist.lower() in (songs_list[i]['albumArtist']).lower():
song_ids.append(songs_list[i]['id'])
else:
print("Artist not found")
songsnum=len(song_ids)
return song_ids, songsnum
def loadalbum(albumname): song_ids=[] album=str(albumname) if os.path.isfile("{}/songs.json".format(USER_PATH)): with open('{}/songs.json'.format(USER_PATH),'r') as input_file: songs_list= json.load(input_file)
else:
songs_list= api.get_all_songs()
with open('{}/songs.json'.format(USER_PATH), 'w') as output_file:
json.dump(songs_list, output_file)
for i in range(0,len(songs_list)):
if album.lower() in (songs_list[i]['album']).lower():
song_ids.append(songs_list[i]['id'])
else:
print("Album not found")
songsnum=len(song_ids)
return song_ids, songsnum
def loadplaylist(playlistnum): track_ids=[] if os.path.isfile("{}/playlist.json".format(USER_PATH)): with open('{}/playlist.json'.format(USER_PATH),'r') as input_file: playlistcontents= json.load(input_file) else: playlistcontents=api.get_all_user_playlist_contents() with open('{}/playlist.json'.format(USER_PATH), 'w') as output_file: json.dump(playlistcontents, output_file)
for k in range(0,len(playlistcontents[playlistnum]['tracks'])):
track_ids.append(playlistcontents[playlistnum]['tracks'][k]['trackId'])
tracksnum=len(playlistcontents[playlistnum]['tracks'])
return track_ids, tracksnum
def refreshlists(): playlist_list=api.get_all_user_playlist_contents() songs_list=api.get_all_songs() with open('{}/songs.json'.format(USER_PATH), 'w') as output_file: json.dump(songs_list, output_file) with open('{}/playlist.json'.format(USER_PATH), 'w') as output_file: json.dump(playlist_list, output_file) say("Music list synchronised")
def gmusicselect(phrase): currenttrackid=0 if 'all the songs'.lower() in phrase: say("Looking for your songs") tracks,numtracks=loadsonglist() if not tracks==[]: vlcplayer.media_manager(tracks,'Google Music') vlcplayer.googlemusic_player(currenttrackid) else: say("Unable to find songs matching your request")
if 'playlist'.lower() in phrase:
if 'first'.lower() in phrase or 'one'.lower() in phrase or '1'.lower() in phrase:
say("Playing songs from your playlist")
tracks,numtracks=loadplaylist(0)
if not tracks==[]:
vlcplayer.media_manager(tracks,'Google Music')
vlcplayer.googlemusic_player(currenttrackid)
else:
say("Unable to find songs matching your request")
if (custom_action_keyword['Dict']['Album']).lower() in phrase:
req=phrase
idx1=req.find(custom_action_keyword['Dict']['Album'])
idx2=req.find(custom_action_keyword['Dict']['From_google_music'])
album=req[idx1:idx2]
album = album.replace(custom_action_keyword['Dict']['Album'],'',1)
album = album.replace(custom_action_keyword['Dict']['From_google_music'],'',1)
album=album.strip()
print(album)
say("Looking for songs from the album")
tracks,numtracks=loadalbum(album)
if not tracks==[]:
vlcplayer.media_manager(tracks,'Google Music')
vlcplayer.googlemusic_player(currenttrackid)
else:
say("Unable to find songs matching your request")
if (custom_action_keyword['Dict']['Artist']).lower() in phrase:
req=phrase
idx1=req.find(custom_action_keyword['Dict']['Artist'])
idx2=req.find(custom_action_keyword['Dict']['From_google_music'])
artist=req[idx1:idx2]
artist = artist.replace(custom_action_keyword['Dict']['Artist'],'',1)
artist = artist.replace(custom_action_keyword['Dict']['From_google_music'],'',1)
artist=artist.strip()
print(artist)
say("Looking for songs rendered by the artist")
tracks,numtracks=loadartist(artist)
if not tracks==[]:
vlcplayer.media_manager(tracks,'Google Music')
vlcplayer.googlemusic_player(currenttrackid)
else:
say("Unable to find songs matching your request")
def YouTube_Autoplay(phrase): try: urllist=[] currenttrackid=0 idx1=phrase.find('autoplay') idx2=phrase.find(custom_action_keyword['Dict']['From_youtube']) track=phrase[idx1:idx2] track = track.replace('autoplay','',1) track = track.replace(custom_action_keyword['Dict']['From_youtube'],'',1) track=track.strip() say("Getting autoplay links") print(track) autourls=youtube_search(track,10) # Maximum of 10 URLS print(autourls) say("Adding autoplay links to the playlist") for i in range(0,len(autourls)): audiostream,videostream=youtube_stream_link(autourls[i]) streamurl=audiostream urllist.append(streamurl) if not urllist==[]: vlcplayer.media_manager(urllist,'YouTube') vlcplayer.youtube_player(currenttrackid) else: say("Unable to find songs matching your request")
except Exception as e:
print(e)
say('Encountered an exception please check the logs.')
def YouTube_No_Autoplay(phrase): try: urllist=[] currenttrackid=0 idx1=phrase.find(custom_action_keyword['Dict']['Play']) idx2=phrase.find(custom_action_keyword['Dict']['From_youtube']) track=phrase[idx1:idx2] track = track.replace(custom_action_keyword['Dict']['Play'],'',1) track = track.replace(custom_action_keyword['Dict']['From_youtube'],'',1) track=track.strip() say("Getting youtube link") print(track) urlid=youtube_search(track) if urlid is not None: fullurl="https://www.youtube.com/watch?v="+urlid audiostream,videostream=youtube_stream_link(fullurl) streamurl=audiostream urllist.append(streamurl) vlcplayer.media_manager(urllist,'YouTube') vlcplayer.youtube_player(currenttrackid) else: say("Unable to find songs matching your request")
except Exception as e:
print(e)
say('Encountered an exception please check the logs.')
def chromecast_play_video(phrase):
# Do not rename/change "TV" its a variable
TV = pychromecast.Chromecast("192.168.1.13") #Change ip to match the ip-address of your Chromecast
mc = TV.media_controller
idx1=phrase.find(custom_action_keyword['Dict']['Play'])
idx2=phrase.find('on chromecast')
query=phrase[idx1:idx2]
query=query.replace(custom_action_keyword['Dict']['Play'],'',1)
query=query.replace('on chromecast','',1)
query=query.strip()
youtubelinks=youtube_search(query)
youtubeurl=youtubelinks[0]
streams=youtube_stream_link(youtubeurl)
videostream=streams[1]
TV.wait()
time.sleep(1)
mc.play_media(videostream,'video/mp4')
def chromecast_control(action):
# Do not rename/change "TV" its a variable
TV = pychromecast.Chromecast("192.168.1.13") #Change ip to match the ip-address of your Chromecast
mc = TV.media_controller
if 'pause'.lower() in str(action).lower():
TV.wait()
time.sleep(1)
mc.pause()
if 'resume'.lower() in str(action).lower():
TV.wait()
time.sleep(1)
mc.play()
if 'end'.lower() in str(action).lower():
TV.wait()
time.sleep(1)
mc.stop()
if 'volume'.lower() in str(action).lower():
if 'up'.lower() in str(action).lower():
TV.wait()
time.sleep(1)
TV.volume_up(0.2)
if 'down'.lower() in str(action).lower():
TV.wait()
time.sleep(1)
TV.volume_down(0.2)
def campaign_page_parser(campaignname): page_link=kickstrater_search(campaignname) kicktrackurl=page_link['items'][0]['link'] response=urllib.request.urlopen(kicktrackurl) webContent = response.read() webContent = webContent.decode('utf-8') return webContent
def kickstarter_get_data(page_source,parameter): idx=page_source.find(parameter) info=page_source[idx:] info=info.replace(parameter,"",1) idx=info.find('"') info=info[:idx] info=info.replace('"',"",1) info=info.strip() result=info return result
def get_campaign_title(campaign): campaigntitle=campaign campaigntitleidx1=campaigntitle.find('
def get_pledges_offered(campaign): pledgesoffered=campaign pledgenum=0 for num in re.finditer('pledgereward-description pledgereward-description--expanded',pledgesoffered): pledgenum=pledgenum+1 return pledgenum
def get_funding_period(campaign): period=campaign periodidx=period.find('Funding period') period=period[periodidx:] periodidx=period.find('
') period=period[:periodidx] startperiodidx1=period.find('class="invisible-if-js js-adjust-time">') startperiodidx2=period.find('') startperiod=period[startperiodidx1:startperiodidx2] startperiod=startperiod.replace('class="invisible-if-js js-adjust-time">','',1) startperiod=startperiod.replace('','',1) startperiod=startperiod.strip() period2=period[startperiodidx2+5:] endperiodidx1=period2.find('class="invisible-if-js js-adjust-time">') endperiodidx2=period2.find('') endperiod=period2[endperiodidx1:endperiodidx2] endperiod=endperiod.replace('class="invisible-if-js js-adjust-time">','',1) endperiod=endperiod.replace('','',1) endperiod=endperiod.strip() duration=period2[endperiodidx2:] duration=duration.replace('','',1) duration=duration.replace('(','',1) duration=duration.replace(')','',1) duration=duration.replace('days','day',1) duration=duration.strip() return startperiod,endperiod,durationdef kickstarter_tracker(phrase): idx=phrase.find('of') campaign_name=phrase[idx:] campaign_name=campaign_name.replace("kickstarter campaign", "",1) campaign_name = campaign_name.replace('of','',1) campaign_name=campaign_name.strip() campaign_source=campaign_page_parser(campaign_name) campaign_title=get_campaign_title(campaign_source) campaign_num_rewards=get_pledges_offered(campaign_source) successidx=campaign_source.find('to help bring this project to life.') if str(successidx)==str(-1): backers=kickstarter_get_data(campaign_source,'data-backers-count="') totalpledged=kickstarter_get_data(campaign_source,'data-pledged="') totaltimerem=kickstarter_get_data(campaign_source,'data-hours-remaining="') totaldur=kickstarter_get_data(campaign_source,'data-duration="') endtime=kickstarter_get_data(campaign_source,'data-end_time="') goal=kickstarter_get_data(campaign_source,'data-goal="') percentraised=kickstarter_get_data(campaign_source,'data-percent-raised="') percentraised=round(float(percentraised),2) if int(totaltimerem)>0:
say(campaign_title+" is an ongoing campaign with "+str(totaltimerem)+" hours of fundraising still left." )
#print("Till now, "+str(backers)+ " backers have pledged for "+str(campaign_num_rewards)+" diferent rewards raising $"+str(totalpledged)+" , which is "+str(percentraised)+" times the requested amount of $"+str(goal))
say("Till now, "+str(backers)+ " backers have pledged for "+str(campaign_num_rewards)+" diferent rewards raising $"+str(totalpledged)+" , which is "+str(percentraised)+" times the requested amount of $"+str(goal))
if float(percentraised)<1 and int(totaltimerem)<=0:
#print(campaign_title+" has already ended")
say(campaign_title+" has already ended")
#print(str(backers)+ " backers raised $"+str(totalpledged)+" , which was "+str(percentraised)+" times the requested amount of $"+str(goal))
say(str(backers)+ " backers raised $"+str(totalpledged)+" , which was "+str(percentraised)+" times the requested amount of $"+str(goal))
#print(campaign_title+" was unseccessful in raising the requested amount of $"+str(goal)+" ." )
say(campaign_title+" was unseccessful in raising the requested amount of $"+str(goal)+" ." )
if float(percentraised)>1 and int(totaltimerem)<=0:
#print(campaign_title+" has already ended")
say(campaign_title+" has already ended")
#print(str(backers)+ " backers raised $"+str(totalpledged)+" , which was "+str(percentraised)+" times the requested amount of $"+str(goal))
say(str(backers)+ " backers raised $"+str(totalpledged)+" , which was "+str(percentraised)+" times the requested amount of $"+str(goal))
#print("Though the funding goal was reached, due to reasons undisclosed, the campaign was either cancelled by the creator or Kickstarter.")
say("Though the funding goal was reached, due to reasons undisclosed, the campaign was either cancelled by the creator or Kickstarter.")
else:
[start_day,end_day,numdays]=get_funding_period(campaign_source)
campaigninfo=campaign_source[(successidx-100):(successidx+35)]
campaignidx=campaigninfo.find('<b>')
campaigninfo=campaigninfo[campaignidx:]
campaigninfo=campaigninfo.replace('<b>',"",1)
campaigninfo=campaigninfo.replace('</b>',"",1)
campaigninfo=campaigninfo.replace('<span class="money">',"",1)
campaigninfo=campaigninfo.replace('</span>',"",1)
campaigninfo=campaigninfo.strip()
#print(campaign_title+" was a "+str(numdays)+" campaign launched on "+str(start_day))
#print(campaigninfo)
say(campaign_title+" was a "+str(numdays)+" campaign launched on "+str(start_day))
say(campaigninfo)
def pushmessage(title,body): if pb!=None: push = pb.push_note(title,body) else: say("Pushbullet API key has not been entered.")
def getrecipe(item): appid='ENTER-YOUR-APPID-HERE' appkey='ENTER-YOUR-APP-KEY-HERE' recipeurl = 'https://api.edamam.com/search?q='+item+'&app_id='+appid+'&app_key='+appkey print(recipeurl) recipedetails = urllib.request.urlopen(recipeurl) recipedetails=recipedetails.read() recipedetails = recipedetails.decode('utf-8') recipedetails=json.loads(recipedetails) recipe_ingredients=str(recipedetails['hits'][0]['recipe']['ingredientLines']) recipe_url=recipedetails['hits'][0]['recipe']['url'] recipe_name=recipedetails['hits'][0]['recipe']['label'] recipe_ingredients=recipe_ingredients.replace('[','',1) recipe_ingredients=recipe_ingredients.replace(']','',1) recipe_ingredients=recipe_ingredients.replace('"','',1) recipe_ingredients=recipe_ingredients.strip() print(recipe_name) print("") print(recipe_url) print("") print(recipe_ingredients) compiled_recipe_info="\nRecipe Source URL:\n"+recipe_url+"\n\nRecipe Ingredients:\n"+recipe_ingredients pushmessage(str(recipe_name),str(compiled_recipe_info))
def hue_control(phrase,lightindex,lightaddress): with open('/opt/hue-emulator/config.json', 'r') as config: hueconfig = json.load(config) currentxval=hueconfig['lights'][lightindex]['state']['xy'][0] currentyval=hueconfig['lights'][lightindex]['state']['xy'][1] currentbri=hueconfig['lights'][lightindex]['state']['bri'] currentct=hueconfig['lights'][lightindex]['state']['ct'] huelightname=str(hueconfig['lights'][lightindex]['name']) try: if custom_action_keyword['Dict']['On'] in phrase: huereq=requests.head("http://"+lightaddress+"/set?light="+lightindex+"&on=true") say("Turning on "+huelightname) if custom_action_keyword['Dict']['Off'] in phrase: huereq=requests.head("http://"+lightaddress+"/set?light="+lightindex+"&on=false") say("Turning off "+huelightname) if 'çolor' in phrase: rcolour,gcolour,bcolour,hexcolour,colour=getcolours(phrase) print(str([rcolour,gcolour,bcolour,hexcolour,colour])) xval,yval=convert_rgb_xy(int(rcolour),int(gcolour),int(bcolour)) print(str([xval,yval])) huereq=requests.head("http://"+lightaddress+"/set?light="+lightindex+"&x="+str(xval)+"&y="+str(yval)+"&on=true") print("http://"+lightaddress+"/set?light="+lightindex+"&x="+str(xval)+"&y="+str(yval)+"&on=true") say("Setting "+huelightname+" to "+colour) if (custom_action_keyword['Dict']['Brightness']).lower() in phrase: if 'hundred'.lower() in phrase or custom_action_keyword['Dict']['Maximum'] in phrase: bright=100 elif 'zero'.lower() in phrase or custom_action_keyword['Dict']['Minimum'] in phrase: bright=0 else: bright=re.findall('\d+', phrase) brightval= (bright/100)*255 huereq=requests.head("http://"+lightaddress+"/set?light="+lightindex+"&on=true&bri="+str(brightval)) say("Changing "+huelightname+" brightness to "+bright+" percent") except (requests.exceptions.ConnectionError,TypeError) as errors: if str(errors)=="'NoneType' object is not iterable": print("Type Error") else: say("Device not online")
def show_spotify_track_names(tracks): spotify_tracks=[] for i, item in enumerate(tracks['items']): track = item['track']
# print ("%s %s" % (track['artists'][0]['name'],track['name']))
spotify_tracks.append("%s %s" % (track['artists'][0]['name'],track['name']))
return spotify_tracks
def scan_spotify_playlists(): if spotify_token: i=0 playlistdetails=[] spotify_tracks_list=[] sp = spotipy.Spotify(auth=spotify_token)
# print("")
# print("")
playlists = sp.user_playlists(username)
print(len(playlists['items']))
num_playlists=len(playlists['items'])
spotify_playlists={"Playlists":[0]*(len(playlists['items']))}
# print(spotify_playlists)
# print("")
# print("")
for playlist in playlists['items']:
# print (playlist['name'])
playlist_name=playlist['name']
# print("")
# print("")
results = sp.user_playlist(playlist['owner']['id'], playlist['id'],fields="tracks,next")
tracks = results['tracks']
spotify_tracks_list=show_spotify_track_names(tracks)
playlistdetails.append(i)
playlistdetails.append(playlist_name)
playlistdetails.append(spotify_tracks_list)
spotify_playlists['Playlists'][i]=playlistdetails
playlistdetails=[]
i=i+1
# print("")
# print("")
# print(spotify_playlists['Playlists'])
return spotify_playlists, num_playlists
else:
say("Can't get token for, " + username)
print("Can't get token for ", username)
def spotify_playlist_select(phrase): trackslist=[] currenttrackid=0 idx1=phrase.find(custom_action_keyword['Dict']['Play']) idx2=phrase.find(custom_action_keyword['Dict']['From_spotify']) track=phrase[idx1:idx2] track = track.replace(custom_action_keyword['Dict']['Play'],'',1) track = track.replace(custom_action_keyword['Dict']['From_spotify'],'',1) track=track.strip() say("Getting music links") print(track) playlists,num=scan_spotify_playlists() if not num==[]: for i in range(0,num): print(str(playlists['Playlists'][i][1]).lower()) if track in str(playlists['Playlists'][i][1]).lower(): trackslist=playlists['Playlists'][i][2] break if not trackslist==[]: vlcplayer.media_manager(trackslist,'Spotify') vlcplayer.spotify_player(currenttrackid) else: say("Unable to find matching playlist")
def domoticz_control(query,index,devicename): global hexcolour,bright,devorder try: for j in range(0,len(domoticz_devices['result'])): if domoticz_devices['result'][j]['idx']==index: devorder=j break
if (' ' + custom_action_keyword['Dict']['On'] + ' ') in query or (' ' + custom_action_keyword['Dict']['On']) in query or (custom_action_keyword['Dict']['On'] + ' ') in query:
devreq=requests.head("https://" + configuration['Domoticz']['Server_IP'][0] + ":" + configuration['Domoticz']['Server_port'][0] + "/json.htm?type=command¶m=switchlight&idx=" + index + "&switchcmd=On",verify=False)
say('Turning on ' + devicename )
if custom_action_keyword['Dict']['Off'] in query:
devreq=requests.head("https://" + configuration['Domoticz']['Server_IP'][0] + ":" + configuration['Domoticz']['Server_port'][0] + "/json.htm?type=command¶m=switchlight&idx=" + index + "&switchcmd=Off",verify=False)
say('Turning off ' + devicename )
if 'toggle' in query:
devreq=requests.head("https://" + configuration['Domoticz']['Server_IP'][0] + ":" + configuration['Domoticz']['Server_port'][0] + "/json.htm?type=command¶m=switchlight&idx=" + index + "&switchcmd=Toggle",verify=False)
say('Toggling ' + devicename )
if custom_action_keyword['Dict']['Colour'] in query:
if 'RGB' in domoticz_devices['result'][devorder]['SubType']:
rcolour,gcolour,bcolour,hexcolour,colour=getcolours(query)
hexcolour=hexcolour.replace("#","",1)
hexcolour=hexcolour.strip()
print(hexcolour)
if bright=='':
bright=str(domoticz_devices['result'][devorder]['Level'])
devreq=requests.head("https://" + configuration['Domoticz']['Server_IP'][0] + ":" + configuration['Domoticz']['Server_port'][0] + "/json.htm?type=command¶m=setcolbrightnessvalue&idx=" + index + "&hex=" + hexcolour + "&brightness=" + bright + "&iswhite=false",verify=False)
say('Setting ' + devicename + ' to ' + colour )
else:
say('The requested light is not a colour bulb')
if custom_action_keyword['Dict']['Brightness'] in query:
if domoticz_devices['result'][devorder]['HaveDimmer']:
if 'hundred' in query or 'hundred'.lower() in query or custom_action_keyword['Dict']['Maximum'] in query:
bright=str(100)
elif 'zero' in query or custom_action_keyword['Dict']['Minimum'] in query:
bright=str(0)
else:
bright=re.findall('\d+', query)
bright=bright[0]
devreq=requests.head("https://" + configuration['Domoticz']['Server_IP'][0] + ":" + configuration['Domoticz']['Server_port'][0] + "/json.htm?type=command¶m=switchlight&idx=" + index + "&switchcmd=Set%20Level&level=" + bright ,verify=False)
say('Setting ' + devicename + ' brightness to ' + str(bright) + ' percent.')
else:
say('The requested light does not have a dimer')
except (requests.exceptions.ConnectionError,TypeError) as errors:
if str(errors)=="'NoneType' object is not iterable":
print("Type Error")
else:
say("Device or Domoticz server is not online")
def getgaanaplaylistinfo(playlisturl): trackstart=[] trackend=[] playliststart=[] playlistend=[] trackdetails=[] response=urllib.request.urlopen(playlisturl) response=response.read().decode('utf-8') for a in re.finditer('{"title":',response): trackstart.append(a.start()) for b in re.finditer('"parental_warning":(.*)}',response): trackend.append(b.end()) for c in re.finditer('{"source":',response): playliststart=c.start() for d in re.finditer('}',response): playlistend=int(d.start())+1 playlistinfo=json.loads(response[playliststart:playlistend]) playlistname=playlistinfo['title'] if len(trackstart)==len(trackend) and len(trackstart)>0: for i in range(0,len(trackstart)): trackdetails.append(json.loads(response[trackstart[i]:trackend[i]])) else: trackdetails=[] numtracks=len(trackdetails) return playlistname,numtracks,trackdetails
def gaana_playlist_select(phrase): trackslist=[] currenttrackid=0 idx1=phrase.find(custom_action_keyword['Dict']['Play']) idx2=phrase.find(custom_action_keyword['Dict']['From_gaana']) track=phrase[idx1:idx2] track = track.replace(custom_action_keyword['Dict']['Play'],'',1) track = track.replace(custom_action_keyword['Dict']['From_gaana'],'',1) track=track.strip() playlistnumreq=re.findall(r'\b\d+\b', track) if playlistnumreq !=[]: playlistnumreq=playlistnumreq[0] userplaylists=configuration['Gaana']['Playlist'] numuserplaylists=len(userplaylists) if playlistnumreq !=[] and "top" not in track and int(playlistnumreq) <= int(numuserplaylists): print("Getting links for playlist number " + playlistnumreq) say("Getting links for playlist number " + playlistnumreq) reqplaylist=configuration['Gaana']['Playlist'][(int(playlistnumreq)-1)] else: print("Searching for " + track + " in gaana.com") say("Searching for " + track + " in gaana.com") page_link=gaana_search(track) reqplaylist=page_link['items'][0]['link'] name,numsongs,tracks= getgaanaplaylistinfo(reqplaylist) print(numsongs) if not numsongs==[]: say("Getting the tracks from " + name) for i in range(0,numsongs): trackslist.append((tracks[i]['title'] + ' ' + tracks[i]['albumtitle'])) if not trackslist==[]: vlcplayer.media_manager(trackslist,'Gaana') vlcplayer.gaana_player(currenttrackid) else: say("Unable to find matching playlist")
def deezer_playlist_select(phrase): trackslist=[] deezer_user_playlists=[] currenttrackid=0 idx1=phrase.find(custom_action_keyword['Dict']['Play']) idx2=phrase.find(custom_action_keyword['Dict']['From_deezer']) track=phrase[idx1:idx2] track = track.replace(custom_action_keyword['Dict']['Play'],'',1) track = track.replace(custom_action_keyword['Dict']['From_deezer'],'',1) track=track.strip() playlistnumreq=re.findall(r'\b\d+\b', track) if playlistnumreq !=[]: playlistnumreq=playlistnumreq[0] deezer_response = requests.get("https://api.deezer.com/user/" + configuration['Deezer']['User_id'] + "/playlists",verify=False) deezer_user_playlist_info=json.loads(deezer_response.text) if deezer_user_playlist_info['data'] != []: for i in range(0,len(deezer_user_playlist_info['data'])): deezer_user_playlists.append(deezer_user_playlist_info['data'][i]['tracklist']) else: say("No playlists found for the user") numuserplaylists=len(deezer_user_playlists) if playlistnumreq !=[] and "top" not in track and int(playlistnumreq) <= int(numuserplaylists): print("Getting links for playlist number " + playlistnumreq) say("Getting links for playlist number " + playlistnumreq) tracklisturl=deezer_user_playlists[(int(playlistnumreq)-1)] else: say("No matching playlists found") deezer_tracks_response = requests.get(tracklisturl,verify=False) deezer_user_playlist_tracks_info=json.loads(deezer_tracks_response.text) numsongs=len(deezer_user_playlist_tracks_info['data']) if not numsongs==[]: say("Getting the tracks from " + deezer_user_playlist_info['data'][int(playlistnumreq)-1]['title']) for i in range(0,numsongs): trackslist.append((deezer_user_playlist_tracks_info['data'][i]['title'] + ' by ' + deezer_user_playlist_tracks_info['data'][i]['artist']['name'] + ' from ' + deezer_user_playlist_tracks_info['data'][i]['album']['title'])) if not trackslist==[]: vlcplayer.media_manager(trackslist,'Deezer') vlcplayer.gaana_player(currenttrackid) else: say("Unable to find matching tracks")
def binary_aquire(pin, duration): t0 = time.time() results = [] while (time.time() - t0) < duration: results.append(GPIO.input(pin)) return results
def on_ir_receive(pinNo, bouncetime=150): data = binary_aquire(pinNo, bouncetime/1000.0) if len(data) < bouncetime: return rate = len(data) / (bouncetime / 1000.0) pulses = [] i_break = 0 for i in range(1, len(data)): if (data[i] != data[i-1]) or (i == len(data)-1): pulses.append((data[i-1], int((i-i_break)/rate*1e6))) i_break = i outbin = "" for val, us in pulses: if val != 1: continue if outbin and us > 2000: break elif us < 1000: outbin += "0" elif 1000 < us < 2000: outbin += "1" try: return int(outbin, 2) except ValueError: return None
def voicenote(audiofile): if pb!=None: say("Sending your voicenote") with open(audiofile, "rb") as recordedvoicenote: file_data = pb.upload_file(recordedvoicenote, 'Voicenote.wav') push = pb.push_file(**file_data) else: say("Pushbullet API key has not been entered.")
def Action(phrase): if 'shutdown' in phrase: say('Shutting down Raspberry Pi') time.sleep(10) os.system("sudo shutdown -h now")
if 'servo' in phrase:
for s in re.findall(r'\b\d+\b', phrase):
SetAngle(int(s))
if 'zero' in phrase:
SetAngle(0)
else:
if GPIOcontrol:
for num, name in enumerate(var):
if name.lower() in phrase:
pinout=gpio[num]
if custom_action_keyword['Dict']['On'] in phrase:
GPIO.output(pinout, 1)
say("Turning On " + name)
elif custom_action_keyword['Dict']['Off'] in phrase:
GPIO.output(pinout, 0)
say("Turning Off " + name)
else:
say("GPIO controls, is not supported for your device.")
do:
source env/bin/activate
pip3 install RPi.GPIO==0.6.3
I dont think I can do anything more.
I asked you for the entire installation terminal contents already a number of times and all you have given me is an image that hardly helps. If you need your issue to be fixed, then you need to provide the information requested.
Sir i understand you are helping me out, and i really appreciate it. I have re-installed it again. here is the full output of terminal. and that pip install RPi.GPIO==0.6.3 already done yesterday, but didnt worked, tried today too but still same error.
Enter the your full credential file name including the path and .json extension: /home/pi/client_secret_562010175920-96vpo5fmeoa9rhg5meo54unnuormejk7.apps.googleusercontent.com.json
Enter the your Google Cloud Console Project-Id: assitancemirror
Enter the modelid that was generated in the actions console: assitancemirror-mirrorassistance-d68vsy
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
autoconf is already the newest version (2.69-11).
automake is already the newest version (1:1.16.1-4).
bison is already the newest version (2:3.3.2.dfsg-1).
build-essential is already the newest version (12.6).
gcc is already the newest version (4:8.3.0-1+rpi2).
git is already the newest version (1:2.20.1-2+deb10u3).
libatlas-base-dev is already the newest version (3.10.3-8+rpi1).
libffi-dev is already the newest version (3.2.1-9).
libjack-jackd2-dev is already the newest version (1.9.12~dfsg-2).
libmpg123-dev is already the newest version (1.25.10-2).
libpcre3 is already the newest version (2:8.39-12).
libpcre3-dev is already the newest version (2:8.39-12).
libsox-fmt-mp3 is already the newest version (14.4.2+git20190427-1).
libxml2-dev is already the newest version (2.9.4+dfsg1-7+b3).
libxslt1-dev is already the newest version (1.1.32-2.2~deb10u1).
mpg123 is already the newest version (1.25.10-2).
mplayer is already the newest version (2:1.3.0-8+b5).
mpv is already the newest version (0.29.1-1).
nmap is already the newest version (7.70+dfsg1-6).
portaudio19-dev is already the newest version (19.6.0-1).
python is already the newest version (2.7.16-1).
python-dev is already the newest version (2.7.16-1).
python-setuptools is already the newest version (40.8.0-1).
python3 is already the newest version (3.7.3-1).
python3-dev is already the newest version (3.7.3-1).
python3-lxml is already the newest version (4.3.2-1).
python3-setuptools is already the newest version (40.8.0-1).
python3-venv is already the newest version (3.7.3-1).
socat is already the newest version (1.7.3.2-2).
sox is already the newest version (14.4.2+git20190427-1).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-1).
libssl-dev is already the newest version (1.1.1d-0+deb10u3+rpt1).
python-pip is already the newest version (18.1-5+rpt1).
python3-pip is already the newest version (18.1-5+rpt1).
vlc is already the newest version (3.0.11-0+deb10u1+rpt1).
Suggested packages:
pavumeter paman paprefs
The following NEW packages will be installed:
pulseaudio
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 1,036 kB of archives.
After this operation, 5,851 kB of additional disk space will be used.
Get:1 http://mirror.ossplanet.net/raspbian/raspbian buster/main armhf pulseaudio armhf 12.2-4+deb10u1 [1,036 kB]
Fetched 1,036 kB in 9s (119 kB/s)
Selecting previously unselected package pulseaudio.
(Reading database ... 160302 files and directories currently installed.)
Preparing to unpack .../pulseaudio_12.2-4+deb10u1_armhf.deb ...
Unpacking pulseaudio (12.2-4+deb10u1) ...
Setting up pulseaudio (12.2-4+deb10u1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for dbus (1.12.16-1) ...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pyaudio in /usr/local/lib/python2.7/dist-packages (0.2.11)
Checking OS Compatability
You are running the installer on Buster
Your board supports Ok-Google Hotword. You can also trigger the assistant using custom-wakeword
GPIO pins can be used with the assistant
Copying Snowboy files to GassistPi directory
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already up-to-date: pip in ./env/lib/python3.7/site-packages (20.2) Requirement already up-to-date: setuptools in ./env/lib/python3.7/site-packages (49.2.0) Requirement already up-to-date: wheel in ./env/lib/python3.7/site-packages (0.34.2) Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting git+https://github.com/plamere/spotipy.git (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 17)) Cloning https://github.com/plamere/spotipy.git to /tmp/pip-req-build-r9kyyrpl Requirement already satisfied (use --upgrade to upgrade): spotipy==2.13.0 from git+https://github.com/plamere/spotipy.git in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 17)) Collecting git+https://github.com/shivasiddharth/py-googletrans.git (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 23)) Cloning https://github.com/shivasiddharth/py-googletrans.git to /tmp/pip-req-build-85zorrla Requirement already satisfied (use --upgrade to upgrade): googletrans==2.3.0 from git+https://github.com/shivasiddharth/py-googletrans.git in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 23)) Requirement already satisfied: pyaudio>=0.2.11 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 1)) (0.2.11) Requirement already satisfied: aftership>=0.2 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 2)) (1.0.post2) Requirement already satisfied: feedparser>=5.2.1 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 3)) (5.2.1) Requirement already satisfied: kodi-json>=1.0.0 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 4)) (1.0.0) Requirement already satisfied: gmusicapi>=11.1.1 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (13.0.0) Requirement already satisfied: gTTS==2.0.2 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 6)) (2.0.2) Requirement already satisfied: gTTS-token==1.1.3 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 7)) (1.1.3) Requirement already satisfied: youtube_dl>=2018.11.23 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 8)) (2020.7.28) Requirement already satisfied: PyChromecast>=2.3.0 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 9)) (7.1.2) Requirement already satisfied: pafy>=0.5.4 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 10)) (0.5.5) Requirement already satisfied: psutil>=5.4.8 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 11)) (5.7.2) Requirement already satisfied: urllib3>=1.24.1 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 12)) (1.25.10) Requirement already satisfied: google-api-python-client>=1.7.5 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (1.10.0) Requirement already satisfied: requests>=2.20.1 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 14)) (2.24.0) Collecting pushbullet.py>=0.11.0 Using cached pushbullet.py-0.11.0-py2.py3-none-any.whl (10 kB) Requirement already satisfied: python-vlc>=3.0.4106 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 16)) (3.0.11115) Requirement already satisfied: pyyaml==3.13 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 18)) (3.13) Requirement already satisfied: spidev>=3.2 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 19)) (3.5) Requirement already satisfied: gpiozero>=1.4.1 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 20)) (1.5.1) Requirement already satisfied: numpy>=1.15.4 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 21)) (1.19.1) Requirement already satisfied: pycryptodomex==3.7.2 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 22)) (3.7.2) Requirement already satisfied: paho-mqtt==1.4.0 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 24)) (1.4.0) Requirement already satisfied: google-cloud-texttospeech==0.3.0 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 25)) (0.3.0) Requirement already satisfied: google-cloud-speech==0.36.0 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 26)) (0.36.0) Requirement already satisfied: adafruit-io==2.1 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 27)) (2.1) Requirement already satisfied: cryptography==2.4.2 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 28)) (2.4.2) Requirement already satisfied: mock==3.0.5 in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 29)) (3.0.5) Requirement already satisfied: oauth2client in ./env/lib/python3.7/site-packages (from -r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 30)) (4.1.3) Requirement already satisfied: six>=1.10.0 in ./env/lib/python3.7/site-packages (from spotipy==2.13.0->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 17)) (1.15.0) Requirement already satisfied: mutagen>=1.34 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (1.45.0) Requirement already satisfied: validictory!=0.9.2,>=0.8.0 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (1.1.2) Requirement already satisfied: decorator>=3.3.1 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (4.4.2) Requirement already satisfied: MechanicalSoup>=0.4.0 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (0.12.0) Requirement already satisfied: gpsoauth>=0.2.0 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (0.4.1) Requirement already satisfied: protobuf>=3.0.0 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (3.12.2) Requirement already satisfied: python-dateutil!=2.0,>=1.3 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (2.8.1) Requirement already satisfied: appdirs>=1.1.0 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (1.4.4) Requirement already satisfied: proboscis>=1.2.5.1 in ./env/lib/python3.7/site-packages (from gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (1.2.6.0) Requirement already satisfied: bs4 in ./env/lib/python3.7/site-packages (from gTTS==2.0.2->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 6)) (0.0.1) Requirement already satisfied: click in ./env/lib/python3.7/site-packages (from gTTS==2.0.2->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 6)) (6.7) Requirement already satisfied: casttube>=0.2.0 in ./env/lib/python3.7/site-packages (from PyChromecast>=2.3.0->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 9)) (0.2.1) Requirement already satisfied: zeroconf>=0.25.1 in ./env/lib/python3.7/site-packages (from PyChromecast>=2.3.0->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 9)) (0.28.0) Requirement already satisfied: uritemplate<4dev,>=3.0.0 in ./env/lib/python3.7/site-packages (from google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (3.0.1) Requirement already satisfied: google-auth>=1.16.0 in ./env/lib/python3.7/site-packages (from google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (1.20.0) Requirement already satisfied: google-auth-httplib2>=0.0.3 in ./env/lib/python3.7/site-packages (from google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (0.0.4) Requirement already satisfied: httplib2<1dev,>=0.9.2 in ./env/lib/python3.7/site-packages (from google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (0.18.1) Requirement already satisfied: google-api-core<2dev,>=1.18.0 in ./env/lib/python3.7/site-packages (from google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (1.22.0) Requirement already satisfied: chardet<4,>=3.0.2 in ./env/lib/python3.7/site-packages (from requests>=2.20.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 14)) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in ./env/lib/python3.7/site-packages (from requests>=2.20.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 14)) (2020.6.20) Requirement already satisfied: idna<3,>=2.5 in ./env/lib/python3.7/site-packages (from requests>=2.20.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 14)) (2.10) Requirement already satisfied: python-magic in ./env/lib/python3.7/site-packages (from pushbullet.py>=0.11.0->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 15)) (0.4.18) Requirement already satisfied: websocket-client in ./env/lib/python3.7/site-packages (from pushbullet.py>=0.11.0->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 15)) (0.57.0) Requirement already satisfied: colorzero in ./env/lib/python3.7/site-packages (from gpiozero>=1.4.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 20)) (1.1) Requirement already satisfied: cffi!=1.11.3,>=1.7 in ./env/lib/python3.7/site-packages (from cryptography==2.4.2->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 28)) (1.14.1) Requirement already satisfied: asn1crypto>=0.21.0 in ./env/lib/python3.7/site-packages (from cryptography==2.4.2->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 28)) (1.4.0) Requirement already satisfied: rsa>=3.1.4 in ./env/lib/python3.7/site-packages (from oauth2client->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 30)) (4.6) Requirement already satisfied: pyasn1>=0.1.7 in ./env/lib/python3.7/site-packages (from oauth2client->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 30)) (0.4.8) Requirement already satisfied: pyasn1-modules>=0.0.5 in ./env/lib/python3.7/site-packages (from oauth2client->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 30)) (0.2.8) Requirement already satisfied: lxml in ./env/lib/python3.7/site-packages (from MechanicalSoup>=0.4.0->gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (4.5.2) Requirement already satisfied: beautifulsoup4>=4.4 in ./env/lib/python3.7/site-packages (from MechanicalSoup>=0.4.0->gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (4.9.1) Requirement already satisfied: setuptools in ./env/lib/python3.7/site-packages (from protobuf>=3.0.0->gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (49.2.0) Requirement already satisfied: ifaddr>=0.1.7 in ./env/lib/python3.7/site-packages (from zeroconf>=0.25.1->PyChromecast>=2.3.0->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 9)) (0.1.7) Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./env/lib/python3.7/site-packages (from google-auth>=1.16.0->google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (4.1.1) Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.6.0 in ./env/lib/python3.7/site-packages (from google-api-core<2dev,>=1.18.0->google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (1.52.0) Requirement already satisfied: pytz in ./env/lib/python3.7/site-packages (from google-api-core<2dev,>=1.18.0->google-api-python-client>=1.7.5->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 13)) (2020.1) Requirement already satisfied: pycparser in ./env/lib/python3.7/site-packages (from cffi!=1.11.3,>=1.7->cryptography==2.4.2->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 28)) (2.20) Requirement already satisfied: soupsieve>1.2 in ./env/lib/python3.7/site-packages (from beautifulsoup4>=4.4->MechanicalSoup>=0.4.0->gmusicapi>=11.1.1->-r /home/pi/GassistPi/Requirements/GassistPi-pip-requirements.txt (line 5)) (2.0.1) Building wheels for collected packages: spotipy, googletrans Building wheel for spotipy (setup.py) ... done Created wheel for spotipy: filename=spotipy-2.13.0-py3-none-any.whl size=24245 sha256=a7927f73c0e0ce6dc846eee47acfda8a2976893cfaa92a4b6bc7bbd78531194f Stored in directory: /tmp/pip-ephem-wheel-cache-_e3w0uft/wheels/4c/90/da/4e774a27e9cd8e21c762b7d11ecc110efdc8bb69ef744f59af Building wheel for googletrans (setup.py) ... done Created wheel for googletrans: filename=googletrans-2.3.0-py3-none-any.whl size=16446 sha256=2bab24f5e34b6cf4740ead8726001cdf67cb13a74fc1279f5bec8f8b8d7af278 Stored in directory: /tmp/pip-ephem-wheel-cache-_e3w0uft/wheels/48/d0/c7/fca3ea3c88b23c2d93e3535a47fdcefcd2ef48edca78b1b46e Successfully built spotipy googletrans Installing collected packages: pushbullet.py Successfully installed pushbullet.py-0.11.0 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting RPi.GPIO==0.6.3 Using cached https://www.piwheels.org/simple/rpi-gpio/RPi.GPIO-0.6.3-cp37-cp37m-linux_armv7l.whl (66 kB) Installing collected packages: RPi.GPIO Successfully installed RPi.GPIO-0.6.3 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: google-assistant-library==1.1.0 in ./env/lib/python3.7/site-packages (1.1.0) Requirement already satisfied: google-auth<2,>=1.0.1 in ./env/lib/python3.7/site-packages (from google-assistant-library==1.1.0) (1.20.0) Requirement already satisfied: argparse<2,>=1.4.0 in ./env/lib/python3.7/site-packages (from google-assistant-library==1.1.0) (1.4.0) Requirement already satisfied: enum34<2,>=1.1.6 in ./env/lib/python3.7/site-packages (from google-assistant-library==1.1.0) (1.1.10) Requirement already satisfied: requests<3,>=2.14.2 in ./env/lib/python3.7/site-packages (from google-assistant-library==1.1.0) (2.24.0) Requirement already satisfied: pathlib2<3,>=2.3.0 in ./env/lib/python3.7/site-packages (from google-assistant-library==1.1.0) (2.3.5) Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3.5" in ./env/lib/python3.7/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.1.0) (4.6) Requirement already satisfied: pyasn1-modules>=0.2.1 in ./env/lib/python3.7/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.1.0) (0.2.8) Requirement already satisfied: six>=1.9.0 in ./env/lib/python3.7/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.1.0) (1.15.0) Requirement already satisfied: setuptools>=40.3.0 in ./env/lib/python3.7/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.1.0) (49.2.0) Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./env/lib/python3.7/site-packages (from google-auth<2,>=1.0.1->google-assistant-library==1.1.0) (4.1.1) Requirement already satisfied: chardet<4,>=3.0.2 in ./env/lib/python3.7/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.1.0) (3.0.4) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./env/lib/python3.7/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.1.0) (1.25.10) Requirement already satisfied: certifi>=2017.4.17 in ./env/lib/python3.7/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.1.0) (2020.6.20) Requirement already satisfied: idna<3,>=2.5 in ./env/lib/python3.7/site-packages (from requests<3,>=2.14.2->google-assistant-library==1.1.0) (2.10) Requirement already satisfied: pyasn1>=0.1.3 in ./env/lib/python3.7/site-packages (from rsa<5,>=3.1.4; python_version >= "3.5"->google-auth<2,>=1.0.1->google-assistant-library==1.1.0) (0.4.8) Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting google-assistant-grpc==0.3.0 Using cached google_assistant_grpc-0.3.0-py2.py3-none-any.whl (21 kB) Requirement already satisfied: grpcio>=1.3.5 in ./env/lib/python3.7/site-packages (from google-assistant-grpc==0.3.0) (1.30.0) Requirement already satisfied: googleapis-common-protos>=1.5.2 in ./env/lib/python3.7/site-packages (from google-assistant-grpc==0.3.0) (1.52.0) Requirement already satisfied: six>=1.5.2 in ./env/lib/python3.7/site-packages (from grpcio>=1.3.5->google-assistant-grpc==0.3.0) (1.15.0) Requirement already satisfied: protobuf>=3.6.0 in ./env/lib/python3.7/site-packages (from googleapis-common-protos>=1.5.2->google-assistant-grpc==0.3.0) (3.12.2) Requirement already satisfied: setuptools in ./env/lib/python3.7/site-packages (from protobuf>=3.6.0->googleapis-common-protos>=1.5.2->google-assistant-grpc==0.3.0) (49.2.0) Installing collected packages: google-assistant-grpc Attempting uninstall: google-assistant-grpc Found existing installation: google-assistant-grpc 0.2.1 Uninstalling google-assistant-grpc-0.2.1: Successfully uninstalled google-assistant-grpc-0.2.1 Successfully installed google-assistant-grpc-0.3.0 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: google-assistant-sdk==0.6.0 in ./env/lib/python3.7/site-packages (0.6.0) Requirement already satisfied: google-auth-oauthlib[tool]>=0.1.0 in ./env/lib/python3.7/site-packages (from google-assistant-sdk==0.6.0) (0.4.1) Requirement already satisfied: requests-oauthlib>=0.7.0 in ./env/lib/python3.7/site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (1.3.0) Requirement already satisfied: google-auth in ./env/lib/python3.7/site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (1.20.0) Requirement already satisfied: click; extra == "tool" in ./env/lib/python3.7/site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (6.7) Requirement already satisfied: requests>=2.0.0 in ./env/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (2.24.0) Requirement already satisfied: oauthlib>=3.0.0 in ./env/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (3.1.0) Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (4.1.1) Requirement already satisfied: setuptools>=40.3.0 in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (49.2.0) Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3.5" in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (4.6) Requirement already satisfied: six>=1.9.0 in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (1.15.0) Requirement already satisfied: pyasn1-modules>=0.2.1 in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (0.2.8) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./env/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (1.25.10) Requirement already satisfied: chardet<4,>=3.0.2 in ./env/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in ./env/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (2020.6.20) Requirement already satisfied: idna<3,>=2.5 in ./env/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (2.10) Requirement already satisfied: pyasn1>=0.1.3 in ./env/lib/python3.7/site-packages (from rsa<5,>=3.1.4; python_version >= "3.5"->google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk==0.6.0) (0.4.8) Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: google-assistant-sdk[samples]==0.6.0 in ./env/lib/python3.7/site-packages (0.6.0) Requirement already satisfied: google-auth-oauthlib[tool]>=0.1.0 in ./env/lib/python3.7/site-packages (from google-assistant-sdk[samples]==0.6.0) (0.4.1) Requirement already satisfied: urllib3[secure]<2,>=1.21; extra == "samples" in ./env/lib/python3.7/site-packages (from google-assistant-sdk[samples]==0.6.0) (1.25.10) Collecting google-assistant-grpc==0.2.1; extra == "samples" Using cached google_assistant_grpc-0.2.1-py2.py3-none-any.whl (21 kB) Requirement already satisfied: pathlib2<3,>=2.3.0; extra == "samples" in ./env/lib/python3.7/site-packages (from google-assistant-sdk[samples]==0.6.0) (2.3.5) Requirement already satisfied: click<7,>=6.7; extra == "samples" in ./env/lib/python3.7/site-packages (from google-assistant-sdk[samples]==0.6.0) (6.7) Requirement already satisfied: sounddevice<0.4,>=0.3.7; extra == "samples" in ./env/lib/python3.7/site-packages (from google-assistant-sdk[samples]==0.6.0) (0.3.15) Requirement already satisfied: futures<4,>=3.1.1; extra == "samples" in ./env/lib/python3.7/site-packages (from google-assistant-sdk[samples]==0.6.0) (3.1.1) Requirement already satisfied: tenacity<5,>=4.1.0; extra == "samples" in ./env/lib/python3.7/site-packages (from google-assistant-sdk[samples]==0.6.0) (4.12.0) Requirement already satisfied: requests-oauthlib>=0.7.0 in ./env/lib/python3.7/site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (1.3.0) Requirement already satisfied: google-auth in ./env/lib/python3.7/site-packages (from google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (1.20.0) Requirement already satisfied: certifi; extra == "secure" in ./env/lib/python3.7/site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (2020.6.20) Requirement already satisfied: idna>=2.0.0; extra == "secure" in ./env/lib/python3.7/site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (2.10) Requirement already satisfied: cryptography>=1.3.4; extra == "secure" in ./env/lib/python3.7/site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (2.4.2) Requirement already satisfied: pyOpenSSL>=0.14; extra == "secure" in ./env/lib/python3.7/site-packages (from urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (19.1.0) Requirement already satisfied: googleapis-common-protos>=1.5.2 in ./env/lib/python3.7/site-packages (from google-assistant-grpc==0.2.1; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (1.52.0) Requirement already satisfied: grpcio>=1.3.5 in ./env/lib/python3.7/site-packages (from google-assistant-grpc==0.2.1; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (1.30.0) Requirement already satisfied: six in ./env/lib/python3.7/site-packages (from pathlib2<3,>=2.3.0; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (1.15.0) Requirement already satisfied: CFFI>=1.0 in ./env/lib/python3.7/site-packages (from sounddevice<0.4,>=0.3.7; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (1.14.1) Requirement already satisfied: requests>=2.0.0 in ./env/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (2.24.0) Requirement already satisfied: oauthlib>=3.0.0 in ./env/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (3.1.0) Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (4.1.1) Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3.5" in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (4.6) Requirement already satisfied: setuptools>=40.3.0 in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (49.2.0) Requirement already satisfied: pyasn1-modules>=0.2.1 in ./env/lib/python3.7/site-packages (from google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (0.2.8) Requirement already satisfied: asn1crypto>=0.21.0 in ./env/lib/python3.7/site-packages (from cryptography>=1.3.4; extra == "secure"->urllib3[secure]<2,>=1.21; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (1.4.0) Requirement already satisfied: protobuf>=3.6.0 in ./env/lib/python3.7/site-packages (from googleapis-common-protos>=1.5.2->google-assistant-grpc==0.2.1; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (3.12.2) Requirement already satisfied: pycparser in ./env/lib/python3.7/site-packages (from CFFI>=1.0->sounddevice<0.4,>=0.3.7; extra == "samples"->google-assistant-sdk[samples]==0.6.0) (2.20) Requirement already satisfied: chardet<4,>=3.0.2 in ./env/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib>=0.7.0->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (3.0.4) Requirement already satisfied: pyasn1>=0.1.3 in ./env/lib/python3.7/site-packages (from rsa<5,>=3.1.4; python_version >= "3.5"->google-auth->google-auth-oauthlib[tool]>=0.1.0->google-assistant-sdk[samples]==0.6.0) (0.4.8) Installing collected packages: google-assistant-grpc Attempting uninstall: google-assistant-grpc Found existing installation: google-assistant-grpc 0.3.0 Uninstalling google-assistant-grpc-0.3.0: Successfully uninstalled google-assistant-grpc-0.3.0 Successfully installed google-assistant-grpc-0.2.1 Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=562010175920-96vpo5fmeoa9rhg5meo54unnuormejk7.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgcm&state=wzH8stukZD9DmqXFfAa7sb00s4TR5n&prompt=consent&access_type=offline Enter the authorization code: 4/2QHLs4wFlkO60lTqYn6cETK-T5RyX97ZH-wxKLQZLqXAsc01KCTh4dU credentials saved: /home/pi/.config/google-oauthlib-tool/credentials.json
Auto modification of the service file is not feasible. Manually check your username, project id and model id.....
Finished installing Google Assistant.......
Can you run the assistant now and see. Looks like only now the RPi.GPIO has been installed.
Can you run the assistant now and see. Looks like only now the RPi.GPIO has been installed.
Hello i have removed entire GassistPi folder and installed all again and after installation, i started manually.
(env) pi@raspberrypi:~ $ /home/${USER}/env/bin/python -u /home/${USER}/GassistPi/src/main.py --device_model_id 'assitancemirror-mirrorassistance-d68vsy' --project_id 'assitancemirror'
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:35: DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_pb=b'\n\x15google/api/http.proto\x12\ngoogle.api"T\n\x04Http\x12#\n\x05rules\x18\x01 \x03(\x0b\x32\x14.google.api.HttpRule\x12\'\n\x1f\x66ully_decode_reserved_expansion\x18\x02 \x01(\x08"\x81\x02\n\x08HttpRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x15\n\rresponse_body\x18\x0c \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x02\x04GAPIb\x06proto3',
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:62: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:80: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:92: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=121,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:119: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:137: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:155: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:173: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:191: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:209: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:227: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:245: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:263: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:281: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:297: DeprecationWarning: Call to deprecated create function OneofDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
fields=[],
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:301: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=381,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:328: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:346: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/http_pb2.py:358: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=430,
/home/pi/env/lib/python3.7/site-packages/google/api/annotations_pb2.py:42: DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
google_dot_protobuf_dot_descriptorpb2.DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/api/annotations_pb2.py:64: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/rpc/status_pb2.py:39: DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
dependencies=[google_dot_protobuf_dot_anypb2.DESCRIPTOR],
/home/pi/env/lib/python3.7/site-packages/google/rpc/status_pb2.py:66: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/rpc/status_pb2.py:84: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/rpc/status_pb2.py:102: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/rpc/status_pb2.py:114: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=144,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:48: DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
google_dot_rpc_dot_status__pb2.DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:70: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:97: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:115: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:133: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:151: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:169: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:185: DeprecationWarning: Call to deprecated create function OneofDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
fields=[],
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:189: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=373,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:216: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:228: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=410,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:255: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:273: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:291: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:309: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:321: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=504,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:348: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:366: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:378: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=606,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:405: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:417: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=646,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:444: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:456: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=686,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:483: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:501: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
file=DESCRIPTOR,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:513: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=749,
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:640: DeprecationWarning: Call to deprecated create function MethodDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_options=b"\202\323\344\223\002\027\022\025/v1/{name=operations}",
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:649: DeprecationWarning: Call to deprecated create function MethodDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_options=b"\202\323\344\223\002\032\022\030/v1/{name=operations/}",
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:658: DeprecationWarning: Call to deprecated create function MethodDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_options=b"\202\323\344\223\002\032\030/v1/{name=operations/}",
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:667: DeprecationWarning: Call to deprecated create function MethodDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_options=b'\202\323\344\223\002$"\037/v1/{name=operations/}:cancel:\001',
/home/pi/env/lib/python3.7/site-packages/google/longrunning/operations_proto_pb2.py:667: DeprecationWarning: Call to deprecated create function ServiceDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_options=b'\202\323\344\223\002$"\037/v1/{name=operations/}:cancel:\001',
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:36: DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_pb=b"\n\x15google/rpc/code.proto\x12\ngoogle.rpc\xb7\x02\n\x04\x43ode\x12\x06\n\x02OK\x10\x00\x12\r\n\tCANCELLED\x10\x01\x12\x0b\n\x07UNKNOWN\x10\x02\x12\x14\n\x10INVALID_ARGUMENT\x10\x03\x12\x15\n\x11\x44\x45\x41\x44LINE_EXCEEDED\x10\x04\x12\r\n\tNOT_FOUND\x10\x05\x12\x12\n\x0e\x41LREADY_EXISTS\x10\x06\x12\x15\n\x11PERMISSION_DENIED\x10\x07\x12\x13\n\x0fUNAUTHENTICATED\x10\x10\x12\x16\n\x12RESOURCE_EXHAUSTED\x10\x08\x12\x17\n\x13\x46\x41ILED_PRECONDITION\x10\t\x12\x0b\n\x07\x41\x42ORTED\x10\n\x12\x10\n\x0cOUT_OF_RANGE\x10\x0b\x12\x11\n\rUNIMPLEMENTED\x10\x0c\x12\x0c\n\x08INTERNAL\x10\r\x12\x0f\n\x0bUNAVAILABLE\x10\x0e\x12\r\n\tDATA_LOSS\x10\x0f\x42X\n\x0e\x63om.google.rpcB\tCodeProtoP\x01Z3google.golang.org/genproto/googleapis/rpc/code;code\xa2\x02\x03RPCb\x06proto3",
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:46: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="OK", index=0, number=0, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:49: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="CANCELLED", index=1, number=1, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:52: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="UNKNOWN", index=2, number=2, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:59: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None,
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:66: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None,
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:69: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="NOT_FOUND", index=5, number=5, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:72: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="ALREADY_EXISTS", index=6, number=6, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:79: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None,
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:86: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None,
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:93: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None,
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:100: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None,
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:103: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="ABORTED", index=11, number=10, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:106: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="OUT_OF_RANGE", index=12, number=11, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:113: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None,
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:116: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="INTERNAL", index=14, number=13, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:119: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="UNAVAILABLE", index=15, number=14, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:122: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
name="DATA_LOSS", index=16, number=15, serialized_options=None, type=None
/home/pi/env/lib/python3.7/site-packages/google/rpc/code_pb2.py:128: DeprecationWarning: Call to deprecated create function EnumDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=349,
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:32: DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
dependencies=[google_dot_api_dot_annotationspb2.DESCRIPTOR,google_dot_longrunning_dot_operationspb2.DESCRIPTOR,google_dot_protobuf_dot_anypb2.DESCRIPTOR,google_dot_protobuf_dot_durationpb2.DESCRIPTOR,google_dot_protobuf_dot_emptypb2.DESCRIPTOR,google_dot_protobuf_dot_timestamppb2.DESCRIPTOR,google_dot_rpc_dot_status__pb2.DESCRIPTOR,])
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:45: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:49: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:53: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:57: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:61: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:65: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:69: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:73: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:78: DeprecationWarning: Call to deprecated create function EnumDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=1382,
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:91: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:95: DeprecationWarning: Call to deprecated create function EnumValueDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
type=None),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:100: DeprecationWarning: Call to deprecated create function EnumDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=2140,
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:118: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
options=None, file=DESCRIPTOR),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:125: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
options=None, file=DESCRIPTOR),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:139: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=423,
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:156: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
options=None, file=DESCRIPTOR),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:163: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
options=None, file=DESCRIPTOR),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:177: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=571,
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:194: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
options=None, file=DESCRIPTOR),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:201: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
options=None, file=DESCRIPTOR),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:215: DeprecationWarning: Call to deprecated create function OneofDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
index=0, containing_type=None, fields=[]),
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:218: DeprecationWarning: Call to deprecated create function Descriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
serialized_end=727,
/home/pi/env/lib/python3.7/site-packages/google/cloud/speech_v1/proto/cloud_speech_pb2.py:235: DeprecationWarning: Call to deprecated create function FieldDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.
options=None, file=DESCRIPTOR),
/home/pi/GassistPi/src/actions.py:350: DeprecationWarning: invalid escape sequence \d
red,blue,green=re.findall('\d+', RGB)
/home/pi/GassistPi/src/actions.py:1429: DeprecationWarning: invalid escape sequence \d
bright=re.findall('\d+', phrase)
/home/pi/GassistPi/src/actions.py:1556: DeprecationWarning: invalid escape sequence \d
bright=re.findall('\d+', query)
/home/pi/env/lib/python3.7/site-packages/validictory/validator.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Mapping, Container
/home/pi/env/lib/python3.7/site-packages/yaml/constructor.py:126: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
if not isinstance(key, collections.Hashable):
INFO:gmusicapi.Mobileclient1:!-- begin debug log --!
INFO:gmusicapi.Mobileclient1:version: 13.0.0
INFO:gmusicapi.Mobileclient1:logging to: /home/pi/.cache/gmusicapi/log/gmusicapi.log
INFO:gmusicapi.Mobileclient1:initialized
INFO:gmusicapi.Mobileclient1:logged out
/home/pi/env/lib/python3.7/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /home/pi/.local/share/gmusicapi/mobileclient.cred: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
2020-07-29 21:43:34,154 - gmusicapi.Mobileclient1 (shared:176) [WARNING]: could not retrieve oauth credentials from ''/home/pi/.local/share/gmusicapi/mobileclient.cred''
WARNING:gmusicapi.Mobileclient1:could not retrieve oauth credentials from ''/home/pi/.local/share/gmusicapi/mobileclient.cred''
INFO:gmusicapi.Mobileclient1:failed to authenticate
[0182e5f0] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[01858788] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Traceback (most recent call last):
File "/home/pi/GassistPi/src/main.py", line 51, in
My Pi 3 is working absolutely fine. Need to see if this is an isolated incident with Pi 4. i will leave this issue open
My Pi 3 is working absolutely fine. Need to see if this is an isolated incident with Pi 4. i will leave this issue open
Ive formatted again, and installed direct google assistant sdk, and installed google assistant, which started working, but i am now able to find solution of how to integrate it with "Hello google" currently its "click to run"
If you are in a hurry and dont want me to investigate the cause of this issue use this branch https://github.com/shivasiddharth/GassistPi/tree/Just-Google-Assistant It has the Ok Google wakeword enabled.
Hi, just my 2 cents on this issue, on pi4 , I got the same error.
(env) pi@raspberrypi:~ $ python
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/env/lib/python3.7/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
>>>
so I just commented a line in actions.py when importing GPIO and an exception happens and the master branch works fine now.
try:
import RPi.GPIO as GPIO
except Exception as e:
#if str(e) == 'No module named \'RPi\'':
GPIO = None
Hi Thank you for the help, yes it worked and started working. but i had to comment #if str(e) == 'No module named \'RPi\'': from both actions.py and main.py to get it working.
Hi, just my 2 cents on this issue, on pi4 , I got the same error.
(env) pi@raspberrypi:~ $ python Python 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import RPi.GPIO as GPIO Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/pi/env/lib/python3.7/site-packages/RPi/GPIO/__init__.py", line 23, in <module> from RPi._GPIO import * RuntimeError: This module can only be run on a Raspberry Pi! >>>
so I just commented a line in actions.py when importing GPIO and an exception happens and the master branch works fine now.
try: import RPi.GPIO as GPIO except Exception as e: #if str(e) == 'No module named \'RPi\'': GPIO = None
@shivasiddharth No I'm not in hurry sir, I was just finishing the magic mirror so wanted to add assistant along with it. Anyway it started working after commenting line but a question though. Commenting this, mean that it will also disable GPIO from code? I mean then we will not be able to control gpio through Google assistant?
Also In your old videos you mentioned to control home lights with Google assistant only with correcting the "kitchen lights", "bedroom light" from main.py arrays. How do I define now? Or now have to do with nodemcu and iffft?
Also this issue could be only with Raspberry 4.
The GPIO version that this project uses is currently 0.6.3 which supports boards only till Pi 3B+. If you need GPIO support for Pi 4 you need to update the RPi.GPIO version. Updating might present some errors with the existing code which may have to be troubleshooted.
Hi i have tried to add LED indicator and tried to safe shutdown with commands but they are not working. The LED indicators are not working and when i tried safe shutdown it returned with error of voice commands not supported.
I am running currently GPIO version 0.7.
any way around to the issue? and make it work, at least the indicators?
i tried safe shutdown it returned with error of voice commands not supported.
It is not an error. It is just that you have not adhered to the command syntax. Check the README for the command syntax.
But it should automatically light up the indication lights when talking and listening? On GPIO 5 & 6? I have manually tried and check if I can on off those leds. Those are working but not working in GassistPi.
Or do I have to activate them?
There are couple of things that could have gone wrong:
source env/bin/activate
.There are couple of things that could have gone wrong:
- You could have installed the latest RPi.GPIO outside the environment and not inside the environment. Installation within the environment should be performed after using
source env/bin/activate
.- You could have used the Board Pin numbers 5 and 6 instead of BCM GPIO 5 and 6. GassistPi uses BCM numbers.
Hello sir thank you so much for amazing help, that worked. Actually ive installed RPi outside of env. and that was causing issue. and now the indicator LEDs are working.
Now final issue that i am facing and its completely out of code i think. But i have connected 4 channels relay with it, connected fan, and 2 lights. Now issue is all connections are by default gets ON automatically as soon as assistant starts. As i have added their BCM numbers in Config file.
Even in environment, when i give command to light "GPIO.output(37,GPIO.HIGH) it actually OFF the switch instead of turning it ON, and it automatically OFFs the light and 2 second later it starts the light.
It might be like one of those sainsmart like relay modules which have inverse logic. You need to change the logic in the board if you can or modify the code. Its an issue with your relay module not with the codes.
IMPORTANT NOTICE
If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.
FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED
Which branch of GassistPi are you using ?
Board and OS details:
Open a terminal and run
Describe the bug:
Did you go through or search the issues section to check if your issue was already discussed (either currently open issues or closed issues)?
Yes/No
2. Is the issue related to assistant installation ?
No
If answer to question 2 is Yes, then attach the contents of terminal as a file or paste it below.
If answer to question 2 is No, then proceed further.
3. Does the assistant service start normally?
No
4. Is the assistant service restarting automatically?
No
If answer to question 4 is Yes, then paste the contents of the terminal below.
If answer to question 4 is No, then proceed further.
Manually start the assistant. For guidelines to start the assistant manually refer this
Paste the command below, that crashed the assistant
Paste the contents of the terminal below