Nanode 5 will NOT post to Emoncms?

Hi guys so I've been trying for a solid while now, but my nanode will for whatever reason not post data to emoncms on my raspberry pi. I did the install of emoncms word for word, with the guide, and am trying to run the Nanode_PowerRelay sketch in order to just simplify the posting of data. (theres 1 ct sensor) The nanode takes in information by way of a rfm12b breakout board, ethernet cable goes to a router (is there something special that needs to be done here?) and the raspberry pi is connected aswell to that router. The raspberry pi hs been given a static IP on that network, and it is not connected to the internet. I want the raspberry to act as a local host and a static ip server so that this can be done where internet access isn't a possibility.

I believe I've inputed everything into the sketch that needs going into the sketch, like making the hisip[]={ip address} and adding the APIKEY. The serial monitor reads when plugged in and recieving data from the emonTX wireless station Data Sent: /emoncms/api/post.json?apikey=MYAPIKEY&json={rf_fail:0,power1:63}\0

I really don't understand why it's not working.

ukmoose's picture

Re: Nanode 5 will NOT post to Emoncms?

If you plug a PC into the router, can you write to the your emoncms by using your internet browser?

http://<IP_address_of_raspberrypi>/emoncms/api/post.json?apikey=MYAPIKEY&json={Test:49}

 

 

AustinC's picture

Re: Nanode 5 will NOT post to Emoncms?

Yeah, I've tried that and that did work.

 

ukmoose's picture

Re: Nanode 5 will NOT post to Emoncms?

OK so from that we at least know that your network is setup correctly.

In your sketch can you make sure that the following lines look like below...

// 1) Set this to the domain name of your hosted emoncms - leave blank if posting to IP address
char website[] PROGMEM = "";   // <-- (nothing inbetween the quotes)

 

// or if your posting to a static IP server:
static byte hisip[] = { 192,168,1,10 };  //<-- The IP address of your emoncms server with COMMA's inbetween not fullstops.
// change to true if you would like the sketch to use hisip
boolean use_hisip = true; //<-- Change this line to true

 

AustinC's picture

Re: Nanode 5 will NOT post to Emoncms?

 

So heres the section of code/serialmonitor/laptop connection

 

http://img831.imageshack.us/img831/240/themystery.png

ukmoose's picture

Re: Nanode 5 will NOT post to Emoncms?

OK,  a couple of more things to try...

 

1) The script running on your nanode has the dns set to point at an internet dns server.  This is set on the dhcp_dns tab in the arduino app (tab is underneath the icons) change this to be your dhcp_server.  

You should be able to check the settings using the computer that worked when you plugged it in.

 

2) If you log into the router, there's probably a page that shows connected devices and ip addresses etc.  Does your router see the nanode and the rasppi?

AustinC's picture

Re: Nanode 5 will NOT post to Emoncms?

Going sequentially, 

1) What and how? Do I need to setup a DHCP server on the Pi for this to all work?

2) When I log into the router, only the the computer i have logged in shows up on the attached devices list. However, I can ping the raspberry but not the nanode from the computer. 

ukmoose's picture

Re: Nanode 5 will NOT post to Emoncms?

Your router can be a DHCP server…and if you’re on a home network, it most likely serves this purpose.

Go to the dhcp_dns tab (see attached image)

go to the line 

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

and change it to the ip address of your router.

alco's picture

Re: Nanode 5 will NOT post to Emoncms?

ethercard 

Hi austinC,

 

You can take a look at my nanodeRF sensingshield sketch if you want. it post (bij JSON) to COSM and also EmonCMS in one sketch. I also had troubles with the DHCP. turnes out that you have to comment-out 1 online in the DHCP tab and modify a datatype in the thercard libary. it's al commented in my sketch. at : https://github.com/alco28/Sensor_base.

PS

 

 

ukmoose's picture

Re: Nanode 5 will NOT post to Emoncms?

image... 

AustinC's picture

Re: Nanode 5 will NOT post to Emoncms?

So I tried the DNS fix in the power relay sketch, and I've tried alco's sketch but neither will post to emoncms. 

for alco's sketch it is saying the dns for emon is 0 and the http request timed out. I honestly have no idea why any of this will not work. 

ukmoose's picture

Re: Nanode 5 will NOT post to Emoncms?

For alco's sketch to work you needed to get the right version of the ethercard library and make the modifications to the library  he listed.

Given that you have never got data from your nanode to post I'd suggest starting again.  

Download the sketch to post to emoncms.org (i'd suggest the multinode one as that's what most people use) .

Download new copies of all the library files - if there were any bugs in the libraries that have been fixed you will benefit.

 

Get your nanode working posting data to emoncms.org.  

Then at least you know that the nanode works and can successfully post.

 

Then you can retry getting it working posting locally.  

 

The alternative would be to purchase the RFM12Pi board, which would simplify your setup (no need for the router etc)

 

 

 

Comment viewing options

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