pi webserver not displaying graphs over wan

I have noticed that when at home I can see all of my dashboard, feeds, inputs, vis the works.

But when at work or over the www and looking at my pi server. I get the results in the picture, I have tried all of the "popular" browsers, with the same results. The pi is a new revb 512mb over clocked attached to the breakout board.

I also notice only one feed on emoncms.org is working but both inputs are being received, there may be no correlation between the two issues but it's worth mentioning.

What is the best way to start debugging the problem please.

 

 

 

ukmoose's picture

Re: pi webserver not displaying graphs over wan

When you say "I get the results in the picture" did you mean to attach something?

fluppie007's picture

Re: pi webserver not displaying graphs over wan

I recognize this. This is because the graphs are referring to the local IP address and not to your dynamic DNS name. At the moment I check my graphs through a RDP/VNC session.

For me forwarding doesn't work. It says "authentication succesful" but won't display my inputs and/or feeds. Checked it with the emonCMS.org server and my own 'remote' emonCMS server on a Ubuntu 12 virtual machine.

carlvk's picture

Re: pi webserver not displaying graphs over wan

I could VNC in if that is the solution.

why do the dials show and not the graphs?

 

Still no picture?

https://www.dropbox.com/s/kib0yvnf10i3fhd/home%20dashboard.jpg

 

 

 

fluppie007's picture

Re: pi webserver not displaying graphs over wan

Did you change de IP of the Pi? Or maybe your DHCP server gave a new IP to the Pi?

stephen's picture

Re: pi webserver not displaying graphs over wan

The problem here is that the graphs are included in the output with an iframe:

<iframe scrolling="no" frameborder="0" src="http://192.168.0.30/emoncms/vis/rawdata?apikey=?????????&embed=1&feedid=1&fill=&units=W" marginwidth="0" marginheight="0" style="width: 680px; height: 260px;">

The src attribute needs to be a relative path, not absolute. This works:

<iframe scrolling="no" frameborder="0" src="/emoncms/vis/rawdata?apikey=?????????&embed=1&feedid=1&fill=&units=W" marginwidth="0" marginheight="0" style="width: 680px; height: 260px;">

You can test this if you have something like firebug which lets you change the html.  I haven't yet found where in the code this attribute is set but perhaps Trystan could give us a clue.

carlvk's picture

Re: pi webserver not displaying graphs over wan

The pi has a reserved IP  so I'm not sure that's it

stephen's picture

Re: pi webserver not displaying graphs over wan

The image you have provided shows an IP address of 192.168.1.17.  That's the address of your Raspberry Pi on your local network.  It's not the address you use to access the Raspberry Pi over the internet.  The 192.168.x.x range is reserved for private networks and isn't accessible over the internet.  So your browser loads the main page and then tries to fill in the iframes.  It can't do that because the IP address in the iframe src attribute provided by emoncms isn't accessible over the internet.  As I said, a relative src attribute will work.

carlvk's picture

Re: pi webserver not displaying graphs over wan

Thank you Stephen, I understand what you are saying but not how to fix it. i should have linked my previous post to Fluppie's post.

I do appreciate you taking time to look at this. Is it just my set up or is it a general code issue?

stephen's picture

Re: pi webserver not displaying graphs over wan

The fix is in emoncms.  I think it will be easy to do when I've found the right line of code.  Just need some spare time, or a clue from Trystan.

 

stephen's picture

Re: pi webserver not displaying graphs over wan

Well, I've found the problem but the solution isn't easy.  The variable storing the path is used throughout the code and fixing one bit breaks others.

There are a couple of work arounds you can do:

The visualisation is saved in the database in the dashboard table.  The content column contains all the html used for the display so you can change the src attribute to a relative path there (remove the http://nn.nn.nn.nn bit before /emoncms/vis/...).  You'll need phpmyadmin or to write some code to do that. Awkward but once done your dashboard will work anywhere.

or

Create the dashboard from the location you want to view it.  If you want to view it at home and remotely you'll need to create two dashboards, one for each location.  Nasty.

 

carlvk's picture

Re: pi webserver not displaying graphs over wan

Thanks for looking into this Stephen.

If I could reliably upload stuff to emoncms.org I would use that

I will look at running two versions for now.

Can this be added to the bug list for the next version please?

Comment viewing options

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