Is dnsLookup() method needed to upload data to cosm????

Is dnsLookup() method needed to upload data to cosm?? On running the code for dnsLookup() am getting failed replies as below

Client Demo
Setting up DHCP
My IP:
DNS failed

I ran the code from the page
In some forums i read about DDNS enabling in the router…Is it really needed ?? my router doesn’t have DDNS. is it possible to make the code work without enabling DDNS??? My ultimate aim is to upload some data to cosm…somebody pls guide me on this…Am using Enc28j60 ethernet shield…

altis: Is it really needed ??

I think the short answer is "no".

I don't understand any of the code in the link you mention but I do understand the date, and that is enough to make the lucadentella article suspect. I believe there was a substantial change to the way cosm works was made about the middle of last year. This involved the publication of new libraries, cosm and HttpClient, and the problems people have with cosm are invariably caused by not using them.

However, my not understanding the code may also be due it being specific to the enc28j60, rather than the WIZ5100 that nearly everybody uses with cosm. I'm not so sure if the new libraries and the simplified use of cosm applies to the enc28j60.

There has been some discussion in the last couple of weeks on the cosm forum about using the enc28j60. I believe it was successful, and you should try there. I don't think you need to worry about the router.

Thanks for checking on the code.Not just this code even the example code in the ethercard library for Enc28j60 to get DHCP and DNS also gives DNS failed result. That is the reason why i got a doubt on the router.

// This demo does web requests via DHCP and DNS lookup.
// 2011-07-05 <>

#include <EtherCard.h>

#define REQUEST_RATE 5000 // milliseconds

// ethernet interface mac address
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
// remote website name
char website[] PROGMEM = "";

byte Ethernet::buffer[700];
static long timer;

// called when the client request is complete
static void my_result_cb (byte status, word off, word len) {
  Serial.print("<<< reply ");
  Serial.print(millis() - timer);
  Serial.println(" ms");
  Serial.println((const char*) Ethernet::buffer + off);

void setup () {
  if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) 
    Serial.println( "Failed to access Ethernet controller");

  if (!ether.dhcpSetup())
    Serial.println("DHCP failed");
  ether.printIp("My IP: ", ether.myip);
  // ether.printIp("Netmask: ", ether.mymask);
  ether.printIp("GW IP: ", ether.gwip);
  ether.printIp("DNS IP: ", ether.dnsip);

  if (!ether.dnsLookup(website))
    Serial.println("DNS failed");
  ether.printIp("Server: ", ether.hisip);
  timer = - REQUEST_RATE; // start timing out right away

void loop () {
  if (millis() > timer + REQUEST_RATE) {
    timer = millis();
    Serial.println("\n>>> REQ");
    ether.browseUrl(PSTR("/foo/"), "bar", website, my_result_cb);

The below portion of the code is which fils to get DNS data…I tried the codes at my university campus.

 if (!ether.dnsLookup(website))
    Serial.println("DNS failed");
  ether.printIp("Server: ", ether.hisip);

So is there any changes to be done in the router even for W5100 ethernet shield to upload data to cosm??
Thanks for the tip on the cosm forum on enc28j60. I will check on that…

Try a different DNS server - google’s perhaps:

altis: So is there any changes to be done in the router even for W5100 ethernet shield to upload data to cosm??

No. The only time that I am aware of where you need to fiddle with the modem is where you do NOT want distribute your data through cosm but want to have your own computer directly accessible instead. This is called port forwarding, but I don't know anything about it.

Since you ask the question and if you have half a mind to change to W5100, I suggest you go for it and eBay the ENC, thereby enabling you to march behind the same band as most everybody else. If you do this, make sure you get the latest libraries cosm and Httpclient, and also make sure you ignore all information on cosm that is more than six months old.

Note that there are other Internet of Things services. I don't think they are any better than cosm, but they may be more appropriate for use with the ENC28J60. I understand cosm is specifically designed for the Arduino + W5100.

Thanks for the tip on the cosm forum on enc28j60. I will check on that...

Note the "It Works!" section of the cosm forum. There you will find a wealth of examples, including one of mine(!)..

Thanks Nick and Wildbill... :) :)the code worked when i connected in a diferent LAN setup.The network at campus uses opendns...that might be the reason..Thats d only difference from the present setup..