Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Most AV kit ships set to DHCP, and on a bench or a fresh site there's usually no

## Features

**Phase 1 (in progress)**
**Phase 1**

- **Pick your Ethernet adapter** from a list showing link state, speed and current IP. The app remembers your last choice.
- **Safe adapter changes.** Your adapter's settings are backed up before anything changes and restored on Stop, on exit, at Windows shutdown, and after a crash (offered the next time you open the app).
Expand All @@ -26,7 +26,21 @@ Most AV kit ships set to DHCP, and on a bench or a fresh site there's usually no
- **Wi-Fi and VPN overlap warnings**, with a one-click option to turn Wi-Fi off until you press Stop.
- **Dark and light themes**, with large status text you can read from arm's length.

**Default settings:** server IP `192.168.100.1/24`, addresses `192.168.100.100` to `192.168.100.199`, 60-minute leases. All of these can be changed in **Settings**.
**Phase 2 (in progress)**

- **Live ping graph for every device.** Each device with a lease is pinged once a second. The device list shows a small latency graph with the latest reply time, and the selected device shows the last two minutes with average, min, max and loss. Missed replies show as red marks. When a device stops answering, or starts again, the session log records it.
- **Session log you can filter and export.** Filter by level (everything, warnings and problems, problems only), by area (adapter, server, DHCP, device) or by text such as an IP or MAC address. **Export log…** saves what's shown as a text file for a job report, or as CSV for Excel.
- **Profiles.** Save the subnet, pool, lease time and DHCP options for each job or kind of gear, and pick one from the top bar before pressing Start. Options: gateway (3), DNS (6), domain name (15), NTP (42), vendor-specific (43, hex), TFTP/provisioning server (66), Cisco TFTP servers (150) and any other option as text, IP addresses or hex. Profiles can be duplicated, deleted, exported to a file and imported on another laptop.
- **Presets** built from each manufacturer's own documentation, with links to the pages they come from:
- Default (192.168.100.x), for the gear that asks for DHCP out of the box: Q-SYS, Biamp, Shure, Sennheiser, Dante, Symetrix, Crestron, AMX, Kramer, Atlona and Extron NAV.
- 192.168.254.x for Extron switchers (192.168.254.254) and IPCP Pro (192.168.254.250).
- 192.168.0.x for Lightware, Christie GS, Sharp/NEC MultiSync M and Bose ESP/PowerMatch/CC-64.
- 192.168.1.x for the Kramer and Atlona fallback addresses, ClickShare direct connection and AMX NX static.
- Cisco IP phones (option 150), Poly phones (option 66), and a bench test with 2-minute leases.

Each preset's pool leaves the documented factory addresses free. Presets can't be changed: duplicate one to make your own.

**Default profile:** server IP `192.168.100.1/24`, addresses `192.168.100.100` to `192.168.100.199`, 60-minute leases. Make your own profile under **Profiles** (the gear button) to change any of these.

## Download and run

Expand All @@ -51,8 +65,8 @@ Most AV kit ships set to DHCP, and on a bench or a fresh site there's usually no
| Red banner: another DHCP server is on the link | You're plugged into a network that already hands out addresses (office, venue, home router). Unplug from it, or only use **Serve anyway** on a network you own. |
| Step 2 red, "No link" | No cable, a dead port, or the device is off. Steps 2 to 4 recover by themselves when the link comes up. |
| Step 5 amber, no DHCP requests after 30 seconds | The device probably has a static IP or DHCP turned off. |
| The device gets an offer but never accepts it | Some embedded network stacks ignore their own broadcast flag. Tick **Always broadcast replies** in Settings and try again. |
| Step 1 amber, mentions Wi-Fi or VPN | Another adapter is on the same subnet. Use **Turn it off until Stop**, or change the server IP in Settings. |
| The device gets an offer but never accepts it | Some embedded network stacks ignore their own broadcast flag. Tick **Always broadcast replies** in your profile and try again. |
| Step 1 amber, mentions Wi-Fi or VPN | Another adapter is on the same subnet. Use **Turn it off until Stop**, or use a profile with a different server IP. |
| The app was killed mid-session | Open it again and click **Restore now** on the banner. The backup lives in `C:\ProgramData\ProDHCPServer\adapter-backup.json` until it's restored. |

