cannot connect to database, what am i missing..

 Hello people,

 

i am having problems connecting the emonbase to my database. This are my specs:

i have a emonTx assembled and working. ( i know this because i also have a emonglcd and this gives the amount of Watt used on the power group)

I have a router that works with dhcp. And this are the things i have programmed in my emonbase.

* I have changed the mac adress ones (no changes)
* byte Ethernet::buffer[700];
* static uint32_t timer;
* char website[] PROGMEM = "http://mydyndns website/emoncms"; (emoncms is the directory on my QNAPnas where emoncms is in.)
* ether.browseUrl(PSTR("http://***.dyndns.org/emoncms/api/post?apikey=myAPIwrite key&json="),str.buf, website, my_callback);
 

and in the Tab DHCP_DNS is did this:

 
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; }  
 
 
these are the changes i made in the arduino sketch, nothing more.....
I added in the settings.php (found in emoncms/include) the username, databasename etc from the myphpadmin database.
 
what am i doing wrong.....
 
i am strugling with this for about 3 weeks now...and cannot figure it out. I tryed so many things that i lost track of it all and do not know what to do anymore.
 
hope you can help me.
 
Iwan
 

 

TrystanLea's picture

Re: cannot connect to database, what am i missing..

Hello Iwan

Sorry that this has been giving you so much trouble, I can imagine its really frustrating.

When you type in "http://***.dyndns.org/emoncms/api/post?apikey=myAPIwrite key&json={power:100} directly into your browser does the input: power register? Do you see it in the input list?

The line: 

char website[] PROGMEM = "http://mydyndns website/emoncms";

needs to be of the format

char website[] PROGMEM = "mydyndnswebsite.com";

No http and no folder information.

ether.browseUrl(PSTR("http://***.dyndns.org/emoncms/api/post?apikey=myAPIwrite key&json=")

needs to be:

ether.browseUrl(PSTR("/emoncms/api/post?apikey=myAPIwrite key&json=")

Let me know what gets printed to the serial window on the nanodeRF

nawikre's picture

Re: cannot connect to database, what am i missing..

 thanks for your response.....

i have tryed to correct the 2 lines AND i pasted the link incl my API key etc directly in my browser, but it only says...OK in my emoncms screen.

The red light on my emonbase is still shining.....

what can i do????i really do not know what i need to do now. I thout this would be a piece of cake....

 

*edit* i can see the {100} in my input screen.

TrystanLea's picture

Re: cannot connect to database, what am i missing..

Ok I have an idea, could you email me or PM me with yourdyndns website and I can try to send data to it from a nanode here to try and narrow things down a bit? trystan.lea at openenergymonitor.org

nawikre's picture

Re: cannot connect to database, what am i missing..

 sent you an email with the data.

 

Iwan

Comment viewing options

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