This is a project to connect a Raspberry Pi 4 to the Waveshare WM8960
https://www.thingiverse.com/thing:6771005
Raspberry Pi 4, with headers - https://www.raspberrypi.com/products/raspberry-pi-4-model-b/
Raspberry Pi 4 Power Supply (USB-C) - https://www.canakit.com/official-raspberry-pi-4-power-supply-black.html
Waveshare WM8960 Hat - https://www.waveshare.com/wiki/WM8960_Audio_HAT
A GPIO Ribbon Cable - https://www.adafruit.com/product/1988
4x M3 x 16 mm machine screws
4x M3 x 12 mm machine screws
4x M2 x 4 mm self tapping machine screws, these came with the origianl Raspberry Pi case, the next version of the case I intend to replace this with machine screws
Optional - USB C Power Switch - https://www.canakit.com/raspberry-pi-4-on-off-power-switch.html
Install
sudo apt-get install rabbitmq-server
Start on boot
sudo systemctl enable rabbitmq-server
Start now sudo systemctl start rabbitmq-server
Install web-based management interface
sudo rabbitmq-plugins enable rabbitmq_management
Create a new administrator account
sudo rabbitmqctl add_user newadmin s0m3p4ssw0rd
sudo rabbitmqctl set_user_tags newadmin administrator
sudo rabbitmqctl set_permissions -p / newadmin ".*" ".*" ".*"
You can also visit the web if there are issues
Visit web interface
http://raspberrypi:15672/
yourUser/yourPass
sudo apt-get install netcat-openbsd
Follow steps on https://www.waveshare.com/wiki/WM8960_Audio_HAT
sudo raspi-config
Each intercom will need to have a mapping to other intercoms on the network. Use the hosts to accomplish this.
sudo nano /etc/hosts
enter the ip then a tab then the name
192.168.0.111 NameOfPiAtTheGivenIpAddress
sudo nano /etc/systemd/system/myscript.service
[Unit] Description=My Python Script After=network.target
[Service] ExecStart=/usr/bin/python3 your_script.py WorkingDirectory=/home/user/scriptFolderLocation StandardOutput=inherit StandardError=inherit Restart=always User=yourSudoUser
[Install] WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable myscript.service
sudo systemctl start myscript.service
sudo systemctl status myscript.service
journalctl -u your_service.service
This configuration ensures that your script runs in the specified directory, making it easier to manage file paths and other resources relative to the script's location.