If something goes wrong, [open an issue](https://github.com/cookingwithsimon/ProDHCPServer/issues/new/choose) using the **Problem on site** form, and include the session log text if you have it.
Expand All @@ -61,15 +75,16 @@ If something goes wrong, [open an issue](https://github.com/cookingwithsimon/Pro

Each phase ends with a hardware test pass on real AV equipment before the next one starts.

- **Phase 1: core loop** (in progress). Everything listed under Features.
- **Phase 2: visibility.** Continuous ping with a latency graph per device, a full session log you can filter and export (TXT/CSV), and saved profiles for subnet, pool, lease time and DHCP options (router, DNS, NTP, option 43/66/150 and custom options).
- **Phase 1: core loop** (done, hardware-tested October 2026).
- **Phase 2: visibility** (in progress). Continuous ping with a latency graph per device, a full session log you can filter and export (TXT/CSV), and saved profiles for subnet, pool, lease time and DHCP options (router, DNS, NTP, option 43/66/150 and custom options).
- **Phase 3: discovery.** Find devices that already have a static IP, move your adapter onto their subnet in one click, and discover devices via mDNS (including Dante), SSDP/UPnP and LLDP/CDP.

## Files it writes

| What | Where |
|---|---|
| Your settings | `%LOCALAPPDATA%\ProDHCPServer\settings.json` |
| Your settings (last adapter, profile in use, theme) | `%LOCALAPPDATA%\ProDHCPServer\settings.json` |
| Your profiles | `%LOCALAPPDATA%\ProDHCPServer\profiles.json` |
| Adapter backup (only while a session runs, or after a crash) | `%ProgramData%\ProDHCPServer\adapter-backup.json` |

While serving, the app also adds a Windows Firewall rule so it can receive DHCP traffic (UDP 67 and 68, for this exe only), and removes the rule on Stop.
Expand Down
38 changes: 38 additions & 0 deletions docs/hardware-test-phase2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Phase 2 hardware test

About 20 minutes. You need: the unmanaged laptop, two AV devices on a small unmanaged switch (the NAV E and Desk Pro are ideal), and a USB stick or a second laptop for the profile import step if you have one.

Download `ProDHCPServer.exe` from the latest successful **Build and test** run on the Phase 2 pull request (Actions tab → run → Artifacts → `ProDHCPServer-win-x64`). Click **More info → Run anyway** on the SmartScreen warning.

Tick each box. If something fails, use **Export log…** (section 2) and send me the file.

## 1. Ping graph
- [ ] Both devices on the switch. Press **Start**. Once each has a lease, its row under **All devices** shows a small graph and a reply time like "1 ms" within a few seconds.
- [ ] The device shown at the top has a **Ping** line ("Last minute: … avg (… to …), 0% loss") and a wider graph under its details.
- [ ] Unplug one device's cable for about 10 s, then plug it back in. Its graph shows red marks for the missed pings, its reply time turns red ("No reply"), and the session log has two lines: "… stopped answering ping at …" and "… is answering ping again after … without replies".
- [ ] The other device's graph stays steady the whole time.
- [ ] Click the other device in the list: the top panel, ping line and big graph switch to it.
- [ ] Press **Stop**: the graphs and rows go away.

## 2. Session log filter and export
- [ ] Open the **Session log**. Set the first box to **Problems only**: only red lines are left, and the count says "N of M entries match".
- [ ] Set it back to **Everything**, pick **DHCP** in the second box: only DHCP lines are left.
- [ ] Type the NAV's IP (or part of its MAC) in the search box: only lines mentioning it are left. **Show everything** clears all three.
- [ ] **Export log…** as **Text**. Open the file in Notepad: it starts with the app version, laptop name, adapter (with driver), profile and start time, then one line per entry with the full date and time.
- [ ] **Export log…** as **CSV**. Open it in Excel: columns Time, Severity, Category, Message, Detail, one row per entry, nothing garbled.

## 3. Profiles
- [ ] The top bar has a **Profile** box showing "Default (preset)". Open it: seven presets are listed.
- [ ] Pick **192.168.254.x: Extron**. The status line says Start will set 192.168.254.1/24. Press **Start**: the devices get 192.168.254.100 and up. Press **Stop**.
- [ ] Press the gear button. The panel is titled **Profiles**, shows the preset's note and links to the Extron guides it comes from (click one: it opens in your browser), and its fields are greyed out with "This is a preset… Press Duplicate".
- [ ] Press **Duplicate**: "192.168.254.x: Extron copy" is created and selected, and the fields can now be changed. Rename it (for example "Bench rack") and set the pool to .150 to .160. Press **Save profile**.
- [ ] Type a bad value (pool end 192.168.1.5) and click into another field: a red box explains the problem. **Discard changes** puts the saved values back.
- [ ] Open **More DHCP options** and set NTP to 192.168.254.1. **Add an option** with code 66 and click into another field: a red box says option 66 has its own field. Change the code to 160, type Text, value `http://192.168.254.1/`. Save.
- [ ] Start with this profile. In the log, select the ACK line for a device: the detail shows options 42 and 160 were sent. Stop.
- [ ] **Export…** the profile to the desktop. **Delete** it: the confirmation names the profile. It's gone and Default is selected.
- [ ] **Import…** the file you exported: the profile is back with the same settings. (If you have a second laptop, import it there too.)
- [ ] Close and reopen the app: your profile is still there and still selected.
- [ ] While the server is running, the top-bar profile box and the panel's fields are greyed out, and the panel says to stop the server to change profiles. The theme can still be changed.

## 4. Phase 1 still works
- [ ] Quick repeat of the Phase 1 main case: one device straight on the cable, Start, lease, ping and WebUI green, **Open WebUI**, Stop, adapter back to its original settings.
8 changes: 6 additions & 2 deletions src/ProDHCPServer.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using ProDHCPServer.App.ViewModels;
using ProDHCPServer.Core;
using ProDHCPServer.Core.Adapters;
using ProDHCPServer.Core.Profiles;
using ProDHCPServer.Windows;

namespace ProDHCPServer.App;
Expand All @@ -24,7 +25,8 @@ public partial class App : Application
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var settingsStore = new SettingsStore(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ProDHCPServer", "settings.json"));
var userFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ProDHCPServer");
var settingsStore = new SettingsStore(Path.Combine(userFolder, "settings.json"));
Theme.Apply(settingsStore.Load().Theme);

if (!Elevation.IsAdministrator())
Expand Down Expand Up @@ -63,11 +65,13 @@ protected override void OnStartup(StartupEventArgs e)
};
SessionEnding += (_, _) => _controller.EmergencyRestore();

var vm = new MainViewModel(adapters, sessions, _controller, _log, settingsStore, Dispatcher);
var profiles = new ProfileLibrary(Path.Combine(userFolder, "profiles.json"));
var vm = new MainViewModel(adapters, sessions, _controller, _log, settingsStore, profiles, Dispatcher);
_controller.DhcpEvent += vm.OnDhcpEvent;
// Used by tools/smoke-test.ps1 to screenshot the settings slide-over.
if (e.Args.Contains("--open-settings")) vm.SettingsOpen = true;
var window = new MainWindow { DataContext = vm };
vm.Settings.AttachDialogs(new WindowDialogs(window));
window.Closed += (_, _) => Shutdown();
MainWindow = window;
window.Show();
Expand Down
Loading
Loading