{"id":15912328,"url":"https://github.com/drgfreeman/pi-ip-broadcast","last_synced_at":"2026-04-30T15:33:05.699Z","repository":{"id":130571584,"uuid":"242594605","full_name":"DrGFreeman/pi-ip-broadcast","owner":"DrGFreeman","description":"Identify headless Raspberry Pi computers on a local network","archived":false,"fork":false,"pushed_at":"2020-02-24T05:14:19.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T02:32:11.072Z","etag":null,"topics":["ip","ip-address","network","raspberry-pi","raspberrypi","service"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrGFreeman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-23T21:36:38.000Z","updated_at":"2023-05-11T12:09:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e46f36b-e972-438f-bb11-301cc886a2db","html_url":"https://github.com/DrGFreeman/pi-ip-broadcast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DrGFreeman/pi-ip-broadcast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2Fpi-ip-broadcast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2Fpi-ip-broadcast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2Fpi-ip-broadcast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2Fpi-ip-broadcast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrGFreeman","download_url":"https://codeload.github.com/DrGFreeman/pi-ip-broadcast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrGFreeman%2Fpi-ip-broadcast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32469344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ip","ip-address","network","raspberry-pi","raspberrypi","service"],"created_at":"2024-10-06T16:04:03.055Z","updated_at":"2026-04-30T15:33:05.686Z","avatar_url":"https://github.com/DrGFreeman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pi-IP-Broadcast\n\nA set of tools to allow easy identification of one or more headless Raspberry Pi computers IP addresses on a local network.\n\nIdeal for a classroom situation where students can access their headless Raspberry Pi from their laptop via SSH over the local WiFi network.\n\n## How it works\n\nOne or more headless Raspberry Pi computers execute a program (`broadcast.py`) that broadcasts their IP address, hostname and information over the local network.\n\nOne or more computers excute a program (`listen.py`) that listen on the local network and prints the list of computers broadcasting their IP address and information.\n\n## Features\n\n* Headless Raspberry Pi setup performed entirely via SD card.\n* Broadcast service automatically launches at boot on the Raspberry Pi.\n* Multiple Raspberry Pi computers can broadcast simultaneously.\n* Multiple computers can listen simulteaneously.\n\n## Limitations\n\n* Only IPv4 addresses are supported.\n* The Raspberry Pi and listening computer must share the same class C sub-network (i.e. their IP addresses must share the same first three digit groups groups, e.g. 192.168.1.120 \u0026 192.168.1.204).\n\n\n# Setup\n\n## Headless Raspberry Pi\n\n### Wireless network and SSH\n\nBefore configuring the broadcast service, follow the instruction for a [headless Raspbery Pi setup](https://www.raspberrypi.org/documentation/configuration/wireless/headless.md) from the official Raspberry Pi documentation to configure the wireless network access and enable SSH. In the case where the Raspberry Pi is to be connected to an ethernet cable, skip the wireless network configuration but ensure to enable SSH.\n\n### Broadcasting Python script\n\nOnce the wireless network configuration is completed and SSH is enabled, open a terminal to root of the `rootfs` partition of the SD card to configure the broadcasting service. All paths in this section are relative to the root of the `rootfs` partition (usually mounted at `/media/user/rootfs` on most Linux system).\n\nDownload the broadcasting Python script in the `/home/pi/` folder (replace `pi` in `home/pi/` by the appropriate username if different than `pi`):\n\n```\n$ wget https://github.com/DrGFreeman/pi-ip-broadcast/raw/master/broadcast.py -O home/pi/broadcast.py\n```\n\nEdit the `info` string near the top of the `broadcast.py` file. This string will print next to the Raspberry Pi's IP address and hostname on the listening computer. It can be useful to distinguish one Raspberry Pi from another if multiple Raspberry Pis on the network have the same hostname.\n\n```python\n# Enter a unique computer description to help identify it among others.\ninfo = \"Computer description\"\n```\n\nAlso, if the Raspberry Pi is connected via its Ethernet port instead of WiFi, change the `interface` string near the top of the `broadcast.py` file from `\"wlan0\"` to `\"eth0\"`.\n\n```python\n# Network interface name.\n# - Use \"wlan0\" for a wifi connection\n# - Use \"eth0\" for a wired ethernet connection\ninterface = \"wlan0\"\n```\n\n### Broadcasting service\n\nSetup the broadcasting script to run as a background service that launches automatically when the Raspberry Pi boots. Note that these steps need to be performed on a Linux or Mac computer and will not work on Windows.\n\nDownload the service unit file (`ip_broadcast.service`):\n\n```\n$ sudo wget https://github.com/DrGFreeman/pi-ip-broadcast/raw/master/ip_broadcast.service -O etc/systemd/system/ip_broadcast.service\n```\n\nMake the service unit file executable:\n\n```\n$ sudo chmod a+x etc/systemd/system/ip_broadcast.service\n```\n\nCreate symbolic links to enable the service:\n\n```\n$ cd etc/systemd/system/multi-user.target.wants\n$ sudo ln -s ../ip_broadcast.service ./ip_broadcast.service\n```\n\nIf a different username than `pi` is used, edit the `etc/systemd/system/ip_broadcast.service` file and replace `pi` with the appropriate username in the `[Service]` section (two locations).\n\n```\n# ip_broadcast.service\n[Unit]\nDescription=IP address broadcast service\nAfter=network.target\n\n[Service]\nType=simple\nRestart=always\nRestartSec=1\nUser=pi\nExecStart=/usr/bin/python3 /home/pi/broadcast.py\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## Listening Computer\n\nThe listening computer can be any computer connected to the same local network at the Raspberry Pi.\n\nNotes:\n1. The instructions below are for a Linux computer where Python version 3 is accessed with the `python3` command. On a system where the `python` command launches Python 3, use the `python` command where the instructions indicate `python3`.\n1. If the `pip` module is not found, it may need to be installed with `sudo apt update \u0026\u0026 sudo apt install python3-pip`.\n\nInstall the *Flask* Python web server:\n\n```\n$ python3 -m pip install flask\n```\n\nDownload the listening Python script (`listen.py`):\n\n```\n$ wget https://github.com/DrGFreeman/pi-ip-broadcast/raw/master/listen.py\n```\n\n# Usage\n\n## Headless Raspberry Pi\n\nThe broadcasting script is configured to launch as a service when the Raspberry Pi boots. No action is therfore required.\n\n## Listening Computer\n\nLaunch the listening script:\n\n```\n$ python3 listen.py\n```\n\nWait for the Raspberry Pi(s) to broadcast their IP address. It can take up to one minute before an address is displayed.  The terminal will show all the IP addresses being broadcasted along with the respective hostnames and information strings.\n\n```\n===============================================================================\nBroadcasted IPs - Last update: 2020-02-23 23:08:04\n-------------------------------------------------------------------------------\n2020-02-23 23:07:54: 192.168.0.120, raspberrydam, New RPi4 Damien\n2020-02-23 23:08:04: 192.168.0.206, octopi, Octoprint server - Prusa i3 MK2S\n-------------------------------------------------------------------------------\n```\n\nIf no broadcast is received from a specific IP address within a 150 seconds interval, the IP address will be removed from the list at the next refresh.\n\n# Remote access to the Raspberry Pi\nOnce the IP address of a Raspberry Pi is known, this Raspberry Pi can be accessed remotely using different protocols. Refer to the [Remote Access](https://www.raspberrypi.org/documentation/remote-access/) section of the official Raspberry Pi documentation to learn more about the different ways of accessing a Raspberry Pi remotely.\n\n### SSH access\n\nSSH is the recommended method to securely access the Raspberry Pi command line from another computer. If accessing a Pi remotely from a Linux or Mac computer, simply use the `ssh` command:\n\n```\n$ ssh user@ipaddress\n```\n\nFor example, if the user is `pi` and the ip address is `192.168.0.120` the command would be:\n\n```\n$ ssh pi@192.168.0.120\n```\n\nTo access the Pi via SSH from a windows computer, see the [SSH using Windows](https://www.raspberrypi.org/documentation/remote-access/ssh/windows.md) page of the official Raspberry Pi documentation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrgfreeman%2Fpi-ip-broadcast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrgfreeman%2Fpi-ip-broadcast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrgfreeman%2Fpi-ip-broadcast/lists"}