Trouble with EmonCMS graphing.

Hello from Norway :)

I tested emoncms3 for a week now with DS18B20 and DHT11 humidity sensors.

The Dashbard with dials and small graph's works great.

But the realtime,rawdata, and bargraph under feeds give me a blank page?

They work when i embed dem with iframe.

And they work like normal in emoncms2.

 

And the last problem is the Multigraph.

Changed the adress and the field with "your api". And added my sensors.

The window shows my sensors with color, but no data.

The scale on the side says -1.0 to 1.0.

Anybody know if i'm doing something wrong or what the problem might be?

 

Running on a XP machine with Xampp 1.7.7 and php 5.3.8.

 

I hope someone is able to help me out.

 

Andygodber's picture

Re: Trouble with EmonCMS graphing.

 Echnics - i have the same problems

Echnics's picture

Re: Trouble with EmonCMS graphing.

 I got the graph's under feeds working now.
I renamed the Vis folder to vis. The V in lower case is working.
But no luck with the Multigraph.

Anyone??

Andygodber's picture

Re: Trouble with EmonCMS graphing.

 Thanks Echnics - that worked for me - renaming the Vis directory to vis (lower case) under the XAMP directory.

gazza_ d's picture

Re: Trouble with EmonCMS graphing.

Done some digging and cracked the issue I had with the multigraph and the feeds are now being displayed in the multigraph correctly.

Line 127 in emoncms3/Vis/MultiGraph/multigraph.php needs changing to read

url: path+'../../feed/data.json',

This should hopefully work for you guys as well.

 

gazza_ d's picture

Re: Trouble with EmonCMS graphing.

OK, got a really easy question for you guys now

How do I move the feeds box to the right of the graph as shown on the examples on the dashboards page?

Echnics's picture

Re: Trouble with EmonCMS graphing.

 Hey gazza_d.

 

I tried to change the line 127 to  url: path+'../../feed/data.json',

But no luck. Could you show what that line use to say?

So i could be sure i change the right line?

Is the old line very diffrent from what you changed it to?

gazza_ d's picture

Re: Trouble with EmonCMS graphing.

It's multigraph.php, and the entire function which now works for me is copied below. I have put the line I changed in bold to make it easier to see.  The line beginning "data" has been truncated by my

   //-------------------------------------------------------------------------------
   // Get feed data
   //-------------------------------------------------------------------------------
   function getDataLOD(feedID,start,end,resolution)
   {
     var feedIn = [];

     $.ajax({
            url: path+'../../feed/data.json',
            data: "&apikey="+apikey+"&id="+feedID+"&start="+start+"&end="+end+"&res="+resolution, 
       dataType: 'json',
       async: false,
       success: function(datain) { feedIn = datain;}
     });
     return feedIn;
   }

The original code is copied below for comparision

//-------------------------------------------------------------------------------
// Get feed data
//-------------------------------------------------------------------------------
function getDataLOD(feedID,start,end,resolution)
{
var feedIn = [];
 
$.ajax({
url: path+'api/getfeed',
data: "&apikey="+apikey+"&feedid="+feedID+"&start="+start+"&end="+end+"&resolution="+resolution,
dataType: 'json',
async: false,
success: function(datain) { feedIn = datain;}
});
return feedIn;
}

 

Andygodber's picture

Re: Trouble with EmonCMS graphing.

 Echnics - with thanks to Gary who sent me his entire code, I noticed that the path (about line 15) was set to null ("") in his version.

Having follwed the posted instructions, I had actually coded the real path name. By removing it, my multigraph now works.

Please give that ago, and let us know, in case there were other changes I didnt see.

 

Echnics's picture

Re: Trouble with EmonCMS graphing.

Thanks to Gazza_D i got i working by changing the Get Feed part with this:

// Get feed data
//-------------------------------------------------------------------------------
function getDataLOD(feedID,start,end,resolution)
{
var feedIn = [];
 
$.ajax({
url: path+'api/getfeed',
data: "&apikey="+apikey+"&feedid="+feedID+"&start="+start+"&end="+end+"&resolution="+resolution,
dataType: 'json',
async: false,
success: function(datain) { feedIn = datain;}
});
return feedIn;

 

Had to change the lines starting with url: and data:.

URL line Gazza said: url: path+'../../feed/data.json',
But i got it working when i changed that to url: path+'../feed/data.json',

The difference in the line starting with data: that i can see is:
&feedid="+feedID+"
to 
&id="+feedID+"

This is what i did to get it working.

Did you change these things Andygodber?
And could you explain what you did with the path around line 15?

Larsjo's picture

Re: Trouble with EmonCMS graphing.

 I give op on this, tried everything from above, no luck. Just a blank page. :-(

 

Echnics's picture

Re: Trouble with EmonCMS graphing.

 Hey Larsjo.

I just tested mine from my dad's computer. Win 7.
No luck in internet explorer, but in chrome it works.
And tested an old laptop now, no luck in an older version of internet explorer either.
Have you tried Chrome or Firefox?

The first thing i found out, is that the path in line 12 needs to be:

http://192.168.77.6:81/emoncms3/vis/

Not: http://192.168.77.6:81/emoncms3/

When i remove the /vis/ from the end, all i get is the buttons and a grey bar.
Thats the same in any browser.
You have added your API read key. i didn't see that in the instructions.
Hope this could get you closer :)

Does anybody have this working in internet explorer?

Larsjo's picture

Re: Trouble with EmonCMS graphing.

Chrom is my standart browser, but gess that the path is worng. will try it out asp.

Thanks for the hints..will be back with more info.

Still no go.

dont even get the nav. buttons, just blank page.

________________________________________________________________________________________________

  <?php $path = "juelsminde.org/sol/Vis/"; ?>

 

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <script language="javascript" type="text/javascript" src="<?php echo $path; ?>flot/jquery.js"></script>

    <script language="javascript" type="text/javascript" src="<?php echo $path; ?>flot/jquery.flot.js"></script>

_________________________________________________________________________________________________

 Cant see what should be wrong with this path. Its the one i see with ftp access.

 

http://juelsminde.org/solceller/

Larsjo's picture

Re: Trouble with EmonCMS graphing.

 FINALY got it working..

alot of copy and paste, and i got the path and graph working.

Here are the parts:

_______________________________________________________________________________

line 11-->

$apikey = $_GET['apikey'];
?>

_______________________________________________________________________________

Then you just put you apikey in the url. And the url is taken form you server.

// API key

var apikey = ""; //set the apikey

_______________________________________________________________________________

$.ajax({

url: path+"feed/data.json",

data: "&apikey="+apikey+"&id="+feedID+"&start="+start+"&end="+end+"&res="+resolution,

dataType: 'json',

async: false,

________________________________________________________________________________

http://juelsminde.org/solceller

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.