Le perroquet
29/10/2019
A foul-mouthed parrot, based on a rapsberry pi.
Make the parrot talk via your browser, using a raspberry pi.
Bill of materials:
- Some plywood for the parrot structure
- Raspberry-pi + alim
- Adafruit I2S 3W Class D Amplifier Breakout
- A tiny speaker
- A push button
- Some wires
Steps:
- Install Raspbian Lite on the raspberry
- Allow ssh for remote access
- Set up an apache webserver on the raspberry: Instructions on the raspberry pi foundation
- Install PHP: Instructions on the raspberry pi foundation
- Launch web server at startup
- Wire the speaker and set the amplifier up: Instructions
- Install mpg123: Instructions
- Record parrot talks
- Create a nice web page with buttons to execute commands via shell and play sounds
<?php
if (isset($_POST['cul']))
{
shell_exec('mpg123 /var/www/cul.mp3');
}
?>
<form method="post">
<p><button class="button1" name="cul">Tu pues du cul</button></p>
</form>
- Manage Sounds group permission to allow user www-data
- Add a power button to the device: Instructions
You can only use the webpage to communicate with the parrot if you are on the same network as the pi and you need to find its IP address. That may be for the best.