NanodeRF communication with Emoncms

Hi folks, I am trying to set up the communication with the NanodeRF and Emoncms. I have no back ground in working with servers, so my apologies if I say something wrong. Following  the steps: http://emoncms.org/site/docs/installwindows, I have been successful in running emoncms on local host. I installed MySQL and I'm running WAMPSERVER on it ( to my understanding).This is the message i get when serial monitoring my nanodeRF:

[webClient]
DHCP status: 1
IP:  192.168.0.10
GW:  192.168.0.1
DNS: 8.8.8.8
DNS status: 1
SRV: 176.227.193.50
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&json={rf_fail:1}
Time request sent
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&node=10&csv=0,0,0,3
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&node=10&csv=0,0,0,20
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&node=10&csv=0,0,0,27
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&node=10&csv=0,0,0,3
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&node=10&csv=0,0,0,15
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&node=10&csv=0,0,0,2
Data sent: /api/post.json?apikey=7ef577a45d59addd38bad7bb27b96c68&node=10&csv=0,0,0,23

The "OK received" message is not showing up. No updates are received on emoncms. 

One more thing i should mention is I made changes as indicated here: http://openenergymonitor.org/emon/node/3728 due to an error message at the top of every screen on emoncms. It removed the error but I'm wondering if this could be the problem.

Thanks to anyone who can help
 

Robert Wall's picture

Re: NanodeRF communication with Emoncms

Does the server respond when you send a message from your browser? (see the Input API Help for the format.) Is your WAMP server on-line?

I always use static addresses and I've never had any success with DHCP. You'll find my notes for setting up the NanodeRF to talk to WAMP here: http://openenergymonitor.org/emon/node/3869 or here http://openenergymonitor.org/emon/sites/default/files/Nanode%2520set-up.odt

Check through those and make sure you've done everything.

alco's picture

Re: NanodeRF communication with Emoncms

you can take a look at my firmware: https://github.com/alco28/Sensor_base

its a nanodeRF with and sensorshield on it so it acts like a emontx&emonbase.

 

Jordan-loe's picture

Re: NanodeRF communication with Emoncms

Hi Robert, when you say Does the server respond when you send a message from your browser? Do you mean sending the example data from the emoncms page? If so than yes it does. When I post data it shows up in my feed. Also yes, my WAMP server is online.
When i look at the feeds on emoncms under the column "engine" it says MYSQL. I uploaded the static IP sketch to the nanode and also assigned a static IP to my computer. Unfortunately, I am still not getting any data sent to emoncms and the "OK received" is not showing up in serial monitor. 

I have the program MYSQL notifier (1.1.5) when left clicking on the icon it says localhost (online), wampmysqld-Running , MySQL56-Running​.  When I hover over the WAMP icon it says WAMPSERVER- server online. 

Here is the changes i made to the sketch:

// ethernet interface mac address, must be unique on the LAN
static byte mymac[] = { 0x42,0x31,0x42,0x21,0x30,0x31 };

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

// 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[] = { 192,168,0,14}; // Laptop static IP

// Set to true and enter IP to give the NanodeRF a static IP address - default is DHCP (NB: must be used with static server IP (hisip)
boolean use_staticIP = true; 
static byte myip[] = { 192,168,0,100 };        //NanodeRF static IP address - not needed if using DHCP
static byte gwip[] = { 192,168,0,1 };        // gateway ip address - not needed if using DHCP

// 2) If your emoncms install is in a subdirectory add details here i.e "/emoncms3"
char basedir[] = "emoncms";

// 3) Set to your account write apikey
char apikey[] = "7ef577a45d59addd38bad7bb27b96c68";

 

The char basedir[]= i put "emoncms" that is the name of the sub folder in the wamp www folder. Not sure if that's right.

thanks for the advice so far!

Robert Wall's picture

Re: NanodeRF communication with Emoncms

EmonCMS responding to the web page means that most (if not all) of that is OK and running, and your problem is talking to it from outside that machine.

You have for the directory "emoncms3", not "/emoncms3"  Those are different places!

Are you sure the gateway IP address is correct? Is that what your router documentation/setup says it is? Usually, it is at the top end of the range.

Jordan-loe's picture

Re: NanodeRF communication with Emoncms

The gateway IP should be correct. It is the address on the routers webpage. It says " LAN IP ADDRESS" 192.168.0.1. Also when i go into the cmd in the start menu and do a "ipconfig" it says the gateway address is 192.168.0.1. Like i said i assigned a static address to my computer but i have not for the nanode. On my routers page under DHCP it has arduino-31 with an IP address of 192.168.000.005. 
static byte myip[] = { 192,168,0,100 };        //NanodeRF static IP address - not needed if using DHCP

Do i some how need to make a static ip for the nanode? Or do i just make one up for the code? Or do i use the DHCP IP from the router page?

Robert Wall's picture

Re: NanodeRF communication with Emoncms

It might be my router, but I never succeeded in getting DHCP to work with the Nanode. Hence the use of static addresses throughout (at least for the Nanode and the bits that interface with it).

Jordan-loe's picture

Re: NanodeRF communication with Emoncms

How do I assign a static IP for the nanode? for the line static byte myip[] = { 192,168,0,100 };        //NanodeRF static IP address - not needed if using DHCP I used "192.168.0.100". This static ip address is only in my sketch. Do I need make the router recognize it as the nanode's ip somehow?

Robert Wall's picture

Re: NanodeRF communication with Emoncms

The notes don't mention it, I can't remember now, but I can't believe I didn't write it down if it was important. So I think not. All I can say is the set-up that I described in the notes worked for me and it's worked for several others around here too.

Jordan-loe's picture

Re: NanodeRF communication with Emoncms

I've made headway but still not operational. Reading on the forum, I seen that ''api'' should be changed to ''input'' in order for the packet to be sent to emoncms. Is this still relevant?

 

Robert Wall's picture

Re: NanodeRF communication with Emoncms

I thought the example sketches had all been changed, but apparently not. As far as I know it should be "/input/post.json" and that's certainly working for me as I type.

Patrice Diliakou's picture

Re: NanodeRF communication with Emoncms

Hello,

If your emoncms server is in /var/www/emoncms you must put /emoncms in your sketch.

You can leave "api" on original sketch parameters.

Dont forget to put good parameters to permit your installation working on local network with ip exemple : (http://192.168.x.x/emoncms/). you must configure correctly your virtualhost in apache settings. (  i passed the evening to search where was the problem :)  )

 

Bye !

Comment viewing options

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