Blank realtime graph when not logged in

I'm using Emoncms V8.2.6 on a Raspberry with an HDD.

I discovered this weekend that the realtime graph are only visible if I'm logged in. When I use the link http://ipserver/emoncms/user/ the realtime graph are blank. When I'm logged in the realtime graph are not blank.

The concerned feeds are public and they can be displayed with another visualization method. Am I the only one in this situation? Is there a workaround to solve this issue?

Olivier

dapres's picture

Re: Blank realtime graph when not logged in

I've exactly the same issue on the same version of emoncms running on public linux server.

Dario

Olivier's picture

Re: Blank realtime graph when not logged in

Hello,

When not logged in if I use the Debug console of my internet browser, I see this:
GET http://ipserver/emoncms/feed/timevalue.json [HTTP/1.1 200 OK 4287ms]
TypeError: data[(data.length - 1)] is undefined

It seems to be link to this function from the realtime.php file:
    function getdp()
    {
     var result = {};
      $.ajax({ url: path+"feed/timevalue.json", data: "id="+feedid, dataType: 'json', async: false, success: function(datain) {result = datain;} });

      var timestamp = new Date;
     
      if (data[data.length-1][0]!=result.time*1000) {
        data.push([result.time*1000,parseFloat(result.value)]);
      }
           
      if (data[1][0]<(start-20)) data.splice(0, 1);
    }

If I'm logged in I haven't got this error.

 

Olivier

xmasta's picture

Re: Blank realtime graph when not logged in

The same issue has been up for months on the live emoncms.org build imho. I've been waiting for a long time for this to be fixed, thought it is so exposed that it gets fixed soon but guys on the other end must be real busy with other stuff.

I reported this issue on another thread too: http://openenergymonitor.org/emon/node/4907

with pictures.

Visualization for realtime graphs only happens when logged in, tried making new feed on a new dashboard too, still doesnt show if not logged in. All public feeds. my emoncms username is gelisob - if it's a userbased problem that needs to be sorted out case by case.. sorry for the trouble and thanks for taking time for it, if it is!

tgmaxx's picture

Re: Blank realtime graph when not logged in

I see the same issue in 8.3.2 with Realtime graphs displaying when logged in and not displaying when logged out.

I am using MySQL for my feed logging and using Chrome on Win7.

 

Paul Reed's picture

Re: Blank realtime graph when not logged in

It works fine for me on v8.3.1, and I can see the realtime graphs via http://mydomain/emoncms/username OK.

There is a issue with the dashboard graphs, where the dashboard records the graph url at the time that the graph is created.

This means that if you add a graph to a dashboard whilst accessing your site via Localhost or your private IP address, then that local url is saved within the dashboard, and the graph would be blank if you tried to access it via your domain name, or outside of your local network.

To check this, access your site via it's domain name , log in, and visit your dashboard, and select edit.
Select 'configure' one of your graphs and 'Save' it. This will ensure that the graph location is saved in your dashboard.
Now logout, and try to again access your dashboard via the same url you have used to configure/save, except add your username to the url. eg http://mydomain/emoncms/username and see if they then display OK.

Sorry if I havent explained this very clearly, let me know if not!

This issue bugged me for a while because when I accessed my dashboard via http://mydomain/emoncms/username I could see the graphs, BUT if my browser flipped the url to http://www.mydomain/emoncms/username (www added) then the graphs were blank.

 

Paul

tgmaxx's picture

Re: Blank realtime graph when not logged in

Paul,

Your idea doesn't work for me, so there must be a bug in the code. I still have the problem in V8.3.2

I know for sure this issue does not exist in V8.1.2.  Olivier noted it in V8.2.6 so it may have been introduced in 8.2 ?

Thanks,

Tom

 

Paul Reed's picture

Re: Blank realtime graph when not logged in

Hi Tom,

My installation is via git, so the files in theory should be the same. I'll PM you a link to my raspberry pi.

Paul

boelle's picture

Re: Blank realtime graph when not logged in

not to cross post to much but just tried the edit and save... did not work

 

graphs work only if i use local ip

boelle's picture

Re: Blank realtime graph when not logged in

of course the feeds has to be public too.... dooh :-D

littlepanda's picture

Re: Blank realtime graph when not logged in

Hi everyone,

I'm new to emoncms and created a dashboard, public, with all public feeds, on emoncms.org.

The dashboard is working fine except for the realtime graph which is blank. I'm not seing an answer on this thread on how to fix this.

Thanks for your help, and happy emoncms ! what a great tool !

nicolas's picture

Re: Blank realtime graph when not logged in

Hello,

Have the same problem on 8.3.2, I do all my test on my local network, url is alway the same...

Someone have a fix for that ?

Thanks !

evandro's picture

Re: Blank realtime graph when not logged in

The problem is where the browser calls /emoncms/feed/data.json?&apikey=&id=10&start=1440272310278&end=1440272670318&dp=1000

the server responds without apikey=

You can fix that putting your READ ONLY key in the line 48 of /emoncms/Modules/vis/visualisations/realtime.php

Link that:

var apikey = "76XXXXXXXXXXXXXXXXXXXXXXXXXXXX29";   

 

It is a temporary fix, but works fine for me.

Comment viewing options

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