Sitrep 2:
I now have the Bells code working correctly (without any external control yet) and basic communication is set up between the two Pis. A full installation Specification will be produced in due course, but the following defines what needs to be done after a clean SD Card has been imaged and booted.
NOTES:
- Each Pi must be configured individually. I initially created a 'Base' SD Card Image in a similar way to the River System images. Unfortunately, this will result in the Volume Control (alsamixer / amixer) failing because the Adafruit Tutorial for the Stereo Bonnet (https://learn.adafruit.com/adafruit-spe ... y-pi-usage) requires that the Pi is rebooted twice after the setup script has been run. Using a pre-configured image seems to fall foul of this.
- Currently the hardware configuration is as defined at viewtopic.php?p=4514#p4514. This uses a USB / Ethernet Adaptor, but it has been pointed out to me by someone on the Raspberry Pi Forums that a fully functional network can be configured on a Pi using only a male to male USB cable between the Type A connector on the Pi 3 and the microUSB connector on the Zero. This will need a cable which I currently do not have, but they are cheap so I will probably do this in due course because that would release a £15 Adaptor for other Projects.
- It is not necessary to install RPi.GPIO on the Music Pi, but it will do no harm.
The following is a highly cut-down set of commands to run:
Code: Select all
pi@minster-bells:~ $ curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash
REBOOT TWICE!
pi@minster-bells:~ $ sudo apt install python3-pip
pi@minster-bells:~ $ pip3 install RPI.GPIO
pi@minster-bells:~ $ pip3 install apscheduler
pi@minster-bells:~ $ pip3 install datetime
pi@minster-bells:~ $ pip3 install psutil
pi@minster-bells:~ $ sudo apt install mpg321
After these commands have completed, set up networking by editing /etc/dhcdcd.conf and setting up a static IP address of 192.168.10.1 for the Music Pi and 192.168.10.2 for the Bells Pi. On the Bells Pi add a static router line pointing to the Music Pi at 192.168.10.1.
Finally create a route through the Music Pi to the WMT Network:
Code: Select all
sudo nano /etc/sysctl.d/routed-ap.conf
This will open a new file. Add:
Code: Select all
# Enable IPv4 routing
net.ipv4.ip_forward=1
In the console issue:
Code: Select all
pi@minster-music:~ $ sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
pi@minster-music:~ $ sudo iptables -t nat -L -v -n
This should return:
Code: Select all
Chain PREROUTING (policy ACCEPT 12 packets, 3312 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 11 packets, 2984 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 2 packets, 282 bytes)
pkts bytes target prot opt in out source destination
8 729 MASQUERADE all -- * wlan0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 10 packets, 1011 bytes)
pkts bytes target prot opt in out source destination
If all is well, send:
to make the new route persistent. Reboot both Pis.
It should now be possible to ping Google's DNS Server (8.8.8.8).