Trying a few things out on my Pi from various blogs.
NB: this is a stream-of-consciousness experimentation post. I will re-post the most exciting part (text-to-speech) in another part, all cleaned up!
RPi Blog – Optimizing for a headless install
Now, I do use the desktop environment, so not doing the first bit.
But, I like the idea of speeding the terminal login up. So:
Result: Yeah, it speeds it up by a couple of seconds.
Fusion Strike – Free up RAM
change the 0 to 3 and save
You should see a drop in memory usage.
Result: I did! 3 MB more free
What is my IP address and can you email it to me?
I just followed the instructions from the wiki
It works. Yay.
What is my IP address, and can you tell it to me?
This is to get the Pi to find it’s own IP address and tell you vocally over the 3.5mm audio jack.
First of all, you need to install Festival, which is the text-to-speech converter.
- apt-get install festival
Takes a while, it’s about 20MB.
Plug your earphones/speakers into the 3.5mm jack
Right, apparently this should work:
- echo “Hello” | festival –tts
But it doesn’t.
So, moving onto…
- apt-get install alsa-utils
Well, apparently that’s already installed.
- modprobe snd_bcm2835
- amixer cset numid=3 1
- This last command should turn the analogue output (i.e. the 3.5mm jack) on.
- cd /opt/vc/src/hello_pi
- cd hello_audio
- You should hear something like a siren run through a bad 50s sci-fi tv show.
- Get mplayer:
- apt-get install mplayer
- mplayer doesn’t appear to be able to play the test file I downloaded.
- Let’s try using aplay… There are some samples in a directory from a package called ‘alsa’, so let’s use one of those.
- aplay /usr/share/sounds/alsa/Front_Center.wav
- Yes! Works. Dull, but it works.
Let’s try a different audio package called ‘sox’.
- sudo apt-get install sox
- sox /usr/share/sounds/alsa/Front_Center.wav -t alsa default
- Edit /etc/modules
- Make sure that snd_bcm2835 is in the file.
- Once it is (it might be already) you do not need to do the modprobe again after each reboot.
- Okay, let’s try mplayer again
- mplayer /usr/share/sounds/alsa/Front_Center.wav
- Nope, nothing. Get an error about not being able to open socket…
- Moving on to https://bbs.archlinux.org/viewtopic.php?id=40013
- Edit /etc/mplayer/mplayer.conf
- Add nolirc=yes
- And run that mplayer command again.
- Yes! Works!
- Try Festival again
- echo “Hello” | festival –tts &
- YES! It spoke to me!!! Woo-hoo!!!
- You can also use ax206geek’s script to use Google’s text to speech engine. Create a file called speech.sh:
- As root…
- cd ~/
- mkdir bin
- cd bin
- NB This script works for Google email accounts. Change the smtp server for other email hosts.
- create/edit a file called ’email_ip_address.py’
- Save & quit
- chmod a+x email_ip_address.py
- Now create/edit another file: say_my_ip_address.sh
- Save and quit.
- (All those fullstops and commas space out the words so it sounds like an IP address!)
- chmod a+x say_my_ip_address.sh
- Now we put them in to our start-up routine.
- Edit /etc/rc.local
- Add the following lines:
- And reboot
- Don’t forget to have your earphones plugged in!