IOT Link - Windows Management using MQTT

Hi @Tomer_Klein ,

I have created a sample project here:

I need to write a proper dev documentation but I’m focusing on 1.2 which will bring some useful features (hint: https://i.imgur.com/r7uyD1c.png).

Creating a TTS Service addon is great, I think there is no problem with.

However the MQTT Monitor currently I believe that will be a issue because all addons are limited to their user-space for subscribing and publishing messages so all topics will start with {prefix}/{domain}/{machineName}/{addonId}. I made that way so addons can’t mess with others and create difficult to maintain and support 3rd party addons.

@theDiver
Yes, the interval is in seconds. If you have cache enabled, they won’t send again unless the value changes.

@alexslx

Strange, I have set all ‘cacheable’ to false to force it to update, and it only sends information when i boot the server, og restart the service not every 10 seconds :frowning:

I also tried to uninstall, remove the iotlink folder, and reinstall it.
Setting it up again without just copying the old config files.

It transmits data once, when starting, and then only some of it if i touch the config files.

I am working on the server, so the chances that CPU load does not change is quite small.

Anyway i could debug it? The logfiles, don’t really show anything, i have set the log level to ‘5’

Any chance that Windows 10 Notifications could be added?
thanks

@alexslx

Whe i restart the service, with loglevel set to debug i get this

[WORKGROUP\SERVER][2019-06-25 13.58.30 +02:00][INFO][IOTLink.IOTLinkService]: Windows Service is started.
[WORKGROUP\SERVER][2019-06-25 13.58.30 +02:00][DEBUG][IOTLinkAPI.Helpers.ConfigHelper]: Adding file system watcher for C:\ProgramData\IOTLink\Configs\configuration.yaml
[WORKGROUP\SERVER][2019-06-25 13.58.30 +02:00][INFO][IOTLinkService.Service.Engine.MQTT.MQTTClient]: Trying to connect to broker: tcp://10.0.0.130:1883 (Try: 1).
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][VERBOSE][IOTLinkService.Service.Engine.MQTT.MQTTClient]: MQTT Connected
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][VERBOSE][IOTLinkService.Service.Engine.ServiceMain]: MQTT Connected
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceAddonManager]: Loading 2 external addons
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceAddonManager]: Addon configuration loaded: System Commands
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][DEBUG][IOTLinkService.Service.Loaders.AssemblyLoader]: Found ServiceAddon!
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/shutdown
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/reboot
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/logoff
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/lock
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/hibernate
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/suspend
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/run
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkAddon.Commands]: Addon Commands has subscribed to topic commands/volume/set
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Addon Commands has subscribed to topic commands/volume/mute
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Loading addon: commands
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceAddonManager]: Addon configuration loaded: Windows Monitor
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][DEBUG][IOTLinkService.Service.Loaders.AssemblyLoader]: Found ServiceAddon!
[WORKGROUP\SERVER][2019-06-25 13.58.31 +02:00][DEBUG][IOTLinkAPI.Helpers.ConfigHelper]: Adding file system watcher for C:\ProgramData\IOTLink\Addons\WindowsMonitor\config.yaml
[WORKGROUP\SERVER][2019-06-25 13.58.33 +02:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: System monitor is activated.
[WORKGROUP\SERVER][2019-06-25 13.58.33 +02:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Loading addon: windowsmonitor
[WORKGROUP\SERVER][2019-06-25 13.58.33 +02:00][INFO][MQTTnet.Client.MqttClient]: Connection established successfully.
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: OnMonitorTimerElapsed: Started
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: CPU Monitor - Sending information
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: Memory Monitor - Sending information
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][VERBOSE][IOTLinkAddon.Service.WindowsMonitorService]: Power monitor disabled.
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: HardDrive Monitor - Sending information
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.34 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.35 +02:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\SERVER][2019-06-25 13.58.36 +02:00][DEBUG][IOTLinkService.Service.Engine.AgentManager]: StartAgent() - Executing Run. Application: C:\Program Files (x86)\IOTLink\IOTLinkAgent.exe CommandLine: --agent ws://localhost:9799 WorkingDir: C:\Program Files (x86)\IOTLink Username: reinke Visible: False Fallback: False
[WORKGROUP\SERVER][2019-06-25 13.58.36 +02:00][DEBUG][IOTLinkAPI.Helpers.PlatformHelper]: Run - Command: C:\Program Files (x86)\IOTLink\IOTLinkAgent.exe Args: IOTLinkAgent.exe --agent ws://localhost:9799 WorkingDir: C:\Program Files (x86)\IOTLink User: reinke Visible: False FallBack: False
[WORKGROUP\SERVER][2019-06-25 13.58.36 +02:00][DEBUG][IOTLinkAPI.Platform.Windows.WindowsAPI]: WindowsAPI::Run() - Process seems to be started.

