Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Avahi #170

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Enable Avahi #170

wants to merge 7 commits into from

Conversation

adamoutler
Copy link
Contributor

Summary

This PR introduces support for Avahi ZeroConf. With this implementation, the PiKVM will show up in Nautilus/Dolphin under Network or in Finder on Mac.

Details

The implementation allows for auto-discovery and unique identification of the PiKVM without relying on dynamic information such as MAC address, IP address, or HTTPS certificate. This feature is particularly useful for adding devices to Home Assistant.

ZeroConf Data

The ZeroConf data broadcasts the following _pikvm._tcp registration:

Screenshot_20240608-142322

The same data is also replicated with the _https._tcp registration.

Benefits

  • Auto-discovery: Simplifies the process of finding PiKVM devices on the network.
  • Unique Identification: Each PiKVM is uniquely identifiable without relying on changing network information.
  • Home Assistant Integration: Facilitates the addition of PiKVM devices to Home Assistant, enhancing smart home automation capabilities.

Script Flow

  1. Retrieve Serial and Model Numbers: The script reads the serial number from /proc/device-tree/serial-number and the model number from /proc/device-tree/model.

  2. Generate Avahi Configuration: The script defines the new Avahi service configuration, including HTTP and HTTPS services with associated TXT records for serial and model numbers.

  3. Compute Configuration Hashes: The script computes the MD5 hash of the current and new configurations to determine if updates are necessary.

  4. Update Avahi Service File: If the configuration has changed, the script writes the new configuration to the Avahi service file.

  5. Install and Start Avahi: The script checks if Avahi is installed, installs it if necessary, and ensures the Avahi daemon is enabled and started, if not disabled by the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant