We have moved at community.getvera.com

Author Topic: New dataMine graphing and logging plugin  (Read 287573 times)

Offline jpitts

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #135 on: November 29, 2011, 08:25:53 pm »
nickrwym thanks! I scp'd L_DataMine1.lua in and now it works, now I just need to figure out how to setup all I want to track.

Offline nickrwym

  • Full Member
  • ***
  • Posts: 139
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #136 on: November 30, 2011, 09:19:01 am »
Glad to hear it, I'm very pleased with the plugin, makes Vera do what I had hoped it would out of the box.

My OW server has just arrived, more things to play with this evening!

Nick
« Last Edit: November 30, 2011, 09:38:25 am by nickrwym »

Offline Qrp

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #137 on: December 04, 2011, 09:32:20 am »
Nick -

Are you using the files in the wiki zip  or updated ones?

Is your USB stick getting mounted after a reboot, because mine isn't?

I presume you are using the device type description given by Chris around page 4, and not the one that still appears in the install wiki?

Thanks,
Chip

Offline nickrwym

  • Full Member
  • ***
  • Posts: 139
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #138 on: December 04, 2011, 10:04:17 am »
I had trouble finding the right files, some worked and some didn't. I ended up with some from the zip and some the code repositry I think but can't remember which were what.

The file sizes of the ones in Vera that work are

in /www/cmh/plugins/dataMine

flotr2.min.js   118,430

flotr2.ie.min  20,997

THose two draw the graphs

The other versions didn't want to work for me

The graphics files that go in there don't stop it working if they are wrong, they just don't look right without the,

Watch out when making the /dataMine directory from the root, there is a capital M in the middle and that matters

in /etc/cmh-ludl

I have the following, 5 are converted into .izo files in the process of being uploaded via the developer tab, 1 isn't and sometimes it gets converted with some builds of Vera and that stops it working. In that case use Win SSP to copy L_DataMine1.lua into the directory

D_DataMine1.json.lzo   939
D_DataMine1.xml.lzo  378
I_DataMine1.xml.lzo 516
J_DataMine1.js.lzo  6,520
L_DataMine1.lua  23,729  (not Izo)
S_DataMine1.xml.lzo  294

I havn't positively checked the USB stick but it's data light is flashing which is a good sign

I used the updated device type

Once it's working there are data files being written in /dataMine that you can see with ssp.

It is browser sensitive, it does not draw graphs in Safari, Chrome, IE6.

It works in Firefox, on an Ipad running IOS 5.01 and on an Iphone running IOS5.

It's an excellent program once you've got it right, well worth the effort.


I'm getting good data on the heating system that I set out to rebuild. Indoor temperature, outdoor temperature, and energy consumed are all being logged and can be easily graphed, I am now working on getting the controls right, I'm planning on pulse width modulating the heating at something like a 30 minute repeat rate with the on time varied between 5 mins on 25 off and on continuously in 5 minute increments. I am finding that outside temperature is a much better indicator of what duty cycle is needed than inside temperature and may well end up with some fairly empirical timings set by outside temperature and use the inside temperature just to validate the result, this will lead to a steadier inside temperature than letting the heating react directly to the inside temperature. The thermal time constant of the house and heating system is much slower than I expected. The rads are still full of hot water after the heat pump shuts off of course and it takes considerable time before it sinks

Early days but looking good so far, time to start writing Luua for a temperature control scene though so been reading into Luua.

Nick





Offline Chris

  • Moderator
  • Hero Member
  • *****
  • Posts: 821
  • Karma: +3/-0
Re: New dataMine graphing and logging plugin
« Reply #139 on: December 04, 2011, 11:43:05 am »
The files in the zip that you can download from the wiki should be fine - there shouldn't be any difference with the ones in the repository (at the moment). I will try and keep the ZIP file on the wiki up to date since it seems that downloading from the repository directly can lead to confusion...

Quote
I presume you are using the device type description given by Chris around page 4, and not the one that still appears in the install wiki?
I have updated the wiki with the extra commands required to get the USB stick to mount properly on startup after I found this wasn't working properly. I think this should be correct - if you think there's something missing, then please let me know and I'll fix it.

Offline Qrp

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #140 on: December 05, 2011, 09:45:58 pm »
I can't get graphs to draw. I've used the files in the current .zip file and the engine starts and seems to run. I can mount the USB stick to /dataMine, and the engine is populating it, but after a reboot that mount is gone, as though the custom-user-startup file is not being executed (though properties appear to be set right).

I can choose parameters to log in the config screen, but when I go to the graph tab I can see text but no icons and nothing will graph. Using Firefox 6.02.

