This project aims to provide an intelligent visual aid for blind and visually impaired to help them navigate their environment, read newpapers, books and magazines and also browse the internet iGlass v2.0 workflow
Linux: All the installations where run and tested on a linux OS of both the system and raspberry pi. It will likely work on a Windows OS. Open-source Libraries Used:
- Chatterbot: an offline chatbot system
- beautifulsoup: python webscraping engine
- pyttsx3: python based offline speech-to-text
- SpeechRecognition: speech recongition library with apis from google, ibm, pocketsphinx
- pico2wave: text-to-speech based on android system (this is smoother than pyttsx3 which is based on espeak)
- picamera: Python interface to the Raspberry Pi camera modules
- google-cloud-vision
- espeak: speech synthesizer
sudo apt-get update
sudo apt-get updgrade
sudo apt-get python3-pip3
sudo apt-get python-pip
pip3 install picamera
This library is not used anymore. Google DialogFlow works more efficiently for chatterbot
pip3 install Chatterbot==1.0.2
Documentation: https://chatterbot.readthedocs.io/en/stable/
sudo pip install dialogflow
Documentation: https://cloud.google.com/dialogflow/es/docs
Python Reference: https://cloud.google.com/dialogflow/es/docs/reference/libraries/python
sudo pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
sudo pip3 install --upgrade oauth2client google-auth
pip3 install google-cloud-vision
pip3 install beautifulsoup4
Documentation: http://www.crummy.com/software/BeautifulSoup/bs4/doc/
pip3 install pyttsx3==2.7
Documentation: https://pyttsx3.readthedocs.io/en/latest/
pip3 install SpeechRecognition
Documentation: https://pypi.org/project/SpeechRecognition/
Reference: https://realpython.com/python-speech-recognition/
sudo apt-get install python-pyaudio python3-pyaudio
or
sudo pip install pyaudio
sudo apt-get install espeak
cd /
sudo wget http://incrediblepbx.com/picotts-raspi.tar.gz
tar zxvf picotts-raspi.tar.gz
sudo rm -f picotts-raspi.tar.gz
sudo -i
cd /root
echo "Installing Pico TTS..."
./picotts-install.sh
exit
Credit: http://nerdvittles.com/?p=16463
Note: if the file does not exist, download file from my google drive shareable link: https://drive.google.com/open?id=1sS_KsSReNerkX0pRMtqTlFPPwjLm8-mZ and use filezilla, WinSCP(Windows Machine) or scp command to move the picotts-raspi.tar.gz to the root directory of your pi.
sudo apt-get install asterisk
cd /etc/asterisk
cp extensions.conf extensions_customs.conf
chown asterisk:asterisk extensions_custom.conf # changes ownership user_group=asterisk and user=asterisk
- set up a new cloud progect google project
- create credentials and set role to admin
- create and download key of created credential in json format. checkout this guide copy the download folder to a specified folder of raspberry pi (in this case it was stored in a '.keys/' folder)
sudo nano /etc/profile
copy the next line of command into the last line of /etc/profile file
export GOOGLE_APPLICATION_CREDENTIALS="[PATH]"
verify if the environment variable has been added successfully
printenv
Here is a guide on getting started with authentication
Official Documentation: http://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/
- disabled/black default audio card
> echo 'blacklist snd_bcm2835' > /etc/modprobe.d/raspi-blacklist.conf
- Open /lib/modprobe.d/aliases.conf and comment out the line options snd-usb-audio index=-2
- modify the alsamixer settings before saving
> alsamixer
- store the modifications to a file
> alsactl --file asound.state store
- command to load alsa state
> alsactl --file asound.state restore
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
...
This is likely occurs from incorrect configuration when setting up ALSA
- confirm the proper card number, device number and subdevice number using the command:
> aplay -l
**** List of CAPTURE Hardware Devices **** card 0: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0
- edit the file ~/.asoundrc with proper device numbers
into:
> sudo nano ~/.asoundrc
pcm.!default { type plug slave { pcm "hw:0,0" } } ctl.!default { type hw card 0 }
- also, edit the file /usr/share/alsa/alsa.conf
search and replace the following lines with proper numbers
sudo nano /usr/share/alsa/alsa.conf
... defaults.ctl.card 0 defaults.pcm.card 0 ...
upon trying to import the dialogflow library it might display an INVALID ARGUMENT error This github discussion helped alot I tried building grpcio<\i> library from source but it keeps failing (my raspberry pi disconnects entirely from wi-fi) I had to install a pervious version of grpcio<\i> for it to work. Here the are fixes:
sudo pip uninstall grpc grpcio
rm -rf ~/.cache/pip/*
sudo pip3 install grpcio==1.29.0