No receive data

I just installed a Emoncms server in my computer, the server is using Wampserver 2.4. THE emoncms  is running and the database. I have a SMS pushing data to the server but I can not received any data. I have the port open in my firewall and I can see the packet going to the server, but there is no action in the inputs at the sever. I test the EMS using the online server and is pushing data to it, I check the IP and the API and they are correct to my server.  Any idea what may be happening?

Robert Wall's picture

Re: No receive data

Is the Wampserver on-line? (If it isn't, you can only access it within the machine it's running on.)  Did you follow all the set-up instructions for enabling the required options?

wichiepr's picture

Re: No receive data

Thanks

 

yes the server is ONLINE and I did follow all the WampServer Modification to all the files. My controller say it connect and pushing the data, I can see in my router that the packet is forwarded to the machine with the server, but I don't see any data in the input page.

 

 

 

wichiepr's picture

Re: No receive data

Here is a the log form the Apache server,

ukmoose's picture

Re: No receive data

Could it be a formatting issue in your script?

from your access log  

GET /emoncms/input/post.json?apikey=583dfbef6ac0a135916fba49cf44a97e&node=1&json=[{TRTU1:74.000000},{SRTU1:75.000000},{C11:100.000000}]

 

Emoncms expects data 

http://emoncms.org/input/post.json?apikey=a924b4d95306a55445ea3a96eb17e689&json={power:200,temp:21}

wichiepr's picture

Re: No receive data

Sorry that I ask you, But can you point me to where may be that script? IF you refer to the script that is pushing the data,  is working fine because I test it with the emoscms.org server and is pushing data to the server, I can see it on the input page. Something on my side server that is not letting the data in.

wichiepr's picture

Re: No receive data

I make a change to allow my using 127.0.0.1 because I am using W8 and I have now this log,  there is no error on the Apache error log

Robert Wall's picture

Re: No receive data

127.0.0.1 will not work. That address is only good inside the machine running the Wampserver. You must get the proper address of the machine from your router.

 

Here are my instructions for setting up to work to a local server:

 

2. To a local server:
The server can be WAMP, LAMP or MAMP. Install it according to the provider's instructions, and any special notes here [link to emcms installation].

To set up emoncms, you must inhabit two worlds – the website and the host machine's world, and you must be clear in your mind which one you are operating in.
Fire up your browser and go to "localhost".  You are on a website now. You should see the Wamp home page and phpmyadmin, which is under "Tools". Run phpmyadmin (click it). Click "Databases" in the top banner. In the next screen, think of a name for your database (I used "emondata" – make a note of what you call it) and put that in appropriate box and click "Create". 
Then set emoncms up as a user: click on Privileges in the top banner, click on Add a new user, then invent a User name for it, enter "localhost" as the host, and give it a password then click Create the user. Note the user name & password. When it returns to the previous screen, you need to give the new user ALL PRIVILEGES in the database you just created. So click Edit privileges against the new user's name, scroll down to “Database-specific privileges”  and select the database from the drop-down list. On the next screen click Check all, then Go to apply them.
Move into the machine's world and copy emoncms into a directory where it will appear in Localhost (Wampserver calls it the “www directory”)
When you've copied emoncms in the machine's world, you'll find you have (in the website world) on your Wamp home page (localhost) a website called something like openenergymonitor-emoncms3. It's that which you click on to run emoncms (but don't do that yet).
N.B. Remember to put your server “online”.
Next tell emoncms how to log in to the database. In the machine's world, in that directory:
Do this by creating settings.php: copy default.settings.php and rename to settings.php. Edit it and set the $username, $password, $server and $database to the values you set in phpmyadmin  ($server will be "localhost").
In the website world, run emoncms and register yourself as a user and obtain an APIkey (you need not be the user that you set up in phpmyadmin).

Set up the NanodeRF to send the data. Use the 'static IP' sketch:
a. Invent a MAC address for your NanodeRF. It must be unique within your LAN. Put it in here in the Nanode sketch:
// ethernet interface mac address, must be unique on the LAN
static byte mymac[] = { 0x42,0x31,0x42,0x21,0x30,0x31 };

b. Check your router's admin pages and find the IP address that it has allocated to the machine that your server is running on. Make the router use this IP address always (static) - check the router documentation for how to do this.
Edit the NanodeRF sketch:
c. set website[ ] to blank as you don't have a domain name (it is not “localhost”):
// 1) Set this to the domain name of your hosted emoncms - leave blank if posting to IP address
char website[] PROGMEM = "";

d. Tell the NanodeRF your server's IP address. Enter the IP address you found from your router here:
// or if your posting to a static IP server:
static byte hisip[] = { 192,168,1,10 };

e. Instruct the Nanode to use it:
// change to true if you would like the sketch to use hisip
boolean use_hisip = true; 

f. Instruct the Nanode to use a static IP for itself too:
boolean use_staticIP = true; 

g. Invent an IP address within the range used by your router, but not used by any device on your local network:
static byte myip[] = { 192,168,1,66 }; 

h. Set your router's Gateway address (your router's admin pages will tell you this):
static byte gwip[] = { 192,168,1,254 };

