{"id":19652133,"url":"https://github.com/markparker5/rpi-networking","last_synced_at":"2026-04-14T04:02:29.108Z","repository":{"id":182581307,"uuid":"668680831","full_name":"MarkParker5/rpi-networking","owner":"MarkParker5","description":"Control wifi, hotspot and hostname of Raspberry Pi","archived":false,"fork":false,"pushed_at":"2023-11-21T18:26:53.000Z","size":35,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-02T13:42:08.730Z","etag":null,"topics":["debian","linux","python","python3","raspberry-pi","raspberry-pi-zero-w","raspberrypi","raspbian","rpi","rpi-zero-w","rpi4"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/rpi-networking","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/MarkParker5.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":"2023-07-20T11:07:29.000Z","updated_at":"2023-07-22T18:22:53.000Z","dependencies_parsed_at":"2024-11-11T15:09:27.608Z","dependency_job_id":"11821e1e-dede-46ec-abe7-1a88b7737008","html_url":"https://github.com/MarkParker5/rpi-networking","commit_stats":null,"previous_names":["markparker5/rpi-networking"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/MarkParker5/rpi-networking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkParker5%2Frpi-networking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkParker5%2Frpi-networking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkParker5%2Frpi-networking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkParker5%2Frpi-networking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarkParker5","download_url":"https://codeload.github.com/MarkParker5/rpi-networking/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkParker5%2Frpi-networking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31781292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"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":["debian","linux","python","python3","raspberry-pi","raspberry-pi-zero-w","raspberrypi","raspbian","rpi","rpi-zero-w","rpi4"],"created_at":"2024-11-11T15:09:24.689Z","updated_at":"2026-04-14T04:02:29.092Z","avatar_url":"https://github.com/MarkParker5.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpi-networking\nControl wifi, hotspot and hostname of Raspberry Pi\n\n## Requirments \n\nPython3.10+\n\n## Installation\n\n### Using pip:\n\n```sh\npip3 install rpi-networking \n```\n\n### Using poetry\n\n```sh\npoetry add rpi-networking\n```\n\n## Prepare system\n\n### Automatically \n\nVia curl\n\n```sh\nsh -c \"$(curl -fsSL https://raw.githubusercontent.com/MarkParker5/rpi-networking/master/setup.sh)\"\n```\n\nOr via wget\n\n```sh\nsh -c \"$(wget https://raw.githubusercontent.com/MarkParker5/rpi-networking/master/setup.sh -O -)\"\n```\n\n### Manually\n\n#### Dependencies\n\n```sh\nsudo apt update ; \\\nsudo apt upgrade -y ; \\\nsudo apt install dnsmasq hostapd dhcpd -y\n```\n\n#### Give permissions to edit configuration files (optional)\n\nGive user permission to edit configuration files so python doesn't have to be run as root (sudo)\n\n```sh\nfiles=(\n  \"/etc/dnsmasq.conf\"\n  \"/etc/hosts\"\n  \"/etc/default/hostapd\"\n  \"/etc/hostapd/hostapd.conf\"\n  \"/etc/network/interfaces\"\n  \"/etc/network/interfaces.d\"\n  \"/etc/wpa_supplicant/wpa_supplicant.conf\"\n)\n\nfor file in \"${files[@]}\"; do\n  sudo chown \"$USER\" \"$file\"\n  sudo chmod 644 \"$file\"\ndone;\n```\n\n## Docs\n\n### Configuration\n\nThere are functions for initial configuration setup.\n\n```python\n# rpi_networking.configuraion\n\ndef write_interfaces():\n\ndef write_default_hostapd():\n\ndef write_hostapd_conf():\n\ndef write_dnsmasq_conf():\n\ndef write_wpa_supplicant(country: str = \"GB\"):\n\ndef write_hosts():\n\ndef write_all(): # calls all functions above\n```\n\n**In most cases you only need to call `write_all()` once to setup all configuration files.**\n\n### Hostname\n\n```python\n# rpi_networking.hostname\n\ndef set_hostname(hostname: str):\n    \ndef restart_interfaces():  # apply new hostname without reboot\n```\n\n### Hotspot\n\n```python\n# rpi_networking.hotspot\n\ndef is_hotspot_up() -\u003e bool:\n\ndef start_hotspot() -\u003e bool:\n    \ndef stop_hotspot() -\u003e bool:\n```\n\nThe `bool` return value is `True` if function finished without errors (exit code 0), else `False`\n\n### Status\n\n```python\n# rpi_networking.status\n\ndef is_wlan_connected() -\u003e bool:\n\ndef is_eth_connected() -\u003e bool:\n\ndef is_wlan_global_connected() -\u003e bool: # 'global' means internet access\n\ndef is_eth_global_connected() -\u003e bool:\n\ndef is_wps_running() -\u003e bool:\n```\n\n### WiFi\n\n```python\n# rpi_networking.wifi\n\ncountry: str = 'GB' # country code for wpa_supplicant\n\nclass InterfaceBusyException(Exception): \n    pass\n\nclass Cell:\n    ssid: str\n    quality: float\n    frequency: str\n    encrypted: bool\n\nclass Network:\n    ssid: str\n    psk: str\n    id_str: str\n\n# Functions\n\ndef read_networks() -\u003e list[Network]:\n\ndef write_networks(networks: list[Network]):\n\ndef add_network(ssid: str, psk: str):\n\ndef reconnect() -\u003e bool: # connect to the best available network\n\ndef scan() -\u003e Generator[Cell, None, None]:\n\ndef start_wps() -\u003e bool:\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkparker5%2Frpi-networking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkparker5%2Frpi-networking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkparker5%2Frpi-networking/lists"}