Giter Site home page Giter Site logo

ai-smart-mirror's People

Contributors

atainter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ai-smart-mirror's Issues

AI setup error

Hi Aaron,

I've been having an issue with setting up AI and tried to google for answers but couldn't figure it out. When I type "source hhsmartmirror/bin/activate" I get an error message. Please take a look at this error. Thanks!

image

Error starting Python MM

SyntaxError: invalid syntax
NA-3:AI-Smart-Mirror w$ python bot.py
Traceback (most recent call last):
File "bot.py", line 7, in
import requests
ImportError: No module named requests
NA-3:AI-Smart-Mirror w$

AI cannot display weather

weather
/Users/samsonlok/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:132: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
Failed wit!
[Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Speech_Recognition Error

I have installed speech recognition when i try to run python bot.py it says ImportError: No module name speech_recognition?

Getting error after launch phrase

Google Speech Recognition thinks you said ok Traceback (most recent call last): File "bot.py", line 254, in <module> bot.start() File "bot.py", line 45, in start self.__acknowledge_action() File "bot.py", line 143, in __acknowledge_action self.__text_action(self.nlg.acknowledge()) File "bot.py", line 154, in __text_action self.speech.synthesize_text(text) File "/Users/sandeeprajup/Desktop/Smart-Mirror-AI/AI-Smart-Mirror/speech.py", line 54, in synthesize_text song = AudioSegment.from_mp3("tmp.mp3") File "/Users/sandeeprajup/Desktop/Smart-Mirror-AI/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/pydub/audio_segment.py", line 460, in from_mp3 return cls.from_file(file, 'mp3') File "/Users/sandeeprajup/Desktop/Smart-Mirror-AI/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/pydub/audio_segment.py", line 443, in from_file p = subprocess.Popen(conversion_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1343, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory (hhsmartmirror) MacBook-Pro:AI-Smart-Mirror sandeeprajup$

sudo ./setup.sh

this is what i get after following your youtube tutorial?

Fraias-MacBook:AI-Smart-Mirror fraiamillar$ sudo ./setup.sh
./setup.sh: line 3: pip: command not found
./setup.sh: line 4: virtualenv: command not found
./setup.sh: line 5: ./hhsmartmirror/bin/activate: No such file or directory
./setup.sh: line 6: pip: command not found
./setup.sh: line 7: pip: command not found

Running Anaconda and virtualenv - setup.h

Hi,

I am running anaconda on my OSX, and I am having trouble running setup.h. I use the sudo command, but since I already have anaconda (and I use it and want to maintain it), the virtualenv module already exists. Can someone please offer some advice on how to go about proceeding to debug this issue?

screen shot 2017-05-18 at 2 58 52 pm

Thank you

Electron microphone bug

anyone come across something like this before?

In the codes there is this section
r = requests.get(“http://localhost:8080/microphone?enabled=%s” % str(enable))
if r.status_code != 200:
print(“Used wrong endpoint for microphone debugging”)

The above snippet basically means it is making a get request to the electron to enable microphone and it’s sending codes other than 200 which is causing to print the “wrong debugging microphone…” etc. So basically the issue persists in the npm start command meaning the electron

video

can any body plzz upload a video tutorial of this so it can be easy to install

trouble installing ffmpeg

i had trouble with "brew install ffmpeg" it returns the following error:
*** Error in `/usr/bin/gcc-4.9': double free or corruption (top): 0x003cc718 ***
can anyone help please?

Issue with microphone

when I run python bot.py
Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV. Used wrong endpoint for microphone debugging Found face ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) unable to open slave Used wrong endpoint for microphone debugging I'm listening Used wrong endpoint for microphone debugging Found audio Google Speech Recognition could not understand audio Found face

KeyError: 'minutely'

Hi,

The mirror keeps failing to understand the weather intent.
Do you know how to fix KeyError: 'minutely'?

Thanks!

--
I'm listening
Found audio
Google Speech Recognition thinks you said how's the weather like today
{
"msg_id" : "204ad351-2b59-4edc-bdda-f418438d8100",
"_text" : "how's the weather like today",
"entities" : {
"datetime" : [ {
"confidence" : 0.9965476720505433,
"values" : [ {
"value" : "2017-02-01T00:00:00.000-08:00",
"grain" : "day",
"type" : "value"
} ],
"value" : "2017-02-01T00:00:00.000-08:00",
"grain" : "day",
"type" : "value"
} ],
"Intent" : [ {
"confidence" : 0.9993092979476336,
"value" : "weather"
} ]
}
}
weather
Failed wit!
'minutely'
Traceback (most recent call last):
File "bot.py", line 79, in decide_action
self.__weather_action(entities)
File "bot.py", line 174, in __weather_action
weather_obj = self.knowledge.find_weather()
File "/Users/1100192/Desktop/RayzSmartMirror/AI-Smart-Mirror/knowledge.py", line 25, in find_weather
hourly_forecast = weather_json['minutely']['summary']
KeyError: 'minutely'

Not Displaying

So everything works besides the Display, I can speak to the AI and it answers.
So if I say "show me a Satellite Map of England" the AI answers "Sure here is a Satellite Map of England" but I'm not getting anything shown on the screen.
Reinstalled electron(node.js) aswell as the MagicMirror from MichMich.
Then i used sudo npm start dev to check the console, and it says

Starting module: clock
Starting module: calendar
Starting module: currentweather
Starting module: weatherforecast
Starting module: newsfeed
Starting module: aiclient
Starting module: aiclientdebugger
All modules started!

I also tried to replace the config.js from AI-Smart-Mirror/magic_mirror with the MagicMirror/config/config.js (well i copied into it). Still not showing.

Issue with bot.py

This is what comes up when I try to start the bot. It listens and understands but doesn't go all the way.

python[5881:116623] 15:14:58.752 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.

ALSA lib

This Error is occurring :

(hhsmartmirror) pi@raspberrypi:~/AI-Smart-Mirror $ python bot.py
Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV.
Used wrong endpoint for microphone debugging
Found face
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

I already tried everything that i found on the internet and nothing seems to work.
I removed the virtualenv and started the setup.sh again, it's still not working, i even tried to install pyaudio manually.

Any suggestions on how to fix?

It's really frustrating.

No response from AI after launch phrase

Google Speech Recognition thinks you said ok mirror
Found face
I'm listening
Found audio
Google Speech Recognition thinks you said ok mirror
Found face
I'm listening

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave

ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
I'm listening
^CTraceback (most recent call last):
File "bot.py", line 254, in
bot.start()
File "bot.py", line 43, in start
recognizer, audio = self.speech.listen_for_audio()
File "/home/pi/mirror/speech.py", line 37, in listen_for_audio
audio = r.listen(source)
File "/usr/local/lib/python2.7/dist-packages/speech_recognition/init.py", line 559, in listen
buffer = source.stream.read(source.CHUNK)
File "/usr/local/lib/python2.7/dist-packages/speech_recognition/init.py", line 161, in read
return self.pyaudio_stream.read(size, exception_on_overflow=False)
File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 608, in read
return pa.read_stream(self._stream, num_frames, exception_on_overflow)

python bot.py

What Im missing @atainter ? plz help.

(hhsmartmirror) pi@raspberrypi:~/AI-Smart-Mirror $ python bot.py
Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV.
Found face
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2719
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
Traceback (most recent call last):
File "bot.py", line 254, in
bot.start()
File "bot.py", line 43, in start
recognizer, audio = self.speech.listen_for_audio()
File "/home/pi/AI-Smart-Mirror/speech.py", line 33, in listen_for_audio
with m as source:
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/speech_recognition/init.py", line 117, in enter
input = True, # stream is an input stream
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pyaudio.py", line 750, in open
stream = Stream(self, *args, **kwargs)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pyaudio.py", line 441, in init
self._stream = pa.open(**arguments)
IOError: [Errno -9997] Invalid sample rate

Doesn't seem to work on Raspberry pi

In case you guys wanted some data, setup for AI seems to fail for raspberry pi's. I tried a RP Zero and a RP 2b+ and get the same error.

`:~/AI-Smart-Mirror$ sudo ./setup.sh
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/dist-packages
Cleaning up...
New python executable in /home/pi/AI-Smart-Mirror/hhsmartmirror/bin/python
Installing setuptools, pip, wheel...done.
Collecting speechrecognition (from -r requirements.txt (line 1))
Downloading SpeechRecognition-3.5.0.tar.gz (31.5MB)
99% |████████████████████████████████| 31.5MB 1.3MB/s eta 0:00:01Exception:
Traceback (most recent call last):
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/download.py", line 659, in unpack_http_url
hashes)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/download.py", line 571, in written_chunks
for chunk in chunks:
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/utils/ui.py", line 139, in iter
for x in it:
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/download.py", line 560, in resp_read
decode_content=False):
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 314, in read
data = self._fp.read(amt)
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 63, in read
self._close()
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 50, in _close
self.__callback(self.__buf.getvalue())
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 275, in cache_response
self.serializer.dumps(request, response, body=body),
File "/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 87, in dumps
).encode("utf8"),
MemoryError
/home/pi/AI-Smart-Mirror/hhsmartmirror/local/lib/python2.7/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting pyaudio
Using cached PyAudio-0.2.9.tar.gz
Skipping bdist_wheel for pyaudio, due to binaries being disabled for it.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command /home/pi/AI-Smart-Mirror/hhsmartmirror/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-nZAyv3/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-hzIsEq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/AI-Smart-Mirror/hhsmartmirror/include/site/python2.7/pyaudio:
running build_ext
building '_portaudio' extension
creating build
creating build/temp.linux-armv6l-2.7
creating build/temp.linux-armv6l-2.7/src
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-armv6l-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:28:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------

