- Find the MAC address of your Raspberry Pi for the wlan0 interface.
- Create a text file containing all the known mac addresses of your Raspberry Pis, containing 1 address per line:
Example: subscribe/macs.txt
AA:BB:CC:DD:EE
AA:BB:CC:DD:EF
- Install dependencies
pip install -r requirements.txt
- Start the subscriber listening for topics associated with the MAC addresses in macs.txt. If not specified, will listen for the wlan0 interface.
cd subscribe
python client.py macs.txt [--interface eth0]
- Install docker
- Place these 2 files in a folder on the Pi, e.g.
pi@raspberrypi:~ $ ls publish_ip/ -a
. .. docker-compose.yml .env
- Edit
.env
accordingly to select the interface (e.g. wlan0 or eth0) - Start the container. This should be done at least once to pull the container down before configuring to run on reboot.
cd publish_ip
docker-compose up
- Configure to run on reboot by adding the following example command to crontab
crontab -e
Command to add to the end of crontab:
@reboot /usr/bin/docker ps && cd $HOME/publish_ip && $HOME/.local/bin/docker-compose up