Solved - NanodeRF and Synology

HI

I am running emoncms on synology NAS, until now I was using raspberry with RFM12Pi expansion to send data to synology emoncms webpage and everything worked. But now I decided, because I was only forwarding data to synology to use NanodeRF but here is where things go wrong :). I use NanodeRF_multinode code
and I can send data to emoncms.org but not on my Synology emoncms webpage the red led is on. I tried and checked everything (IP addresses, subfolders, api keys). Is there anyone using similar setup and can tell me what am I missing?

THX

Dan Woodie's picture

Re: Solved - NanodeRF and Synology

Ripster,

I run my Emoncms install on a NAS4FREE server, which may or may not have some similarities with your Synology install. I had issues with it not receiving data from my NanodeRF using the static IP due to the Host name being blank in the GET packet issued from the NanodeRF. It would receive packets directly from my browser fine since my browser was properly listing the IP address in the host field instead of leaving it blank. The required edit was to the configuration file for Apache on the server to direct all requests that did not match an existing host to my Emoncms host. More information can be found on the thread here:

http://openenergymonitor.org/emon/node/2576

Look to the bottom of the post for the solution that worked for me. I hope this helps!

Dan

Petrik's picture

Re: Solved - NanodeRF and Synology

Ripster - could you point a direction to find a writeup about how to make emoncms installation to Synology NAS including nanode RF setup ? Very interested doing the same but found it somewhat difficult without linux skills.

Raspberry pi is not really an option due to the database size.

 

 

Ripster's picture

Re: Solved - NanodeRF and Synology

Hi Dan, 

I will work on that, did some this morning but no success.
I did enable apache log, can you just help me how to get complete request, now i just get one line in log file.

 

@Petrik for emoncms webpage you dont need any linux skills :)

Here is a How to host a website on Synology NAS

You will need to create mysql databse with phyMyAdmin and put everything to your emoncms default.settings.php and rename it to settings.php.

$username = "USERNAME"; <--- username to acces your phpmyadmin
$password = "PASSWORD"; <--- password to acces your phpmyadmin
$server   = "localhost"; <--- leave this alone
$database = "emoncms"; <--- database name you created in phpmyadmin for emoncms.

This is it. Now comes the part that I am struggling with, to accept data from nanodeRF, no problem with data send from raspberry. Will write more when I make some progress.

Mattia Rossi's picture

Re: Solved - NanodeRF and Synology

Ripster, you could post the sketch you are using on the nanode and the log you get both on the synology and on the serial console of the nanode, maybe with that info we would be able to help ....

Dan Woodie's picture

Re: Solved - NanodeRF and Synology

Ripster,

I determined I was receiving a 403 Forbidden response from Apache on my server by packet sniffing. I cannot help you much on that as the packet sniffing was mostly done by my father, who has much higher network expertise than I. Here is some information on the basics:

http://www.linuxjournal.com/content/packet-sniffing-basics

Logging for Apache can be found at:

http://httpd.apache.org/docs/2.2/logs.html

I am not at home now, but from what I recall, the Apache logs when viewed showed the requests coming in and listed the 403 error, so that might confirm that this is the issue and not something else. The fix was listed in that previous post, editing the httpd.conf file to include a wildcard pointing towards the root of the apache install.

Hope you are able to find the issue.

Dan

 

Ripster's picture

Re: Solved - NanodeRF and Synology

So I use Nanode_multimode.ino code. Only changes are made to this lines.

// 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:
static byte hisip[] = { 192,168,1,106 };  

// change to true if you would like the sketch to use hisip
boolean use_hisip = true; 

// 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[] = "----MY-API-KEY------";

This is the apache log                                                                                                                                                            192.168.1.1 - - [21/Aug/2013:07:19:38 +0200] "GET /emoncms/api/post.json?apikey=----MY-API-KEY------&node=10&csv=2093,3094 HTTP/1.0" 200 2 "-" "-"

192.168.1.1 - - [21/Aug/2013:18:29:35 +0200] "GET /emoncms/time/local.json?apikey=----MY-API-KEY------ HTTP/1.0" 200 9 "-" "-"

 

Now I need some more info from apache since it is geting data.

Will post some more, any idea is appreciated....

Ripster's picture

Re: Solved - NanodeRF and Synology

i think i am onto something. i think nanoderf is pointing to a wrong path. Bolded is the difference.

this is nanoderf path

192.168.1.1 - - [21/Aug/2013:07:19:38 +0200] "GET /emoncms/api/post.json?apikey=----MY-API-KEY------&node=10&csv=2093,3094 HTTP/1.0" 200 2 "-" "-"

and this is from raspberry

192.168.1.1 - - [21/Aug/2013:19:43:31 +0200] "GET /emoncms/input/bulk.json?apikey=----MY-API-KEY------&data=[[11,18,2537,3060],[16,10,2225,3094],[35,18,2537,3060]] HTTP/1.1" 200 2 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"

Ripster's picture

Re: Solved - NanodeRF and Synology

Well the incorrect path in the code was the problem.
I just corrected the path from /api   to /input and now it works.

thx all

Comment viewing options

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