more G-Labs products

Author Topic: HG statistics stop updating (MQTT program issue?)  (Read 1777 times)

August 28, 2015, 05:42:25 PM
Read 1777 times

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
EDIT:  I've changed the title because the actual problem I'm seeing doesn't seem to be an interface lock.


I've updated my MQTT script to collect more data and turned it back on (it was disabled for around a month or 2).  I've had no issues of any kind with HG with statistics turned off.

The original script seemed to cause HG to crash after some time (several days).  There was a thread somewhere that suggested when the database filled up, things became problematic.  Deleting the database apparently helped.  I found that simply restarting would get HG running again but I'm not sure if there was a true fix.

The new script is essentially the same with a new set of sensors.  However, the statistics still crashes HG.  What I'm seeing is that HG is still running in the background as my sensor driven lights still function (albeit rather slow).  However, I can't access the web interface and when restarting the service from the RPi there was an error suggesting that all of the processes were not running.

So, what should I do?  My setup collects data received via RF from various 433MHz sensors.  It decodes the packets and records the data.  Since things are all transmitting at different frequencies between 18 and 48 seconds, I decided to send all data to the MQTT broker at 30 second intervals.  That means that HG will see 2880 data sets every 24 hours and each data set contains 12 sensor values (which may increase going forward).  That means that HG needs to record 34560 values into the statistics database daily.  It appears that HG stopped recording data after 2-3 days.

I can reduce the frequency that data is recorded I suppose, but having a fine level of detail is preferable.  I really just need to verify that the statistics engine should be capable of recording as much data as I'm asking of it or if I'm pushing it too hard.
« Last Edit: September 11, 2015, 05:17:49 PM by bkenobi »

September 01, 2015, 04:00:32 AM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
A big wind storm took out power for a couple days, so I didn't have any issues yet (obviously), but I'll post error messages when I see this again.  Does no response mean that this issue is not a problem for other people any more?

September 10, 2015, 05:51:17 PM
Reply #2

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I have not experienced the interface locking up issue, but the statistics is still failing to update correctly.  I have looked around and my settings allow the database to limit at 10Mb but it's only 3Mb on disk right now suggesting that HG should still be able to store statistics.  However, as can be seen in the screen shot, HG has not updated the sensors since 9/8 (2 days ago).  I looked in the Modules.List and see that it has not updated the "Weather Station", "Kennel Temperature", or "Power Meter" since 9/8.

I am writing a sensor log file that contains the received MQTT data that the program is attempting to write to the sensors.  For some reason, that stops at 9/8 as well.  Looking in the mono output, I see that the power data is being displayed every 30 seconds but it has not changed since 9/8 either.

I checked that the MQTT broker was still receiving data by subscribing to "#" at the command line and can confirm that data is still sent and received.  However, either HG or the program (based on the stock MQTT APP) stop working.  Perhaps someone could help me understand why?
« Last Edit: September 10, 2015, 05:57:54 PM by bkenobi »

September 11, 2015, 05:26:02 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I looked at the last time the MQTT APP output data to the Sensor.log file:
Code: [Select]
2015/09/08 12:12:18.5849260 ; acurite5n1 Windspeed=  1.1,Winddir=180.0,Rainfall= 0.64,TempF= 67.5,Humidity=72,Battery=1I then located that event in the mono.log file:
Code: [Select]
2015-09-08T12:12:18.5972070-07:00 MQTT:Sensors acurite5n1 Virtual Module Sensor.Windspeed 1.1
2015-09-08T12:12:18.6101890-07:00 MQTT:Sensors acurite5n1 Virtual Module Sensor.Winddir 180.0
2015-09-08T12:12:18.6340640-07:00 MQTT:Sensors acurite5n1 Virtual Module Sensor.Temperature 19.7
2015-09-08T12:12:18.6448490-07:00 MQTT:Sensors acurite5n1 Virtual Module Sensor.Humidity 72.0
Searching through the rest of the log, I see no more instances of MQTT:Sensors (the virtual module the code creates).  The code has Program.GoBackground() at the end, so the code shows a green LED.  I do see an error in the program parameters, but it's nothing that should cause it to stop:
Code: [Select]
   "Name": "MQTT Sensors",
   "Description": "",
   "DeviceType": "Program",
   "Domain": "HomeAutomation.HomeGenie.Automation",
   "Address": "1030",
   "Properties": [
       {
           "Name": "Compiler.Warning",
           "Description": "",
           "Value": "TC,19,11: `HomeGenie.Automation.Scripting.ProgramHelper.AddFeature(string, string, string)' is obsolete: `use 'AddFeature(<forDomains>, <forTypes>, <forPropertyName>, <description>, <type>)' instead'",
           "UpdateTime": "2015-09-03 05:03:24Z"
Other than restarting the APP periodically, I don't currently see a fix.  Has anyone using the stock MQTT APP seen any issues with it failing to run after some time?

October 04, 2015, 05:56:45 PM
Reply #4

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I'm still having issues with this, but I have a new problem that may be related or maybe not.  I no longer see the "statistics" item in the menu so I can't get to it directly.  I can only access statistics by clicking on the temperature/humidity item in the Home menu.  This brings me to the group where I have the Energy Monitor widget located.

Either HG no longer is designed to show the statistics menu item so I shouldn't expect to see it, or it's not showing up for some unknown reason.