Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Latest commit

 

History

History
45 lines (39 loc) · 1.21 KB

README.md

File metadata and controls

45 lines (39 loc) · 1.21 KB

IP discovery for Headless Raspberry Pis

Subscriber (Desktop)

  1. Find the MAC address of your Raspberry Pi for the wlan0 interface.
  2. 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
  1. Install dependencies
pip install -r requirements.txt
  1. 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]

Publisher (Raspberry Pi)

  1. Install docker
  2. Place these 2 files in a folder on the Pi, e.g.
pi@raspberrypi:~ $ ls publish_ip/ -a
.  ..  docker-compose.yml  .env
  1. Edit .env accordingly to select the interface (e.g. wlan0 or eth0)
  2. 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
  1. 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