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
3 changes: 1 addition & 2 deletions src/PepperDash.Core/Logging/Debug.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System;
using System.Collections.Generic;
using System.Net;
using System.Reflection;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
Expand Down
6 changes: 4 additions & 2 deletions src/PepperDash.Core/Logging/DebugWebsocketSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ public string Url
if (service == null) return "";

// Use CSLAN IP if available, otherwise fallback to primary IP. This ensures we provide a reachable URL in dual-stack environments.
if (!string.IsNullOrEmpty(CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1)))
return $"wss://{CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1)}:{_httpsServer.Port}{service.Path}";
var cslanIp = CrestronEthernetHelper.GetEthernetParameter(
CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1);
if (!string.IsNullOrEmpty(cslanIp) && cslanIp != "Invalid Value")
return $"wss://{cslanIp}:{_httpsServer.Port}{service.Path}";
else
return $"wss://{CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0)}:{_httpsServer.Port}{service.Path}";
}
Expand Down
20 changes: 20 additions & 0 deletions src/PepperDash.Essentials/ControlSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig
private CEvent _initializeEvent;
private const long StartupTime = 500;

private const string minimumFirmwareVersion = "2.8006.00110";

/// <summary>
/// Initializes a new instance of the ControlSystem class
/// </summary>
Expand All @@ -46,6 +48,24 @@ public ControlSystem()
/// <inheritdoc />
public override void InitializeSystem()
{

// Get FW version and stop if it's too low to run this version of Essentials. Must be greater than v2.8006.00110
var fwVersion = InitialParametersClass.FirmwareVersion;

Debug.LogInformation("Control System Hardware Version: {fwVersion}", fwVersion);

// split the version into parts and compare against minimumFirmwareVersion
var versionParts = fwVersion.Split('.').Select(int.Parse).ToArray();
var minParts = minimumFirmwareVersion.Split('.').Select(int.Parse).ToArray();
if (versionParts.Length < minParts.Length
|| versionParts[0] < minParts[0]
|| (versionParts[0] == minParts[0] && versionParts[1] < minParts[1])
|| (versionParts[0] == minParts[0] && versionParts[1] == minParts[1] && versionParts[2] <= minParts[2]))
{
Debug.LogFatal("Firmware version {fwVersion} is too low to run this version of Essentials. Please upgrade to greater than v{minimumFirmwareVersion}.", fwVersion, minimumFirmwareVersion);
return;
}

// If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
// to allow any HD-BaseT DM endpoints to register first.
bool preventInitializationComplete = Global.ControlSystemIsDmpsType;
Expand Down
Loading