As far as i understand your code, everytime the timer elapses, it should put ’ OnMonitorTimerElapsed: Started in the log file, but it never occurs :frowning:

It seems like the timer is not running correctly for some reason :frowning:

Hey guys.

It’s time for IOTLink v1.2.0 release as it brings a lot of new useful features for all of us.

The first and most anticipated feature is using IOTLink to display Windows 10+ notifications using MQTT from HA or directly with possibility of customizing the icon, title and text and also, when the user click on it, it is possible to open an URL or Application.

Other feature reworked on is the current user and idle time monitoring. Now it only shows the value for the current physically logged in user so you can work with your automations easier than before. Last but not least, I’ve added new network LAN monitoring (IPv4, IPv6, Port Speed), a command to force refresh all your sensors information and option to change which size (MB, GB and TB) is used for HDD monitoring.

Screenshots:


You can download it directly from https://iotlink.gitlab.io and see the Wiki for support and more information.

Hope you guys enjoy it.

@theDiver

Please try the new version, I’ve fixed some connecting bugs

1 Like

Hi @alexslx

I have just installed it, and now the values update every 10 seconds :slight_smile:Thanks a lot.

Going to test the network info later.

Keep up the good work.

Hi @alexslx

I get this error, every 10 seconds:

[WORKGROUP\SERVER][2019-06-27 09.18.40 +02:00][DEBUG][System.Timers.Timer]: OnMonitorTimerElapsed: Completed
[WORKGROUP\SERVER][2019-06-27 09.18.41 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: OnMonitorTimerElapsed: Started
[WORKGROUP\SERVER][2019-06-27 09.18.41 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: CPU Monitor - Sending information
[WORKGROUP\SERVER][2019-06-27 09.18.41 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: Memory Monitor - Sending information
[WORKGROUP\SERVER][2019-06-27 09.18.41 +02:00][VERBOSE][IOTLinkAddon.Service.WindowsMonitorService]: Power monitor disabled.
[WORKGROUP\SERVER][2019-06-27 09.18.41 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: HardDrive Monitor - Sending information
[WORKGROUP\SERVER][2019-06-27 09.18.41 +02:00][ERROR][IOTLinkAddon.Service.WindowsMonitorService]: SendAllInformation - Error: System.IO.IOException: The parameter is incorrect.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.DriveInfo.get_TotalSize()
   at IOTLinkAddon.Service.WindowsMonitorService.SendHardDriveInfo()
   at IOTLinkAddon.Service.WindowsMonitorService.SendAllInformation()

@alexslx

When i run loglevel 4, i still get this every second in the logfile:

[WORKGROUP\SERVER][2019-06-27 09.26.33 +02:00][DEBUG][IOTLinkAddon.Service.WindowsMonitorService]: OnMonitorTimerElapsed: Started
[WORKGROUP\SERVER][2019-06-27 09.26.33 +02:00][VERBOSE][IOTLinkAddon.Service.WindowsMonitorService]: Power monitor disabled.
[WORKGROUP\SERVER][2019-06-27 09.26.33 +02:00][VERBOSE][IOTLinkAddon.Service.WindowsMonitorService]: CurrentUser monitor disabled.
[WORKGROUP\SERVER][2019-06-27 09.26.33 +02:00][VERBOSE][IOTLinkAddon.Service.WindowsMonitorService]: IdleTime monitor disabled.
[WORKGROUP\SERVER][2019-06-27 09.26.33 +02:00][VERBOSE][IOTLinkAddon.Service.WindowsMonitorService]: Display-Info monitor disabled.
[WORKGROUP\SERVER][2019-06-27 09.26.33 +02:00][VERBOSE][IOTLinkAddon.Service.WindowsMonitorService]: Display-Screenshot monitor disabled.
[WORKGROUP\SERVER][2019-06-27 09.26.33 +02:00][DEBUG][System.Timers.Timer]: OnMonitorTimerElapsed: Completed

I guess Verbose level is a bit to much for telling me i have disabled it, debug would be better in my oppinion :slight_smile:

I just installed this for the first time and I am getting this error as well.

@fantangelo and @theDiver

You guys have any kind of different permissions on yours hard-drives? Can you guys descrive what kind of drives you have? eg:
C = SDD
D = HDD
E = BD-ROM, Floppy (it still exists?), Network Drive, etc

I’m trying to find which drive and why (permissions maybe?) it happens, because I have 1 SSD + 2 SSD in RAID0 + 1TB HDD and never got this error.

Also are you guys willing to help me get to this error by joining discord (https://discord.me/iotlink) so I can try to get to the error with you guys? I’ll be off today but tomorrow I’ll be around most of the time.

I’ll gladly try to help :slight_smile:

Are you sure it’s the hard-drives that are the problem? I get all the information about the drives send to my Home Assistant system.

If you could send me a debug build version, i can try and run that.

Have tried to build one myself, but I am having some issues with a missing package (can’t remember which at the moment)

I had same issue with it not detecting hard drive and user info. My machine is on a domain unsure if anyone else with the issue is. Anyway I changed the account that the service uses to logon from local system to a domain account and all ok now.

My win10 pc has just a plain sata HDD. No domain controller. The other HD stats show OK, just the one error.

Hey,

You guys can try this beta version?

I read that this System.IO.IOException: The parameter is incorrect. error occurs when the HDD is not ready or have corrupt meta-information. I’ve added a check for IsRead state and added a catch for the other error but it will still be seen in logs. Let’s see how this thing behave now. Unfortunately I’m unable to replicate the error here so bear with me.

@theDiver
I can help you compile later in Discord, just drop me a pm.

In hindsight changing the service to run as a domain account wasn’t the best idea as it appears to break some of the other functionality.

[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:50:43 +03:00][INFO][MQTTnet.Client.MqttClient]: Connection established successfully.
[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:50:46 +03:00][WARNING][System.Dynamic.UpdateDelegates]: WebSocketServer - Agent from system not found.
[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:50:56 +03:00][WARNING][System.Dynamic.UpdateDelegates]: WebSocketServer - Agent from system not found.
[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:51:06 +03:00][WARNING][IOTLinkService.Service.Engine.ServiceAddonManager]: WebSocketServer - Agent from system not found.
[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:51:16 +03:00][WARNING][IOTLinkService.Service.Engine.ServiceAddonManager]: WebSocketServer - Agent from system not found.
[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:51:26 +03:00][WARNING][IOTLinkService.Service.Engine.ServiceAddonManager]: WebSocketServer - Agent from system not found.
[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:51:36 +03:00][WARNING][IOTLinkService.Service.Engine.ServiceAddonManager]: WebSocketServer - Agent from system not found.
[WORKGROUP\WINDOWS_10_VM][2019-06-28 04:51:46 +03:00][WARNING][IOTLinkService.Service.Engine.ServiceAddonManager]: WebSocketServer - Agent from system not found.

I just finished installing the new version and I get the posts below.

Please note that despite the message, everything works.

If you can add the system time - how long the computer is working

I have just installed the beta, will report back later.

My server harddrives spins downs rather quickly, can it be your tool gets annoyed due to them wanting to spin up again?

The new design after releasing the new version

2 Likes

@alexslx

It seems like the beta is not throwing that exception anymore.

One detail i noticed the ‘windowsmonitor’ config.yaml file is overwritten when i install a new version.
I think you should ask nicely, just as you do with the ‘configuration.yaml’ file :slight_smile:

I’ve released the same beta above as the final v1.2.1 as it seems to have fixed the issue. Therefore, if you have installed the beta v1.2.1 you don’t need to reinstall it.