localhost emoncms ---- RESOLVED

Hi all,

I've loaded XAMPP on my WindowXP machine, I can access emoncms with http://localhost/EnergyMonitor/dashboard/view, but what do I change in the NanodeRF_Power_RTCrelay_GLCDtemp? This is how I have it and I have tried various combinations

   //Domain name of remote webserver - leave blank if posting to IP address
char website[] PROGMEM = "";
static byte hisip[] = { 192,168,1,104 };
    // un-comment for posting to static IP server (no domain name)            
 

I have tried without the hisip, with it, making the website localhost, putting the ip address in the website etc

 

Serial.print("2 "); Serial.println(str.buf); // print to serial json string

    // Example of posting to emoncms v3 demo account goto http://vis.openenergymonitor.org/emoncms3
    // and login with sandbox:sandbox
    // To point to your account just enter your WRITE APIKEY
    ethernet_requests ++;
    ether.browseUrl(PSTR("/EnergyMonitor/api/post?apikey=3032a682d72a21d78331df0a965d2b01&json="),str.buf, website, my_callback);
    data_ready =0;
  }
 
  if (ethernet_requests > 10) delay(10000); // Reset the nanode if more than 10 request attempts have been tried without a reply

}

The above is where the local emoncms is installed

F:\xampp\htdocs\EnergyMonitor and I can access it with http://localhost/EnergyMonitor

Uploading to http://vis.openenergymonitor.org works a treat, but just not to localhost......

Any help will be appreciated please!

hopslink's picture

Re: localhost emoncms ---- RESOLVED

Hi,

From the comments in the code It looks like you should specify the IP address of your server in the IP (hisip) field line and leave the first line as it was:

char website[] PROGMEM = "";
static byte hisip[] = { XXX,XXX,XXX,XXX };
    // un-comment for posting to static IP server (no domain name)   

Where XXX... is the IP address of your emoncms server computer on your network - typically 192.168.X.X.

localhost = 'this machine' and is only used when software is accessing another service on the same computer i.e. using the browser on your server computer to look at the emoncms web pages.

Robert Wall's picture

Re: localhost emoncms ---- RESOLVED

I have exactly the same problem with WampServer (also Windows XP). Unfortunately, I don't know enough about LANs to offer any help.

esawyja's picture

Re: localhost emoncms ---- RESOLVED

I can't get it to work, http://localhost/emoncms3 works fine, but the NanodeRF does not want to post to the local webserver, I'm starting to think that it might be a windows XP problem? Has anyone got a local webserver working on windows XP?

[webClient]
DHCP status: 1
IP:  192.168.1.107
GW:  192.168.1.254
DNS: 8.8.8.8
DNS status: 0
2 {rf_fail:1}
DNS status: 0

1 emontx packet rx2 {rf_fail:0,power1:34,power2:25,power3:0,voltage:3293}
DNS status: 0
2 {rf_fail:1}
DNS status: 0
2 {rf_fail:1}

Various combinantions of this below was tried

//Domain name of remote webserver - leave blank if posting to IP address
//char website[] PROGMEM = "vis.openenergymonitor.org";

//char website[] PROGMEM = "localhost";
char website[] PROGMEM = "";
static byte hisip[] = { 127,0,0,1 }; // un-comment for posting to static IP server (no domain name)
//static byte hisip[] = { 192,168,1,128 }; // un-comment for posting to static IP server (no domain name)

 

ether.browseUrl(PSTR("/emoncms3/api/post.json?apikey=xxxxxxx&json="),str.buf, website, my_callback);
 

Help please!!

Drsdre's picture

Re: localhost emoncms ---- RESOLVED

First try to access emoncms3 from a seperate computer, other then where the webserver it is running on.

To figure out the IP address of your webserver in windows: open start menu, enter ' cmd' in the Search programs box. Once ther terminal appears enter 'ipconfig'. There should be an entry 'Ethernet adapter Local Area Network'. The IPv4 address is the IP address of your webserver.

