Static IP EmonCMS Server - Still supported in the current code?

I am trying to use the latest code for EmonBase (located here https://github.com/openenergymonitor/NanodeRF/tree/master/NanodeRF_Power_RTCrelay_GLCDtemp) with a static, local server install of emonCMS. I belive I have corrected the lines in the code as per the comments to make this work with a static server install, however I cannot get it to post.

Does anyone have any recent experence with the Static IP parts of this code? Is it still supported?

 

Kind Regards,

 

Mike Christiansen

Lloyd's picture

Re: Static IP EmonCMS Server - Still supported in the current code?

I did an install of this this week. The instructions were not as clear as they could be, but I had it posting. If I fire my Pc later I'll try and post the changes I made.

 

Lloyd

Lloyd's picture

Re: Static IP EmonCMS Server - Still supported in the current code?

The changes are in two places. First in NanodeRF_Power_RTCrelay_GLCDtemp , in the Ethernet section:

 

//Domain name of remote webserver - leave blank if posting to IP address 
char website[] PROGMEM = "";
static byte hisip[] = { 192,168,98,10 };    // un-comment for posting to static IP server (no domain name)        
 
    You also need to ensure that you have set up the connection string to point to your correct website location, and used your apikey
 
    ether.browseUrl(PSTR("/emoncms/api/post?apikey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&json="),str.buf, website, my_callback);
 
And then in dhcp_dns (note that this file should be open in arduino, if you have already opened the main sketch - look at the tabs at the top of the code window - this caught me out as a beginner):

 

    if (dhcp_status){                          // on success print out ip's
      ether.printIp("IP:  ", ether.myip);
      ether.printIp("GW:  ", ether.gwip);  
      
     // static byte dnsip[] = {8,8,8,8};  
     // ether.copyIp(ether.dnsip, dnsip);
      ether.printIp("DNS: ", ether.dnsip);
      ether.copyIp(ether.hisip, hisip);                             // un-comment for posting to static IP server (no domain name)
      dns_status = 1;                                               // un-comment for posting to static IP server (no domain name)            
    } else { ethernet_error = 1; }  
 
Hope this helps
 
Lloyd
nz.mike.christiansen's picture

Re: Static IP EmonCMS Server - Still supported in the current code?

Thanks so much Liod! Ill give that a go when im home from work.

Thanks Again.

 

Kind  Regards,

 

Mike Christiansen.

PeterN's picture

Re: Static IP EmonCMS Server - Still supported in the current code?

I am trying to use the latest code for EmonBase (located here https://github.com/openenergymonitor/NanodeRF/tree/master/NanodeRF_Power_RTCrelay_GLCDtemp) with Domain name on remote webserver. I'm getting 'dhcp_dns' not declared when I try to upload to nanoderf . You seem to be answering this issues above but I can't see any dhcp.dns tab in sketch window, how do I fix (newbee ).

Thank

Peter

Lloyd's picture

Re: Static IP EmonCMS Server - Still supported in the current code?

I'm not an expert but....

You should have a folder (called NanodeRF_Power_RTCrelay_GLCDtemp) which should contain three files ( NanodeRF_Power_RTCrelay_GLCDtemp.ino, dhcp_dns.ino and decode_reply.ino).  Opening the first of these in arduino 1.0 should open the other two automatically into additional tabs.

Lloyd

Comment viewing options

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