Moshi Moshi (aka wife alert)

I have a hard time getting in touch with my wife. Usually when I call, the phone is in the other room or switched on vibrate and she hardly ever picks up. I decided to try a little more earnestly to get her attention (this may end up being really good, or really bad). I set out making what I call Moshi Moshi (Japanese for ‘hello’ on the telephone). Now, whenever I call her, our house is filled with a warm embrace of music. She also gets an email letting her know I’m trying to reach her. We’ll see how it works out…

I used Asterisk, Ruby, Sinatra, and an Arduino Due with an ethernet shield to make Moshi Moshi. When I call Kiori a Ruby script makes a post request to a Sinatra app that logs the call in a yaml file, and sends an email to her letting her know I’m calling. Every 10 seconds the Arduino is polling a web page served from the Sinatra app, which pulls data from the yaml file. If a new call comes in, a music file I created is played in our apartment from the Due (which can play audio files). There is a button on the hardware interface she can press to mute it.

moshi moshi (wife alert)
more photos

One of the challenging parts was actually getting the audio file to play more than once on the Due (seems like it should be simple right?). I discovered if I set the pre buffering to 0 (the examples set it to 100) then it worked fine: Audio.begin(88200, 0);

Code:
Continue reading