Command "/home/pi/AI-Smart-Mirror/hhsmartmirror/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-nZAyv3/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-hzIsEq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/AI-Smart-Mirror/hhsmartmirror/include/site/python2.7/pyaudio" failed with error code 1 in /tmp/pip-build-nZAyv3/pyaudio/`

to get around this, i manually installed speechrecognition:

pip install SpeechRecognition

and then commented out that line in the requirements.txt file.

I also had other missing deps. I had to run:

apt-get install python-dev
apt-get install python-devel
apt-get install libportaudio-dev
apt-get install portaudio19-dev

then i could run AI-Smart-Mirror's setup.sh

'utf8' codec can't decode byte 0x8b in position 1: invalid start byte

I´ve been running AI-Smart-Mirror together with Magic Mirror for quite some time now but since two days or so it doens´t work anymore and collapses after it recognized audio the first time. It somehow has a problem with Google Speech Recognition and decoding my text I guess but I didn´t change anything so I really don´t know what it is. Maybe someone else had similar problems?
Thanks in advance!

Here´s the error:

I'm listening
Found audio
Traceback (most recent call last):
File "bot.py", line 500, in
bot.start()
File "bot.py", line 52, in start
if self.speech.is_call_to_action(recognizer, audio):
File "/Users/nicolasfraikin/Documents/Raspberry_Pi_Projekte/Project_Smart_Mirror/AI-Smart-Mirror-master/speech.py", line 44, in is_call_to_action
speech = self.google_speech_recognition(recognizer, audio)
File "/Users/nicolasfraikin/Documents/Raspberry_Pi_Projekte/Project_Smart_Mirror/AI-Smart-Mirror-master/speech.py", line 20, in google_speech_recognition
speech = recognizer.recognize_google(audio, language="de")
File "/Users/nicolasfraikin/Documents/Raspberry_Pi_Projekte/Project_Smart_Mirror/AI-Smart-Mirror-master/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 725, in recognize_google
response_text = response.read().decode("utf-8")
File "/Users/nicolasfraikin/Documents/Raspberry_Pi_Projekte/Project_Smart_Mirror/AI-Smart-Mirror-master/hhsmartmirror/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: invalid start byte

fatal error: 'portaudio.h' file not found

Collecting pyaudio
Downloading PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command /Users/Yogi/Downloads/AI-Smart-Mirror-master/hhsmartmirror/bin/python -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-6JQRPe/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /tmp/pip-grk5rN-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/Yogi/Downloads/AI-Smart-Mirror-master/hhsmartmirror/include/site/python2.7/pyaudio:
running build_ext
building '_portaudio' extension
creating build
creating build/temp.macosx-10.12-intel-2.7
creating build/temp.macosx-10.12-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DMACOSX=1 -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: c
1 error generated.
error: command 'cc' failed with exit status 1

After "ok mirror" the whole process stops! (MacOS Sierra 10.12.2)

I'm listening
Found audio
Traceback (most recent call last):
File "bot.py", line 254, in
bot.start()
File "bot.py", line 44, in start
if self.speech.is_call_to_action(recognizer, audio):
File "/Users/activea/Desktop/AI-Smart-Mirror-master/speech.py", line 44, in is_call_to_action
speech = self.google_speech_recognition(recognizer, audio)
File "/Users/activea/Desktop/AI-Smart-Mirror-master/speech.py", line 20, in google_speech_recognition
speech = recognizer.recognize_google(audio)
File "/Users/activea/Desktop/AI-Smart-Mirror-master/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 741, in recognize_google
best_hypothesis = max(actual_result["alternative"], key=lambda alternative: alternative["confidence"])
File "/Users/activea/Desktop/AI-Smart-Mirror-master/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 741, in
best_hypothesis = max(actual_result["alternative"], key=lambda alternative: alternative["confidence"])
KeyError: 'confidence'

Raspberry Pi Implementation

Hi @atainter,
After trying this on my mac I tried to install it on my Pi but it won't work.
Did you use a Pi to do this or your mac? Can this be implemented on a Pi or not? If so how, because when I try to clone it on the Pi it says that I don't have rights and when I download the Zip it can't decode it, why is that?
Thanks

say "ok mirror" error

I am running in Mac OS, and virtual enviornment
(hhsmartmirror) Chriss-MBP:AI-Smart-Mirror CG$

When I say launch phrase "ok mirror"

it throws error message as below,

log below

Found face
I'm listening
Found audio
Traceback (most recent call last):
File "bot.py", line 254, in
bot.start()
File "bot.py", line 44, in start
if self.speech.is_call_to_action(recognizer, audio):
File "/Users/CG/workspace/AI-Smart-Mirror/speech.py", line 44, in is_call_to_action
speech = self.google_speech_recognition(recognizer, audio)
File "/Users/CG/workspace/AI-Smart-Mirror/speech.py", line 20, in google_speech_recognition
speech = recognizer.recognize_google(audio)
File "/Users/CG/workspace/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 741, in recognize_google
best_hypothesis = max(actual_result["alternative"], key=lambda alternative: alternative["confidence"])
File "/Users/CG/workspace/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 741, in
best_hypothesis = max(actual_result["alternative"], key=lambda alternative: alternative["confidence"])
KeyError: 'confidence'

when say other phrases, google will recognize but wont activate the mirror.

Final steps in setting up AI

I can't seem to do the last steps for some weird reason. I have it all until the sudo ./setup.sh part. It doesn't work for me. Can someone help?

adding stories to wit.ai

hi, I'm new to wit.ai and have been having some problems adding stories. I've added some new Intents as well as stories and downloaded the zip file, which I put it in the models folder. But when I run my story phrases, it doesn't understand. Does anyone know what I did wrong or please provide steps to get stories working? Thank you.

Jack Server

Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

Tried everything that i found on Google, it worked once, after reboot it stopped working.

Any suggestions?

starting bot.py

Traceback (most recent call last):
File "bot.py", line 12, in
from nlg import NLG
File "/Users/interview6/Desktop/!mirror/AI-Smart-Mirror-master/nlg.py", line 4, in
from py4j_server import launch_py4j_server
File "/Users/interview6/Desktop/!mirror/AI-Smart-Mirror-master/py4j_server/init.py", line 8, in
from py4j.java_gateway import JavaGateway, GatewayClient, java_import
ImportError: No module named py4j.java_gateway
(hhsmartmirror) alex:AI-Smart-Mirror-master interview6$ python bot.py
Traceback (most recent call last):
File "bot.py", line 12, in
from nlg import NLG
File "/Users/interview6/Desktop/!mirror/AI-Smart-Mirror-master/nlg.py", line 4, in
from py4j_server import launch_py4j_server
File "/Users/interview6/Desktop/!mirror/AI-Smart-Mirror-master/py4j_server/init.py", line 8, in
from py4j.java_gateway import JavaGateway, GatewayClient, java_import
ImportError: No module named py4j.java_gateway

Permision denied linking py and cv

Navigate to the site-packages folder in the virtual environment

cd hhsmartmirror/lib/python2.7/site-packages
Link the cv.py and cv2.so files and replace $VERSION with the version you found

ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv.py cv.py
ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv2.so cv2.s
Check that the files are there

ls

/////

NA-3:~ w$ cd AI-Smart-Mirror
NA-3:AI-Smart-Mirror w$ source hhsmartmirror/bin/activate
(hhsmartmirror) NA-3:AI-Smart-Mirror w$ python bot.py
/Users/w/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/pydub/utils.py:178: RuntimeWarning: Couldn't find ffplay or avplay - defaulting to ffplay, but may not work
warn("Couldn't find ffplay or avplay - defaulting to ffplay, but may not work", RuntimeWarning)
Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV.
Found face
Traceback (most recent call last):
File "bot.py", line 254, in
bot.start()
File "bot.py", line 43, in start
recognizer, audio = self.speech.listen_for_audio()
File "/Users/w/AI-Smart-Mirror/speech.py", line 32, in listen_for_audio
m = sr.Microphone()
File "/Users/w/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 56, in init
self.pyaudio_module = self.get_pyaudio()
File "/Users/w/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/speech_recognition/init.py", line 86, in get_pyaudio
raise AttributeError("Could not find PyAudio; check installation")
AttributeError: Could not find PyAudio; check installation
(hhsmartmirror) NA-3:AI-Smart-Mirror w$ deactivate
NA-3:AI-Smart-Mirror w$ cd hhsmartmirror/lib/python2.7/site-packages
NA-3:site-packages w$ ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv.py cv.py
ln: cv.py: Permission denied
NA-3:site-packages w$ ln -s /usr/local/Cellar/opencv/$VERSION/lib/python2.7/site-packages/cv2.so cv2.s
ln: cv2.s: Permission denied
NA-3:site-packages w$ ls
SpeechRecognition-3.5.0-py2.7.egg-info py4j
dateutil py4j-0.10.4.dist-info
easy_install.py pydub
easy_install.pyc pydub-0.16.6.dist-info
feedparser-5.2.1-py2.7.egg-info python_dateutil-2.6.0.dist-info
feedparser.py requests
feedparser.pyc requests-2.12.1.dist-info
gTTS-1.1.6-py2.7.egg-info setuptools
gTTS_token-1.1.1-py2.7.egg-info setuptools-28.8.0.dist-info
gtts six-1.10.0.dist-info
gtts_token six.py
numpy six.pyc
numpy-1.11.2.dist-info speech_recognition
pip wheel
pip-9.0.1.dist-info wheel-0.29.0.dist-info
pkg_resources

OpenCV error : error: (-215) scn == 3 || scn == 4 in function cvtColor (fixed - need confirmation)

Hi, couple days ago I have worked with this project and encounter this error below, I did a little tune and the error seems to have disappeared so I think I would like to submit my fix for those who may concerned. Authors please check it for me, thank you in advance (sorry I'm not that good with git =.='):

Issue reproduce:

  1. Set up project as README instructions
  2. Run with low-average webcam or in dark environments for better bug encounter
  3. while webcam is running, occasionally error is thrown on terminal and bot.py is terminated:

Found face
I'm listening
Found audio
Google Speech Recognition could not understand audio
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /tmp/opencv-20170224-1869-10nlf6f/opencv-2.4.13.2/modules/imgproc/src/color.cpp, line 3739
Traceback (most recent call last):
File "bot.py", line 254, in
bot.start()
File "bot.py", line 40, in start
if self.vision.recognize_face():
File "/Users/macuser/AI-Smart-Mirror/vision.py", line 32, in recognize_face
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /tmp/opencv-20170224-1869-10nlf6f/opencv-2.4.13.2/modules/imgproc/src/color.cpp:3739: error: (-215) scn == 3 || scn == 4 in function cvtColor

Suspected cause:
while streaming webcam there must be a corrupted frame that have been assigned into cvtColor() and produce error
reference: http://www.pyimagesearch.com/2016/12/26/opencv-resolving-nonetype-errors/

Suggest fix:
change vision.py line 32 from

gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

to:

if ret is True:
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
else:
continue

Opencv installation problem

hello,
I have a problem of installation of opencv

pi@raspberrypi:~ $ brew install opencv
Updating Homebrew...
==> Installing opencv from homebrew/science
==> Downloading https://github.com/opencv/opencv/archive/2.4.13.2.tar.gz
Already downloaded: /home/pi/.cache/Homebrew/opencv-2.4.13.2.tar.gz
==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/home/pi/.linuxbrew/Cellar/opencv/2.4.13.2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DCMAKE_OSX_DEPLOYMENT_TARGET= -DBUILD_ZLIB=OFF -DBUILD_TIFF=OFF -DBUILD_PNG=OFF -DBUILD_JASPER=OFF -DBUILD_JPEG=OFF -DJPEG_INCLUDE_DIR=/home/pi/.linuxbrew/opt/jpeg/include -DJPEG_LIBRARY=/home/pi/.linuxbrew/opt/jpeg/lib/libjpeg.so -DBUILD_OPENEXR=ON -DBUILD_opencv_python=ON -DBUILD_opencv_java=OFF -DWITH_OPENEXR=ON -DWITH_EIGEN=ON -DWITH_TBB=OFF -DWITH_FFMPEG=OFF -DWITH_QUICKTIME=OFF -DWITH_1394=OFF -DWITH_OPENGL=OFF -DWITH_JASPER=OFF -DWITH_GSTREAMER=OFF -DWITH_XIMEA=OFF -DWITH_VTK=OFF -DPYTHON_LIBRARY=/home/pi/.linuxbrew/Cellar/python/2.7.13/lib/libpython2.7.so -DPYTHON_INCLUDE_DIR=/home/pi/.linuxbrew/Cellar/python/2.7.13/include/python2.7 -DWITH_CUDA=OFF -DWITH_OPENCL=OFF -DCMAKE_OSX_ARCHITECTURES=i386 -DOPENCV_EXTRA_C_FLAGS='-arch i386 -m32' -DOPENCV_EXTRA_CXX_FLAGS='-arch i386 -m32'
Last 15 lines from /home/pi/.cache/Homebrew/Logs/opencv/01.cmake:
-- Check size of unsigned short
-- Check size of unsigned short - failed
-- Check size of unsigned int
-- Check size of unsigned int - failed
-- Check size of unsigned long
-- Check size of unsigned long - failed
CMake Error at /home/pi/.linuxbrew/Cellar/cmake/3.7.2/share/cmake/Modules/TestBigEndian.cmake:41 (message):
no suitable type found
Call Stack (most recent call first):
CMakeLists.txt:481 (test_big_endian)

-- Configuring incomplete, errors occurred!
See also "/tmp/opencv-20170404-11090-4069vm/opencv-2.4.13.2/macbuild/CMakeFiles/CMakeOutput.log".
See also "/tmp/opencv-20170404-11090-4069vm/opencv-2.4.13.2/macbuild/CMakeFiles/CMakeError.log".

READ THIS: https://github.com/Linuxbrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting

These open issues may also help:
opencv lopencv_imgcodecs not found https://github.com/Homebrew/homebrew-science/issues/4680
opencv modify libstdc++ to libc++ https://github.com/Homebrew/homebrew-science/pull/2714
OpenCV 3.1.0 Java Link Problem https://github.com/Homebrew/homebrew-science/issues/3268

help needed as soon as possible
Thank You

Suggestion

If MagicMirror is a dependency, why not add it as a submodule so they both download together?

$ git clone --recursive https://github.com/HackerHouseYT/AI-Smart-Mirror/

bot.py "Cannot GET/clear"

Hey guys,

I'm setting up a test AI-Smart-Mirror/Magic Mirror on my Linux box before building a self installer for a smaller Linux setup for the actual mirror. I want to add to your AI features, like determining faces, Deep Learning databases for person specific interactions, and possibly interactive animations, so I'm not building on a PI, but using an old Netbook for the actual build.

But I have a fairly standard Linux Mint desktop that I am configuring your Mac install to work on. After getting a lot of the install procedures to work here, I am stuck with the bot.py unable to speak to the browser.

In your instructions, you test the browser by doing a localhost:8080/statement=whatever entry into the browser. My machine, which has no problem loading the MagicMirror to localhost, returns the statement command with "Cannot GET/statement=whatever"

I have disabled all firewalls, and stopped all other servers, and searched the interwebs to no conclusion. I am hoping you guys might have some input on why I am stuck. I hope this is the right place to ask, if not let me know and I'll drop the issue.

Thanks again guys and this is a fun project! Found you guys on YouTube and am building the Retropie controller next! Thanks again!

Scot

o

ooknams-Mac-mini:~ looknam$ cd AI-Smart-Mirror
Looknams-Mac-mini:AI-Smart-Mirror looknam$ deactivate
-bash: deactivate: command not found
Looknams-Mac-mini:AI-Smart-Mirror looknam$ source hhsmartmirror/bin/activate
(hhsmartmirror) Looknams-Mac-mini:AI-Smart-Mirror looknam$ deactivate
Looknams-Mac-mini:AI-Smart-Mirror looknam$ cd hhsmartmirror/lib/python2.7/site-packages
Looknams-Mac-mini:site-packages looknam$ cd hhsmartmirror/lib/python2.7/site-packages
-bash: cd: hhsmartmirror/lib/python2.7/site-packages: No such file or directory
Looknams-Mac-mini:site-packages looknam$ ls
PyAudio-0.2.9-py2.7.egg-info py4j
SpeechRecognition-3.5.0-py2.7.egg-info py4j-0.10.4.dist-info
_portaudio.so pyaudio.py
dateutil pyaudio.pyc
easy_install.py pydub
easy_install.pyc pydub-0.16.6.dist-info
feedparser-5.2.1-py2.7.egg-info python_dateutil-2.6.0.dist-info
feedparser.py requests
feedparser.pyc requests-2.12.1.dist-info
gTTS-1.1.6-py2.7.egg-info setuptools
gTTS_token-1.1.1-py2.7.egg-info setuptools-29.0.0.dist-info
gtts six-1.10.0.dist-info
gtts_token six.py
numpy six.pyc
numpy-1.11.2.dist-info speech_recognition
pip wheel
pip-9.0.1.dist-info wheel-0.29.0.dist-info
pkg_resources
Looknams-Mac-mini:site-packages looknam$ cd ../../../..
Looknams-Mac-mini:AI-Smart-Mirror looknam$ source hhsmartmirror/bin/activate
(hhsmartmirror) Looknams-Mac-mini:AI-Smart-Mirror looknam$ python bot.py
/Users/looknam/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/pydub/utils.py:178: RuntimeWarning: Couldn't find ffplay or avplay - defaulting to ffplay, but may not work
warn("Couldn't find ffplay or avplay - defaulting to ffplay, but may not work", RuntimeWarning)
Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV.
Found face
I'm listening
Found audio
Google Speech Recognition thinks you said where can you hear me hello hello
Found face
I'm listening

Having an issue when running bot.py as well as vision.py

I have built a magic mirror using the MagicMirror2 framework and have had no issues on a RaspberryPI

I am trying to build the MM2 using a MacMini. When the MM is started I get a blank black screen.

I have tested it through a browser with the localhost:8080 with a text message and that works.
The main issue is I can't get the vision part working. The camera works with FaceTime for Mac and QuicCam from the App store.
This is the following errors I receive when running the step by step process.

The MacMini is running 10.10.5 with 4GB of memory
I have opencv3 running version 3.2.0
I have JRE 1.8

I have not modified any of the files other than the API keys in bot.py.

I am probably missing something really simple but can't seem to locate it.
Please Help!!

Mike Shain

AI-Mac-Mini:MagicMirror myname$ npm start

[email protected] start /Users/myname/MagicMirror
sh run-start.sh

Starting MagicMirror: v2.1.1
Loading config ...
Loading module helpers ...
Initializing new module helper ...
Module helper loaded: aiclient
Initializing new module helper ...
Module helper loaded: aiclientdebugger
All module helpers loaded.
Starting server on port 8080 ...
Starting server op port 8080 ...
Server started ...
Connecting socket for: aiclient
Starting node helper for: aiclient
Connecting socket for: aiclientdebugger
Starting node helper for: aiclientdebugger
Sockets connected & modules started ...
Launching application.
<<<< VTVideoEncoderSelection >>>> VTSelectAndCreateVideoEncoderInstanceInternal: no video encoder found for 'avc1'

[20:47:22.929] VTSelectAndCreateVideoEncoderInstanceInternal signalled err=-12908 (err) (Video encoder not available) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.238/Sources/VideoToolbox/VTVideoEncoderSelection.c line 1245
[20:47:22.929] VTCompressionSessionCreate signalled err=-12908 (err) (Could not select and open encoder instance) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.238/Sources/VideoToolbox/VTCompressionSession.c line 946
helper received: INITIALIZE
helper received: INITIALIZE

from virtual environment when trying to run bot.py

(hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$ python bot.py

No Java runtime present, requesting install.

Traceback (most recent call last):

File "bot.py", line 12, in

from nlg import NLG

File "/Users/myname/MagicMirror/AI-Smart-Mirror/nlg.py", line 7, in

gateway = launch_py4j_server()

File "/Users/myname/MagicMirror/AI-Smart-Mirror/py4j_server/init.py", line 34, in launch_py4j_server

_port = int(_pid.stdout.readline())

ValueError: invalid literal for int() with base 10: ''

(hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$

When trying to run vision.py

(hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$ python vision.py
Warning: OpenCV not installed. To use facial recognition, make sure you've properly configured OpenCV.
Traceback (most recent call last):
File "vision.py", line 51, in
faceCascade = cv2.CascadeClassifier("models/facial_recognition_model.xml")
NameError: name 'cv2' is not defined
(hhsmartmirror) AI-Mac-Mini:AI-Smart-Mirror myname$

Weather Units

So somehow, I managed to get this working on my Raspberry pi3 (except the facial recognition).

I've got things running mostly how I want, but I can't figure out for the life of me, how to change the units from Fahrenheit to Celsius for the temperature. Can you please point me in the right direction?

Thanks from the UK,
Danny

trying to get the mirror to talk french

i just followed the steps of the installation and everything is going well, it says it's listening but the probleme is i want GTTS to analyse my language as french i changed everything to french in the files (knowledge, bot, nlg..) and i changed "en" to "fr" in the speech.py
tts = gTTS(text=text, lang='fr')
please help

Couldn't find ffplay or avplay

Hi I seem to have a problem when I run python bot.py eveytime I do it I get this

/Users/JoeySabarese/AI-Smart-Mirror/hhsmartmirror/lib/python2.7/site-packages/pydub/utils.py:178: RuntimeWarning: Couldn't find ffplay or avplay - defaulting to ffplay, but may not work
warn("Couldn't find ffplay or avplay - defaulting to ffplay, but may not work", RuntimeWarning)

Then it goes on and recognizes my speech just wont speak back or display anything.

OSError

╭─root@CrankBox  /opt/AI-Smart-Mirror  ‹master*›
╰─# source hhsmartmirror/bin/activate 
(hhsmartmirror) ╭─root@CrankBox  /opt/AI-Smart-Mirror  ‹master*›
╰─# python bot.py
Traceback (most recent call last):
  File "bot.py", line 12, in <module>
    from nlg import NLG
  File "/opt/AI-Smart-Mirror/nlg.py", line 7, in <module>
    gateway = launch_py4j_server()
  File "/opt/AI-Smart-Mirror/py4j_server/__init__.py", line 31, in launch_py4j_server
    stdout=PIPE, stdin=PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

OS Debian Jessie , all stable and updated

sudo ./setup.sh

Hello,
Im getting the following error while entring sudo ./setup.sh. What im missing ?

pi@raspberrypi:~/AI-Smart-Mirror $ cat setup.sh
#!/bin/bash

pip install virtualenv
virtualenv hhsmartmirror
source ./hhsmartmirror/bin/activate
pip install -r requirements.txt
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio

pi@raspberrypi:~/AI-Smart-Mirror $ sudo ./setup.sh
sudo: ./setup.sh: command not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.