@alexslx Unfortunately, the service crashes randomly after a while. This also happened with 1.x and now also on latest 2.x version, so it’s not an issue introduced in 2.x.
[2020-01-17 00:38:12 +01:00][ERROR][IOTLinkService.Service.WebSockets.Server.WebSocketServer]: Error while trying to disconnect client: System.Net.WebSockets.WebSocketException (0x80004005): Die 'System.Net.WebSockets.ServerWebSocket'-Instanz kann nicht für die Kommunikation verwendet werden, da sie in den Zustand 'Aborted' gewechselt ist. ---> System.Net.WebSockets.WebSocketException (0x80004005): Der empfangene Nachrichtentyp 'Text' ist nach dem Aufruf von WebSocket.CloseAsync ungültig. WebSocket.CloseAsync sollte nur verwendet werden, wenn vom Remoteendpunkt keine weiteren Daten erwartet werden. Verwenden Sie stattdessen 'WebSocket.CloseOutputAsync', um weiterhin Daten empfangen zu können, den Ausgabechannel jedoch zu schließen.
bei System.Net.WebSockets.WebSocketBase.<CloseAsyncCore>d__56.MoveNext()
bei System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean aborted, Exception innerException)
bei System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
bei System.Net.WebSockets.WebSocketBase.<CloseAsyncCore>d__56.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei IOTLinkService.Service.WebSockets.Server.WebSocketServer.<DisconnectClient>d__10.MoveNext()
[WORKGROUP\DESKTOP-VPALK8A][2020-01-17 00:38:12 +01:00][CRITICAL][IOTLink.Program]: Critical Unhandled Exception: System.InvalidOperationException: Die Sammlung wurde geändert. Der Enumerationsvorgang kann möglicherweise nicht ausgeführt werden.
bei System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
bei System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
bei System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
bei IOTLinkService.Service.WebSockets.Server.WebSocketServer.<DisconnectClient>d__10.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
bei System.Threading.ThreadPoolWorkQueue.Dispatch()
Hi, sorry for your problem. This is known issue for me because of underlaying library used to communicate between the Windows Service and Client Addon used to issue commands to your current running user. I’ll try to improve on this but as it is now it should be reconnecting after any fatal errors.
@All
I’ll try to improve discovery and ‘undiscovery’ more. Also, pull requests are always appreciated.
NEED HELP:
If someone can help me writing a better and user-friendly documentation I would love that help. Sometimes I feel it is too much complicated for new users as I’m too technical
I have an issue where when I restart Home Assistant the values from my servers are not populated until I RDP to my servers and restart the service. If the values change they are updated but this may not happen for a long period or at all. Is there a way to send a command to those servers from a button on home assistant to restart the service? Is there a better or different way to accomplish this?
I did look for an answer to this but couldn’t find one.
I have a problem where the service always crashes after around 2 mins. I can initally see the sensors and values in Home Assistant, and they were discovered automatically, but then no updates after the service has stopped. I have Mosquitto on the same Windows machine as IOT Link.
[WORKGROUP\HOMESERVER][2020-02-16 17:00:23 +01:00][INFO][IOTLink.IOTLinkService]: Windows Service is started.
[WORKGROUP\HOMESERVER][2020-02-16 17:00:23 +01:00][INFO][IOTLinkService.Service.Engine.MQTT.MQTTClient]: Trying to connect to broker: tcp://127.0.0.1:1883 (Try: 1).
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/shutdown
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/reboot
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/logoff
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/lock
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/hibernate
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/suspend
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/run
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/displays/on
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/displays/off
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/volume/set
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/volume/mute
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/notify
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/send-keys
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/playpause
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/stop
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/next
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Addon Commands has subscribed to topic commands/media/previous
[WORKGROUP\HOMESERVER][2020-02-16 17:00:24 +01:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Loading addon: commands
[WORKGROUP\HOMESERVER][2020-02-16 17:00:26 +01:00][INFO][IOTLinkAddon.Service.WindowsMonitorService]: System monitor is activated.
[WORKGROUP\HOMESERVER][2020-02-16 17:00:27 +01:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Loading addon: windowsmonitor
[WORKGROUP\HOMESERVER][2020-02-16 17:00:28 +01:00][SYSTEM][IOTLinkService.Service.Engine.MQTT.MQTTClient]: ALL YOUR MQTT TOPICS WILL START WITH iotlink/WORKGROUP/homeserver/
[WORKGROUP\HOMESERVER][2020-02-16 17:00:28 +01:00][INFO][MQTTnet.Client.MqttClient]: Connection established successfully.
[WORKGROUP\HOMESERVER][2020-02-16 17:01:53 +01:00][ERROR][IOTLinkService.Service.WebSockets.Server.WebSocketServer]: Error while trying to disconnect client: System.Net.WebSockets.WebSocketException (0x80004005): Instansen System.Net.WebSockets.ServerWebSocket kan inte användas för kommunikation eftersom den har gått över till läget Aborted. ---> System.Net.WebSockets.WebSocketException (0x80004005): Den mottagna meddelandetypen Text är ogiltig när WebSocket.CloseAsync har anropats. WebSocket.CloseAsync ska bara användas om inga fler data förväntas från fjärrslutpunkten. Använd WebSocket.CloseOutputAsync i stället om du vill fortsätta att kunna ta emot data men stänga utdatakanalen.
vid System.Net.WebSockets.WebSocketBase.<CloseAsyncCore>d__56.MoveNext()
vid System.Net.WebSockets.WebSocketBase.ThrowIfAborted(Boolean aborted, Exception innerException)
vid System.Net.WebSockets.WebSocketBase.ThrowIfConvertibleException(String methodName, Exception exception, CancellationToken cancellationToken, Boolean aborted)
vid System.Net.WebSockets.WebSocketBase.<CloseAsyncCore>d__56.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
vid IOTLinkService.Service.WebSockets.Server.WebSocketServer.<DisconnectClient>d__10.MoveNext()
[WORKGROUP\HOMESERVER][2020-02-16 17:01:53 +01:00][CRITICAL][IOTLink.Program]: Critical Unhandled Exception: System.InvalidOperationException: Mängden har ändrats. Det går inte att köra uppräkningsåtgärden.
vid System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
vid System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
vid System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
vid IOTLinkService.Service.WebSockets.Server.WebSocketServer.<DisconnectClient>d__10.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
vid System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
vid System.Threading.ThreadPoolWorkQueue.Dispatch()
Thanks for this excellent program. Ever since I updated to the latest version v2.0.3 I am getting this error in my logs and the Idle Time sensor no longer works. The other sensors do work. Can I provide any additional info?
Thanks
[WORKGROUP\DDS-ASUS][2020-02-16 23:59:10 -05:00][ERROR][IOTLinkAddon.Service.WindowsMonitorService]: SendAllInformation - Error: System.Management.ManagementException: Not found
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementScope.InitializeGuts(Object o)
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObject.Initialize(Boolean getObject)
at System.Management.ManagementBaseObject.get_Properties()
at System.Management.ManagementBaseObject.GetPropertyValue(String propertyName)
at IOTLinkAPI.Platform.Windows.WindowsAPI.LastBootUpTime()
at IOTLinkAPI.Helpers.PlatformHelper.LastBootUpTime()
at IOTLinkAddon.Service.Monitors.UptimeMonitor.GetMonitorItems(Configuration config, Int32 interval)
at IOTLinkAddon.Service.WindowsMonitorService.ExecuteMonitor(IMonitor monitor)
at IOTLinkAddon.Service.WindowsMonitorService.SendAllInformation()
looks like i’m getting the same errors on version v2.0.3
has this been resolved ?
ta
LeeB
[BERRYS\SATURN][2020-02-25 11:01:49 +08:00][INFO][IOTLink.IOTLinkService]: Windows Service is started.
[BERRYS\SATURN][2020-02-25 11:01:49 +08:00][CRITICAL][IOTLink.Program]: Critical Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at IOTLinkAPI.Configs.MqttConfig.DiscoveryConfig.FromConfiguration(Configuration config)
at IOTLinkAPI.Configs.MqttConfig.FromConfiguration(Configuration config)
at IOTLinkService.Service.Engine.MQTT.MQTTClient.Init()
at IOTLinkService.Service.Engine.ServiceMain.SetupMQTTHandlers()
at IOTLinkService.Service.Engine.ServiceMain.StartApplication()
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.ServiceProcess.ServiceBase.Run(ServiceBase[] services)
at IOTLink.Program.Main(String[] args)
Working great and love the new HA Discovery option.
Is there a way to grab external IP or to detect if a alternate network adaptor is connected? I would like to use this to create a sensor to monitor if my VPN is connected.
[WORKGROUP\CY-PC][2020-03-14 21:13:17 +00:00][ERROR][IOTLinkService.Service.Loaders.AssemblyLoader]: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
at System.Diagnostics.PerformanceCounterLib.get_NameTable()
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CounterExists(String category, String counter, Boolean& categoryExists)
at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName)
at IOTLinkAddon.Service.Monitors.CPUMonitor..ctor()
at IOTLinkAddon.Service.WindowsMonitorService..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at IOTLinkService.Service.Loaders.AssemblyLoader.LoadAssemblyDLL(AddonInfo& addonInfo)
[WORKGROUP\CY-PC][2020-03-14 21:13:17 +00:00][SYSTEM][IOTLinkService.Service.Engine.MQTT.MQTTClient]: ALL YOUR MQTT TOPICS WILL START WITH iotlink/workgroup/cy-pc/
[WORKGROUP\CY-PC][2020-03-14 21:13:17 +00:00][INFO][MQTTnet.Client.MqttClient]: Connection established successfully.
Seems to get LWT and Status and a few others but almost every other MQTT status via mqttlens or HA doens’t work. any ideas?
Does IOT Link expose camera on/off state to MQTT? I don’t need a screenshot of the PC screen or to take a picture with the camera, but I want to integrate with HA based on the status of camera on/off.
In this time with many of us working from home, I’m trying to fashion a simple ‘on air’ light kind of thing, and want to turn on/off with HomeAssistant based on the MQTT presented status of my Win10 desktop camera’s being in use.