diff --git a/src/PepperDash.Essentials.MobileControl/MobileControlSystemController.cs b/src/PepperDash.Essentials.MobileControl/MobileControlSystemController.cs index b802b1c8..a7f019ff 100644 --- a/src/PepperDash.Essentials.MobileControl/MobileControlSystemController.cs +++ b/src/PepperDash.Essentials.MobileControl/MobileControlSystemController.cs @@ -252,7 +252,7 @@ namespace PepperDash.Essentials return _wsClient2.IsAlive && IsAuthorized; }); - Debug.SetFileMinimumDebugLevel(Serilog.Events.LogEventLevel.Debug); + Debug.SetFileMinimumDebugLevel(Serilog.Events.LogEventLevel.Verbose); } private void SetupDefaultRoomMessengers() @@ -1338,13 +1338,38 @@ namespace PepperDash.Essentials Log = { Output = (data, s) => - this.LogDebug( - "Message from websocket: {message}", - data - ) + { + switch (data.Level) + { + case LogLevel.Trace: + this.LogVerbose(data.Message); + break; + case LogLevel.Debug: + this.LogDebug(data.Message); + break; + case LogLevel.Info: + this.LogInformation(data.Message); + break; + case LogLevel.Warn: + this.LogWarning(data.Message); + break; + case LogLevel.Error: + this.LogError(data.Message); + break; + case LogLevel.Fatal: + this.LogFatal(data.Message); + break; + } + } } }; + // if Essentials is running on a server, set the log level to the lowest level to get the most detail in the logs + if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Server) + { + _wsClient2.Log.Level = LogLevel.Trace; + } + _wsClient2.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls12; diff --git a/src/PepperDash.Essentials.MobileControl/Touchpanel/MobileControlTouchpanelController.cs b/src/PepperDash.Essentials.MobileControl/Touchpanel/MobileControlTouchpanelController.cs index 9bfe3a33..fd734465 100644 --- a/src/PepperDash.Essentials.MobileControl/Touchpanel/MobileControlTouchpanelController.cs +++ b/src/PepperDash.Essentials.MobileControl/Touchpanel/MobileControlTouchpanelController.cs @@ -200,6 +200,19 @@ namespace PepperDash.Essentials.Touchpanel this.csSubnetMask = System.Net.IPAddress.Parse(csSubnetMask); this.csIpAddress = System.Net.IPAddress.Parse(csIpAddress); } + catch (ArgumentException) + { + Debug.LogInformation("This processor does not have a CS LAN", this); + } + catch (InvalidOperationException) + { + Debug.LogInformation("This processor does not have a CS LAN", this); + } + catch (Exception ex) + { + Debug.LogError($"Unexpected exception when checking CS LAN: {ex}", this); + } + } /// /// Updates the theme setting for this touchpanel controller and persists the change to configuration.