i. Tell the Nanode the sub-directory where you installed emoncms (this will be the name you clicked on to run it)
// 2) If your emoncms install is in a subdirectory add details here i.e "/emoncms3"
char basedir[] = "/emoncms-master";

j. Give the Nanode the APIkey:
// 3) Set to your account write apikey
char apikey[] = "YOURAPIKEY";

k. Plug in an Ethernet cable to your router, compile and upload the sketch. On the serial port you should see
(with possibly a wait while it times out and retries):

[webClient]
IP:  192.168.1.66
Gateway:  192.168.1.254
Server: 192.168.1.69
Data sent: /emoncms-dev/input/post.json?apikey=a8bfc828b48860ca24e23cf824718cc5&json={rf_fail:1}
OK recieved
Data sent: /emoncms-dev/input/post.json?apikey=a8bfc828b48860ca24e23cf824718cc5&node=10&csv=0,36,2,33,1,36
OK recieved
Time request sent
Time: t16,34,58
Data sent: /emoncms-dev/input/post.json?apikey=a8bfc828b48860ca24e23cf824718cc5&node=10&csv=0,32,0,43,0,37
OK recieved
Data sent: /emoncms-dev/input/post.json?apikey=a8bfc828b48860ca24e23cf824718cc5&node=10&csv=0,34,0,36,-1,31
OK received

[etc]

Explanation:

IP:  192.168.1.66  
This is the content of myip[ ]  It will appear in your Router's list against the MAC that you allocated to the NanodeRF

Gateway:  192.168.1.254
The Gateway address of your router -  will depend on your router's settings.

Server: 192.168.1.69
The IP address of your server (or the machine that the server is running on, as allocated by your router)

Data sent: /emoncms-dev/input/post.json?apikey=a8bfc828b48860ca24e23cf824718cc5&json={rf_fail:1}
OK received
The data sent by the NanodeRF, and an acknowledgement by emoncms.

Then, when you look at Inputs at emoncms.org, you should have and be able to click on Node 10 and it will expand to show four inputs named 1-4 (depending on the sketch you're using in the emonTx), and if you click [log] you'll see a graph of the data.
It also gets back from the server the current time: "Time: t15,53,13".

wichiepr's picture

Re: No receive data

Robert

 

First of all THANKS for your time and help. I have the server part as you mention, But there is a different controller sending the data. Let me explain to you; this sis a EMS control made by EASYIO  operating under SEDONA. IN the application program we have an Object  emonpush. We set the object with the API, Port Number and the ip, with that information the internal script execute and send the input data from our controller to the server. So for testing I use the emoncsm.org server so check that the emoncmspush object is sending the data, and is working because I can get daat from it to the emoncms.org server.

 

So what we do is find the API under the APIHElP in our server "583dfbef6ac0a135916fba49cf44a97e", find my public ip an enter it in the object server ip and set the port that is 80. With this setting the controller is pushing the data to our server. I can see on my Firewall the the pack are getting to the server as you see it on the Apache Access log. "64.237.163.78 - - [19/Feb/2014:12:07:15 -0400] "GET /emoncms/input/post.json?apikey=583dfbef6ac0a135916fba49cf44a97e&node=1&json=[{TRTU1:76.000000},{SRTU1:77.000000},{C11:0.000000}] HTTP/1.1" 404 221. I check at the web the last HTTPxxxxx and it say is a denied message from a server.

 

There is  my problem that I can find where. I am new to this, on the server side.

 

Let mw know if you understand or need additional information and one again thanks for your time

Robert Wall's picture

Re: No receive data

Somehow, I missed your post. I am not a networking or server expert, but if your server log is reporting that it is blocking the message, then surely that must be a problem with either the server itself or your firewall.

Comment viewing options

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