A fake IVR for Raspberry Pi, built for Camille Henrot's interactive sculptures.
- Registers input from circuits with Pigpio package
- Manages the flow of our fake IVR
- Allows for easy updates (audio and video files) from our custom FTP server
- Saves states with Redis as necessary
- Provides an HTML-based testing console for trying out interactions without touching any wiring
Each sculpture requires this core library in its root directory. Other than that, two components are needed:
- Python module
- config file (
config.json
) - (optional) test pad module
Please have a look at any of the "sculpture packages" for an example of how to use the core library.
Config files should be called config.json
and be placed in the root directory. Here's an example config file:
{
"rpi_id" : "echo_priest",
"api_port" : 8080,
"num_processes" : 3,
"redis_port" : 6379,
"media_manifest" : [
"video",
"confessions",
"absolutions"
],
"cdn" : {
"addr" : "127.0.0.1",
"port" : 8082,
"user" : "anonymous",
"home_dir" : "EchoPriest"
},
"custom_test_pad" : "echo_priest",
"gpio_mappings" : {
"receiver" : {
"type" : "IRReceiverThread"
},
"buttons" : {
"type" : "ButtonThread",
"pins" : [6, 13, 19, 26]
}
}
}
The rpi_id
directive is a short code for the Raspberry Pi running the sculpture. Alphanumeric, no spaces or special characters.
The api_port
directive corresponds to the ports python is listening on. The redis_port
directive should be self-explainatory. These should NOT be set to 8888, because the GPIO requires that port to be free.
The media_manifest
directive is an array referring to the folders that will hold media. All of these folders will be created on setup, regardless of whether they contain media. During setup, any files destined for those folders will be pulled down from the FTP server.
The cdn_directive
is an object that describes how to connect to the FTP server. The home_dir
directive here is the root folder containing the sculpture's files. So far, only anonymous connections are supported.
The custom_test_pad
directive points to the folder where you have your custom test pad. See the original one for an example of how it's written.
The gpio_mappings
directive corresponds to the type of receiver and buttons used in the sculpture. type
must correspond to one of the 4 component classes we work with (IR, hall effect, matrix keypad, or simple button). The IRReceiver does not require a pin, but the others do.
An FTP server exists to push the necessary files to the sculptures (which are, of course, too large to be hosted here). Conventionally, each sculpture should have a prompts
folder (full of mp3s for the IVR to "say"). If the sculpture includes video, a video
folder is required. Video is in HTML5, so all assets must be web-compatible. Assets in this folder will be placed in media/video/viz
on the sculpture (as the media/video
folder will hold html and javascript files).
Hey guess what? There's also an HTML-based testing console for trying interactions without having to rig up any buttons on the Raspberry Pi. Start up the engine, and open a browser to localhost:8080 (or whatever port the api is set to). You will see a keypad (modeled after a telephone, naturally) that you can use.
You can create your own test pad for additional configurations as well. Be sure to add the folder's name as custom_test_pad
in your config file.
With a clean RPi, check out these notes to configure everything on the hardware. Then you're ready to install this software.
After cloning, run git submodule update --init --recursive
. Then create your config file. From the root directory run python core/setup.py
. Make sure your soundcard works. Then reboot with sudo reboot
. From then on, redis and pigpio will start automatically.
If the module contains video, and the Pi does not boot to GUI automatically (because you're a pro) use screen to start the display with startx
.
- Run:
python [module_name].py --start
- Stop:
python [module_name].py --stop
- Restart
python [module_name].py --restart