2017-Dec-21, Thursday

Gizmo can speak (albeit with a new accent), and Gizmo can move, now we have to tie the two together so they only move when they speak. And it's all software.

Again, we're following an adapted version of Furlexa project.

First we need a python script, a more structured version of the motor/motor.py from Part 3. Separate the parts into setup(), start_furby(), and stop_furby(), and add a main(). We'll also need the sound device status file path from Part 2, /proc/asound/card0/pcm0p/sub0/status.

furby.py )

This script only sets the motors in motion (or stops them) based on the current state of the status file when invoked, and exits. It doesn't keep running while the motors do.

In order to keep track of the changes of the status file a monitor script is needed. (And because we made the changes to PulseAudio in Part 2 the status will actually change.)
output-monitor.sh )

Make the script executable with chmod +x output-monitor.sh, and run with ./output-monitor.sh. Then make some sounds in another ssh session. There you go, singing, dancing, Gizmo!


But hey, wouldn't it be nice to make this Gizmo's default behaviour without having to invoke it every time? Let's get it to run at startup. We're going to set it up with systemd as described here.

systemd )

Reboot to pickup changes. And finally, Furby/Gizmo is all singing, all dancing.

(Small caveat; Furby/Gizmo will do a little shimmy with every pop/click out of the speaker.)

You can install Alexa if you want, I won't be. I do have other plans to extend the project a bit but this is the bulk of the project, and plenty to freak your friends out. Bonus, you don't even have to close up and re-skin Furby/Gizmo. Don't believe me? Have a look for yourself.


Part 1 | Part 2 | Part 3 | Part 4 | Part 5