{"record":{"id":"bb8c791f0c971aa0","repo":"mgth/LittleBigMouse","slug":"enter-the-monitor-wi-fi-mac-address-before-using-wake-on-lan","errorCode":null,"errorMessage":"Enter the monitor Wi-Fi MAC address before using Wake-on-LAN.","messagePattern":"Enter the monitor Wi-Fi MAC address before using Wake-on-LAN\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/SamsungTizen/SamsungTizenService.cs","lineNumber":133,"sourceCode":"        {\n            await SendKeyAsync(monitorId, key, cancellationToken).ConfigureAwait(false);\n            if (delay > TimeSpan.Zero) await Task.Delay(delay, cancellationToken).ConfigureAwait(false);\n        }\n    }\n\n    /// <summary>Tizen wakes on the first packet it hears; the repeats cover Wi-Fi loss.</summary>\n    static readonly WakeOnLanOptions WakeOnLanBurst = new()\n    {\n        PacketCount = 3,\n        Port = 9,\n        DelayBetweenPackets = TimeSpan.FromMilliseconds(100),\n    };\n\n    public Task PowerOnAsync(string monitorId, CancellationToken cancellationToken = default)\n    {\n        var configuration = RequiredConfiguration(monitorId);\n        if (string.IsNullOrWhiteSpace(configuration.MacAddress))\n            throw new InvalidOperationException(\"Enter the monitor Wi-Fi MAC address before using Wake-on-LAN.\");\n        return WakeOnLan.SendAsync(\n            configuration.MacAddress, WakeOnLanBurst, cancellationToken: cancellationToken);\n    }\n\n    SamsungTizenConfiguration RequiredConfiguration(string monitorId)\n    {\n        var configuration = _store.Get(monitorId);\n        if (configuration is null || string.IsNullOrWhiteSpace(configuration.IpAddress))\n            throw new InvalidOperationException(\"Associate a Samsung Tizen display first.\");\n        return configuration;\n    }\n\n    SamsungTizenClient ClientFor(string monitorId, SamsungTizenConfiguration configuration)\n    {\n        lock (_lock)\n        {\n            if (_clients.TryGetValue(monitorId, out var client)) return client;\n            client = new SamsungTizenClient(configuration.IpAddress, configuration.Token);","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/mgth/LittleBigMouse/blob/7a42f01d47d99d223b8ee33ba4019af82adf1c48/LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/SamsungTizen/SamsungTizenService.cs#L115-L151","documentation":"SamsungTizenService.PowerOnAsync wakes the monitor via Wake-on-LAN, which requires the monitor's Wi-Fi MAC address in its stored configuration. If the MacAddress field is blank, the service throws InvalidOperationException before attempting the magic packet. The library refuses to send a packet that cannot possibly reach the device.","triggerScenarios":"Calling PowerOnAsync(monitorId) for a monitor whose SamsungTizenConfiguration.MacAddress is null, empty, or whitespace.","commonSituations":"The user paired the display by IP only; the MAC field was cleared during re-configuration; a config entry was created programmatically without the MAC; Wake-on-LAN was tried from a fresh install with imported partial settings.","solutions":["Set the monitor's Wi-Fi MAC address in the SamsungTizenConfiguration before calling PowerOnAsync","Discover/enter the MAC via the display's network settings menu and save it through the service's configuration API","Guard the UI so the Wake-on-LAN action is disabled until a MAC is configured"],"exampleFix":"// before\nawait service.PowerOnAsync(monitorId); // throws when MAC missing\n// after\nvar config = service.GetConfiguration(monitorId);\nif (string.IsNullOrWhiteSpace(config?.MacAddress))\n    throw new InvalidOperationException(\"Configure the monitor MAC address first.\");\nawait service.PowerOnAsync(monitorId);","handlingStrategy":"validation","validationCode":"var config = store.Get(monitorId);\nif (config is null || string.IsNullOrWhiteSpace(config.MacAddress))\n    throw new InvalidOperationException(\"Enter the monitor Wi-Fi MAC address before using Wake-on-LAN.\");","typeGuard":"static bool HasMac(SamsungTizenConfiguration? c) =>\n    c is not null && !string.IsNullOrWhiteSpace(c.MacAddress);","tryCatchPattern":"try\n{\n    await service.PowerOnAsync(monitorId, ct);\n}\ncatch (InvalidOperationException)\n{\n    // prompt user to configure the MAC address in settings\n}","preventionTips":["Capture the MAC during initial display association, not later","Disable Wake-on-LAN UI actions until a MAC is stored","Trim and normalize MAC input when saving configuration","Re-check config after settings imports/migrations"],"tags":["wake-on-lan","configuration","missing-data","samsung-tizen"],"backgroundTag":"missing-required-config-field","analyzedSha":"7a42f01d47d99d223b8ee33ba4019af82adf1c48","analyzedAt":"2026-09-16T00:35:00.514Z","contentChangedAt":"2026-09-16T00:35:00.514Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}