If I may ask for advice,

I am using the EtherCard library on my NaNode and I want to build customizable settings thru HTTP web site on the nanode itself. One of the settings is user configurable NTP server (as a site, not IP).

It turns out that the EtherCard ether.dnsLookup fuction expects a progmem string.. so I can't just lookup an EEPROM saved configuration for NTP server.

Is there any way to work around this?

Thanks

mharizanov's picture

 ok, I figured it out. I had

 ok, I figured it out.

I had to modify the EtherCard library, dns.cpp so it takes regular char* instead of progmem. 

 

 

 

glyn.hudson's picture

 This sounds interesting,

 This sounds interesting, please post up an example when you get it working. 

 

mharizanov's picture

This whole project is about a

This whole project is about a NaNode controlling my Daikin air conditioner via IR codes (I decoded the protocol). 

As for the EtherCard modifications, quite simple indeed:

Just edit dns.cpp and modify the line:

 

//static void dnsRequest (const prog_char *progmem_hostname) {

static void dnsRequest (char  *hostname) {
 
...............................

 

    for(;;) {

      // originally  c = pgm_read_byte(progmem_hostname++);

      c = *hostname++;

      if (c == '.' || c == 0)

 

........

//bool EtherCard::dnsLookup (prog_char* name) {

bool EtherCard::dnsLookup (char* name) {

 

 

and of course modify the EtherCard.h

static bool dnsLookup (char* name);

 

Here is a glance of the UI, I use jquery mobile and it is optimized for use via phone.

 

 

My nanode finds its external IP and publishes it to DynDNS (still no UI, this is my next  todo).

I have also implemented Basic HTTP authentication security scheme so if someone accidentally lands on the page, he doesn't mess with my Air Conditioner

 Please don't ask for the code, I intend to sell these gadgets in the future.