Ideas?

Thanks




Offline Chris

  • Moderator
  • Hero Member
  • *****
  • Posts: 821
  • Karma: +3/-0
Re: New dataMine graphing and logging plugin
« Reply #141 on: December 06, 2011, 03:33:17 am »
I would say that the extra files that need to be in the "plugin" directory (i.e. all the PNG files, and the flotr.*.js files) aren't in the correct place. My reason for saying this is that in your screendump, the buttons at the top of the window don't show the icons and this would cause the problem that you're seeing.

Offline nickrwym

  • Full Member
  • ***
  • Posts: 139
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #142 on: December 06, 2011, 04:42:55 am »
Look out for the capital M in the middle of dataMine, it's needed in the directory name.

Nick

Offline Qrp

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #143 on: December 06, 2011, 11:19:37 am »
Still no joy. I've checked and double checked directory names and permissions, file locations and permissions, and made sure all files were from the latest zip.

The engine doesn't seem to be able to load the icon images in plugins, and the custom-user-startup file is not being executed. I can mount the USB stick to /dataMine manually, and the directory is populated, but on a reboot the association is gone again. And of course no graphing occurs.

It does seem that the plugins directory and the custom-user-startup are not being found and used by the engine, but I can't fathom why!

Offline Chris

  • Moderator
  • Hero Member
  • *****
  • Posts: 821
  • Karma: +3/-0
Re: New dataMine graphing and logging plugin
« Reply #144 on: December 06, 2011, 12:52:24 pm »
In WinSCP, can you click on the TERMINAL button, and run the following command -:
Code: [Select]
grep dataMine /tmp/log/cmh/LuaUPnP.log
This will give the dataMine log and might provide a pointer to what's going on. As Nick pointed out, in Linux, everything is case sensitive, so you need to be take care that nothing changes when you copy files over.

Note that I did find a number of things that stop the USB being remapped on startup - I've add the points to the wiki, but I think the extra commands required are
Code: [Select]
chmod +x /etc/init.d/custom-user-startup
/etc/init.d/custom-user-startup enable


Offline Qrp

  • Sr. Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #145 on: December 06, 2011, 10:18:27 pm »
Dataminer seems to be working fine now. There was a space at the end of /www/cmh/plugins/dataMine that was keeping the engine from finding the directory.

However, for some reason \etc\init.d\custom-user-startup is not being executed on reboot. I executed the chmod and enable commands that Chris specified, and they seemed to complete fine. I can execute the file manually from Telnet, and the USB stick will be mounted. But still no execution on a reboot.

What tells OpenWRT to execute this file on boot? Maybe something else is damaged?

Thanks,
Chip

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: New dataMine graphing and logging plugin
« Reply #146 on: December 07, 2011, 02:25:05 am »
...However, for some reason \etc\init.d\custom-user-startup is not being executed on reboot...

You need to ad a symbolic link to the custom-user-startup file in "/etc/rc.d": ln -s source_file link_name

So in our case using ssh to login to the vera execute the commands:
Code: [Select]
cd /etc/rc.d/
ln -s /etc/init.d/custom-user-startup S99custom-user-startup

At least that worked in my case and I had exactly the same problem like you when I tried to let a stick being mount on bootup for dataMine.
Maybe go in the directory /etc/rc.d and first see if you have anything there referring to /etc/init.d/custom-user-startup
« Last Edit: December 07, 2011, 02:27:19 am by chixxi »
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline ajlennon

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #147 on: December 07, 2011, 08:01:21 am »
Hi Chris,

I'm seeing some strangeness with the graphing (I think I have your latest code on there at present).

The day and week view is ok. The month view is wrong though.

I checked back through the data files for this channel and all the values look ok.

Any thoughts?

Thanks,

Alex

Offline willstar

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: New dataMine graphing and logging plugin
« Reply #148 on: December 07, 2011, 08:22:06 am »
Chris, another challenge for you to consider  ;)

Still get Startup LuA Failed message, have reloaded all files, etc - tried different versions of L_DataMine1.lua all to no avail. Checked the log, entry is below - can you throw any light on this at all please?

2/07/11 23:10:37.174   LuaInterface::CallFunction_Startup-1 device 21 function initialise failed error loading module 'L_DataMine1' from file '/etc/cmh-ludl/L_DataMine1.lua':
   /etc/cmh-ludl/L_DataMine1.lua:1: unexpected symbol near '<' <0x402>

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: New dataMine graphing and logging plugin
« Reply #149 on: December 07, 2011, 08:23:23 am »
I didn't realize till now, but I can actually confirm Data not showing correctly in Month view. And Data is available for complete month.
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.