Almost there... DNS problem

Hi,

the last couple of weeks I have been struggling to get my Emontx V2 and NanodeRF up and running. I think I'm almost there, but I'm dealing with this issue:

I connected everything to the laptop and uploaded the Emontx V2 with the emonTx_CT123 sketch and the NanodeRF with the NanodeRF_multinode sketch. I changed the APIkey to my personal one. When I try both through www.emoncms.org and through http://localhost/emoncms, I am getting this result:

[webClient]
DHCP status: 1
IP:  192.168.1.56
GW:  192.168.1.254
DNS: 8.8.8.8
DNS status: 0
Data sent: /api/post.json?apikey=???????????????????????????????&json={rf_fail:1}
Time request sent
DNS status: 0
Data sent: /api/post.json?apikey=???????????????????????????????&node=15&csv=0,0,0,3303
DNS status: 0
Data sent: /api/post.json?apikey=???????????????????????????????&json={rf_fail:1}
Time request sent
DNS status: 0
Data sent: /api/post.json?apikey=???????????????????????????????&node=15&csv=0,0,0,3303
DNS status: 0
Data sent: /api/post.json?apikey=???????????????????????????????&json={rf_fail:1}
Time request sent
DNS status: 0
Data sent: /api/post.json?apikey=???????????????????????????????&json={rf_fail:1}
DNS status: 0
Data sent: /api/post.json?apikey=???????????????????????????????&node=15&csv=0,0,0,3303
Time request sent
DNS status: 0

I tried to find the answer in the forum, but I didn't find it. Can someone help me please? I'm really eager to get this up and running to monitor my own built wind generator!

Thanks in advance!

Thijs

ukmoose's picture

Re: Almost there... DNS problem

Can you explain what you mean by I connected everything to the laptop?

Is there still a wired ethernet connection from your NanodeRf to your router? 

It appears to be failing as it cannot find the DNS server and therefore it can't find the IP address of the server you want to send data to.

One thing to try is to change the DNS server address from googles, to the IP of your gateway (192.168.1.254) your router/modem will also have a DNS address configured in it so it should find the ip address of the emoncms server.

 

 

Thijs's picture

Re: Almost there... DNS problem

Hi ukmoose,

 

Thanks for replying. I mend with connected to the laptop, the moment I uploaded the software. Now it is both the nanode and the emontx are connected to the electricity grid. And I check with the UART cable connected to the laptop what the outgoing data of the NanodeRF is.

I tried what you suggested by following the steps from this site. But unfortunately it didn't help. Or do you mean something else?

Thijs

Thijs's picture

Re: Almost there... DNS problem

Does anybody have another solution that could help me?

Kind regards, Thijs

EnergyRnR's picture

Re: Almost there... DNS problem

I think he means that in the NanodeRF sketch , you should set the DNS IP address as follows ( in the dhcp_dns() function)

static byte dnsip[] = {8,8,8,8};

Can you confirm what sketch you are using?

Is it https://github.com/openenergymonitor/NanodeRF/tree/master/NanodeRF_multinode ?

Eamonn

Thijs's picture

Re: Almost there... DNS problem

Hi Eamonn,

Yes, it is the NanodeRF_multinode.

I'll give it a try like you said.

Thijs

Thijs's picture

Re: Almost there... DNS problem

Ok, I tried it like this, without any positive result:

I put your code right under this part:

dhcp_dns();   // handle dhcp and dns setup - see dhcp_dns tab

So it is now like this:

dhcp_dns();   // handle dhcp and dns setup - see dhcp_dns tab
  static byte dnsip[] = {8,8,8,8};

Is this the right way? I'm sorry. I'm an absolute noob. :-)

Thijs

Robert Wall's picture

Re: Almost there... DNS problem

Take a look at this.

Thijs's picture

Re: Almost there... DNS problem

unfortunately I already looked into this and followed every step very accurate. It gets stuck at the DNS status:

[webClient]
DHCP status: 1
IP:  192.168.1.56
GW:  192.168.1.254
DNS: 8.8.8.8
DNS status: 0

Robert Wall's picture

Re: Almost there... DNS problem

I didn't write the sketch initially nor am I an expert on the Ethercard library, however I think that says the DNS information is not coming back from the server. So I think you need to either find out what is blocking it, or use some other DNS server (your ISP's?), or not use DNS and use instead fixed IP addresses.

You will need to read up on the Ethercard library if you want to change the default DNS setting.

Thijs's picture

Re: Almost there... DNS problem

I'm sorry. I tried in different ways to solve this. I checked how see what is blocking it and play around with the ethercard library. But I just do not have enough programming skills to see where the problem is at.

I also tried nanodeRF_multinode_static_IP sketch, but with no results. Supposedly everything works as should work, do I only have to fill in the IP address at this place in the sketch?:

// or if your posting to a static IP server, change to true if you would like the sketch to post to static IP (not sure if this is working..)
boolean use_hisip = true; 
static byte hisip[] = { 213,138,101,177}; //emoncms.org IP

And do I need to get this IP from the emoncms.org site right under my IP? If so, that doesn't work either.

Is there somebody who can guide me step by step and check with me where it goes wrong?

Thank you!

Thijs

Robert Wall's picture

Re: Almost there... DNS problem

I think the problem is with your router or with your Internet connection somewhere. Attach the exact sketch that you are using to a post and I will try it on my NanodeRF.

(Send your Read and Write APIkey in a PM.)

Thijs's picture

Re: Almost there... DNS problem

Thank you very much Robert. Hereby the sketch I'm using.

Kind regards,

Thijs

 

glyn.hudson's picture

Re: Almost there... DNS problem

I have has the same problem (no DNS) using the current multinode sketch from the OpenEnergyMonitor github and the latest EtherCard from JCW github. 

Thanks to Robert Wall we have traced the problem back to some recent updates to the Ethercard library which seem to have broken our multinode sketch DNS functionality. I am not sure what this issue is, we think it might be something to do with the library and overall multinode sketch getting too big for the ATmega328's memory.  Luckily Robert had an older copy of the EtherCard library (Oct 2012) to hand which works just fine with multinode sketch for me (it now gets DNS). 

I've uploaded this older snapshot of the Ethercard library to the OpenEnergyMonitor github: https://github.com/openenergymonitor/EtherCardOct2012

Please let us know if using this older snapshot works for you. 

stureid's picture

Re: Almost there... DNS problem

Hi, I was having this issue today and found this thread. I've used the older ethercard snapshot and confirm that it has fixed it.

Many thanks

Stuart

christophe_meyers's picture

Re: Almost there... DNS problem

Sorry for only seeing this topic now, but I was able to fix this using the newest Ethercard library when posting from a Nanode RF. I was using the emonTXShield/Shield_CT1234_Voltage_NanodeRF sketch in my setup, but same logic applies for the multinode sketch in question (I tested and can confirm it works).

The changes are as follows:

  • ' char website[] PROGMEM = "" ' must start with 'const'
  • adequately set (static IP local server (local), else website[] parameter for posting over Internet)
    boolean use_hisip = false;
    static byte hisip[] = {}; //set IP address here

  • check format of JSON posting matches what Emoncms expects as incoming format

As mentioned I got the multinode sketch to successfully post to my Emoncms server, so if there are problems it can be due to other network/router problems. Curious to hear if this allows using the new Ethercard library.

Comment viewing options

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