Check with the other computer if you can open emoncms3 in a web browser (http://<IPv$ address>/emoncms3). Once you can confirm this, you are ready to setup the emonbase config (website[] PROGMEN parameter) with the same URL.

EnergyRnR's picture

Re: localhost emoncms ---- RESOLVED

Seems we have the same issue: http://openenergymonitor.org/emon/node/645 though you've used a more appropriate title:-)

I've tried changing usernames/passwords this morning.

I've set the username to root and gave it a password. Note; to do this I had to edit the phpmyadmin config.inc.php file ; otherwise it won't let you back in! set the password in that file and we realy should also set 'AllowNoPassword' to false..

Having tried that - it still didn't work. Now I'm going to use root, without a password, and then I'll try a NULL password......

Check the apache/mysql logs and post what you find [latest line ]. What have you called your db? I think we should exactly mimic the db names and config used by Trystan at vis.openenergymonitor.org in case we're breaking something. However, it's most likely an XP/Xampp specific issue.

Eamonn

 

vworp's picture

Re: localhost emoncms ---- RESOLVED

I think I have this same problem too.

Emoncms is installed on a windows XP sp3 machine. Emonbase can post to vis.openenergymonitor.org, but, whenever I update the sketch to use a local server, I get an rf error

 

[webClient]
DHCP status: 1
IP:  192.168.1.6
GW:  192.168.1.1
DNS: 8.8.8.8
DNS status: 0
2 {rf_fail:1}
 

Larsjo's picture

Re: localhost emoncms ---- RESOLVED

did you try to browse to your local webserver.

Try to put http://yourserveripadr  in your adr line and see what shows up.

Just to make shure you can connect to the server on your local network.

 

vworp's picture

Re: localhost emoncms ---- RESOLVED

Yes, I can browse to emoncms on my local sever using it's IP address.

esawyja's picture

Re: localhost emoncms ---- RESOLVED

Yep I give up on this, I can even get into emoncms3 from my phone, when connected to the wireless network at home, the sketch is setup like this below

//Domain name of remote webserver - leave blank if posting to IP address
char website[] PROGMEM = "";
//char website[] PROGMEM = "vis.openenergymonitor.org";
//static byte hisip[] = { 213,138,101,177 }; // un-comment for posting to static IP server (no domain name)
static byte hisip[] = { 192,168,1,103 }; // un-comment for posting to static IP server (no domain name)
   

ethernet_requests ++;
    ether.browseUrl(PSTR("/emoncms3/api/post.json?apikey=b33c8f874e5458c5389bee6c29e93268&json="),str.buf, website, my_callback);
    data_ready =0;

I can post using this below from a browser locally

http://192.168.1.103/emoncms3/api/post.json?apikey=b33c8f874e5458c5389bee6c29e93268&json={power:777.4,temperature:99.4}

I can surf to the emoncms3 using my phone with http://192.168.1.103/emoncms

but the NanodeRF does not want to post......

[webClient]
DHCP status: 1
IP:  192.168.1.106
GW:  192.168.1.254
DNS: 8.8.8.8
DNS status: 0
2 {rf_fail:1}
DNS status: 0
2 {rf_fail:1}
DNS status: 0
2 {rf_fail:1}
DNS status: 0
2 {rf_fail:1}
DNS status: 0
 

esawyja's picture

Re: localhost emoncms ---- RESOLVED

oooooh yea, got it to work

In the dhcp_dns sketch, uncomment the following lines

      ether.copyIp(ether.hisip, hisip);                           
      dns_status = 1;                                              
 

and this is the way I got it setup in the main sketch NanodeRF_Power_RTCrelay_GLCDtemp

//Domain name of remote webserver - leave blank if posting to IP address
char website[] PROGMEM = "";
static byte hisip[] = { 192,168,1,103 }; // un-comment for posting to static IP server (no domain name)
 

    ether.browseUrl(PSTR("/emoncms3/api/post.json?apikey=263739f2964234453b77b0d2522e6377&json="),str.buf, website, my_callback);
 

The monitor now reports

1 emontx packet rx2 {rf_fail:0,power1:0,power2:0,power3:0,voltage:0,temperature:22.87}
3 ok | Date: Sat, 12 May 2012 12:33:35 GMT

4 emonbase sent
5 emonglcd: 2287

1 emontx packet rx2 {rf_fail:0,power1:0,power2:0,power3:0,voltage:0,temperature:22.87}
3 ok | Date: Sat, 12 May 2012 12:33:42 GMT

4 emonbase sent
5 emonglcd: 2287
 

vworp's picture

Re: localhost emoncms ---- RESOLVED

Looks like that works for me too :) Is this a common enough problem to be added to the EmonBase setup steps at http://openenergymonitor.org/emon/applications/homeenergy ?

 

esawyja's picture

Re: localhost emoncms ---- RESOLVED

I would vote yes, it needs to be added, it is frustrating trying to find all the "problems" and if it helps someone else, it is worth it?

Robert Wall's picture

Re: localhost emoncms ---- RESOLVED

I have now got it working for WampServer.

I second the suggestion to make these notes permanent, and add:

a plea to a LAN expert: Can we have a full idiot's guide for people like me who know little about setting up a LAN and haven't got one already set up (and preferably 3 versions: Windows, Mac & Linux)?

Here are the three gotcha's that got me:
you need to make localhost, port 80 an exception in the Windows Firewall settings (or whatever your server name and port are),
you need to put WampServer online (OK, obvious but easily missed),
you need to connect direct to your router (i.e. plugging into the computer's ethernet port won't work)

For a reason that I haven't yet determined, the 'test' line from another machine works from a web browser with the URL "http://Bryn_Glas:80/openenegymonitor-emoncms .... etc" but it won't accept that in the sketch. ("Bryn_Glas" is the machine name of the computer hosting WampServer)

vworp's picture

Re: localhost emoncms ---- RESOLVED

I've taken the liberty of adding a step to http://openenergymonitor.org/emon/applications/homeenergy

EnergyRnR's picture

Re: localhost emoncms ---- RESOLVED

folks; I need to append :85 to the end of my Server IP Address to be able to browse to it from another machine. I've had to do this to avoid a port 80 conflict on the XP machine.

I need to point my BrowseURL to MyServerIP:85/emoncms3...............

I've tried the following in the sketch without success :

ether.browseUrl(PSTR(":85/emoncms3/api/post.json?apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&json="),str.buf, website, my_callback);

But can post data successfully using the following on a different machine using the address bar[ Chrome] :

http://MyServerIP:85/emoncms3/api/post.json?apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&json={power:50,temperature:13}

Anyone got ideas -do I need to hack my ports library to make 85 the default?

Eamonn

Comment viewing options

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