more G-Labs products

Author Topic: CPU Load Sensor  (Read 9937 times)

December 06, 2015, 01:38:47 AM
Reply #30

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I haven't used custom widgets before.  Do I unzip this into somewhere on my RPi or is there a way in HG to install a widget?

I found the import tool in HG under the widgets configuration menu.  I updated to the latest version and everything looks good.
« Last Edit: December 06, 2015, 03:33:53 AM by bkenobi »

December 06, 2015, 07:09:52 PM
Reply #31

enterprised

  • ****
  • Information
  • Sr. Member
  • Posts: 101
  • Things are only impossible until they are not
One tiny issue with the custom widget, It does not show up in HG Plus for Android.
4a 75 73 74 20 61 20 70 65 72 73 6f 6e 20 68 61 76 69 6e 67 20 66 75 6e 20 77 69 74 68 20 68 6f 6d 65 20 61 75 74 6f 6d 61 74 69 6f 6e
enterprised == guytpetj

December 06, 2015, 08:07:10 PM
Reply #32

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi DavZero,

you can switch back using standard HG widget since the ui refresh and notification issues are solved, unless you're looking for a different design or layout.

Cheers,
g.

December 06, 2015, 09:16:33 PM
Reply #33

DavZero

  • **
  • Information
  • Jr. Member
  • Posts: 48
Hi,

@Gene, I've custom a little the widget in order to show the '%' symbol after the value so I will continue to use it. I've made feature request in order to manage which property to show in the statistic. Is there a way to make a custom widget compatible with HG Plus app?

@enterprised, I'm sorry but I don't know how to make a widget compatible with the HG Plus android app. Depending on the response of Gene, If you need it to be show in the Android App, I could change in the way Gene tell me or if it's not possible to make a widget compatible with HG plus, I could use the standard widget but without the '%' symbol.

Bye

December 07, 2015, 03:21:02 AM
Reply #34

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
this app gives me a runtime error on win7... "category doesn't exist"
any ideas what this is?  it happened on older version too.  tried recompiling

December 07, 2015, 09:54:01 PM
Reply #35

DavZero

  • **
  • Information
  • Jr. Member
  • Posts: 48
Yes it's because of this line :
Code: [Select]
var memCounter = new System.Diagnostics.PerformanceCounter("Mono Memory", "Total Physical Memory");
It only works when using Mono. I don't find a way to do it in a portable way. For get this information on a Windows plateform, you should check the WMI capability. I will try to add a windows compatibiliy if I find the time to do it. For now just comment the line about the memory usage en the counter memCounter.

Bye

December 08, 2015, 09:49:32 PM
Reply #36

DavZero

  • **
  • Information
  • Jr. Member
  • Posts: 48
Hi,

sorry @Kevin1 but I can't find a simple way to get the physical memory size installed in a comptuer under Windows.

Please find the attached code which get the physical memory size with Mono if the counter exist or if not, it use the default size which is 2Go. If you need to change this value, for example if your computer has 4 Go, juste change this line :
Code: [Select]
double totalPhysicalMemory = 2.0*1024*1024*1024;and replace the "2.0" bye the correct value on your computer (for exemple 4.0 or 8.0)

I can't test so if there's an other problem tell me and I will try to correct it.

December 09, 2015, 01:36:48 PM
Reply #37

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
Thanks for the help!  I haven't been able to get the widget to show the data for some reason.  I stuck in a Notify and it was showing CPU values, just not showing in the widget.  I'll look at it again tonight.  My HG appears to be down now :(

December 27, 2015, 04:26:08 PM
Reply #38

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I had this working great last month but when I just checked to see some other statistics data I found that I didn't have any info for my CPU, memory, disk usage.  Does anyone else find a similar issue?  I assume this is either too much data is being stored for that specific data set (since I do have other data that is more current for other statistics items) or something broke in the CPU Load Sensor code.

I initially thought that perhaps the :nopopup: code might have affected the statistics, but removing it and recompiling didn't change anything.  I still have up to date widget values, though.  This is strictly a statistics issue I believe.

December 28, 2015, 09:33:25 PM
Reply #39

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I have been working with my MQTT sensor code which pushes data into several sensors (temperature, humidity, watts, etc) and all of those statistics are updating as expected.  For some reason, the widget for CPU Load is updating but the statistics are not.  Maybe it's because I switched it over to use the custom widget rather than the built-in sensor widget.

December 29, 2015, 11:41:00 AM
Reply #40

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi bkenobi,

Same you at the fisrt the CPU statistics were recorded. And now no. For it is recorded we must prefix  the parameters name with "Meter." instead of "System." or look at that post :
http://www.homegenie.it/forum/index.php?topic=1248.msg8294#msg8294
from Gene for add "System." prefix to the statistics handler.

December 29, 2015, 12:17:34 PM
Reply #41

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I remembered seeing that post but couldn't find it.  I'll add the prefix, thanks.

January 02, 2016, 06:13:23 AM
Reply #42

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Is the CPU meter working for others on RPi?  Memory and disk are working but the CPU isn't any more.

January 02, 2016, 06:44:22 AM
Reply #43

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
For me raspi with r508a CPU load works, it is clearly updated

January 02, 2016, 07:12:59 AM
Reply #44

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Good to know.  I'll look around in the code to see if I messed something up then.