emoncms - Problem sending data kwhd feed

 Hi,

I have a  problem regarding data posting to emoncms. I have tried the example API URL which work OK. I autoconfigured the inputs and I see that the input and the feeds have been correctly updated with value 252.4. The power-kwhd feed has a value of 0.01 and the corresponding table in mysql has also the correct value.Everything is OK.

When I try to update it using a C# program or php with this code from the forum :

$url = 'http://yourserver/emoncms3?apikey=xxxxxxxxxxxxxx&json={power:252.4}';


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$contents = curl_exec ($ch);

echo $contents;
 

Then updated input value is 252 (without .4) and the power-kwhd is now 0 and will always stay 0. 

I don't exactly understand what's hapening because the emoncs doesn't care where the request is coming from...

Is there any way to debug what's going on ?

 

Regards,

 

Lloyd's picture

Re: emoncms - Problem sending data kwhd feed

If you have access to the web server logs you could check what is being received by it.

Lloyd

cyb's picture

Re: emoncms - Problem sending data kwhd feed

 Everything looks good in the apache log, I can see the exact string with power:252.4

cyb's picture

Re: emoncms - Problem sending data kwhd feed

 You can find screenshots of my problem here : http://www.ploumen.be/emoncms/

In the apache log , here's what I see when using the curl or the test API method :

192.168.0.136 - - [05/Sep/2012:19:03:10 +0200] "GET /emoncms/api/post?apikey=6b9a3df24e73d977d849c61408f4968e&json={power:252.4,temperature:15.4} HTTP/1.1" 200 4386

I am using windows XP in french.

What can I do to debug this problem ? I realy would like to use this software.

Regards,

Lloyd's picture

Re: emoncms - Problem sending data kwhd feed

French? Isn't a comma used as a decimal separator in French? No idea how the various software layers would interpret this.

Lloyd

cyb's picture

Re: emoncms - Problem sending data kwhd feed

 Yes indeed, the decimal separator is a comma. The problem is I have other software running on my server that need this configuration...

 

Anyway, it doesn't explain why it does work with the API test URL...

cyb's picture

Re: emoncms - Problem sending data kwhd feed

 Ok I think I figured out what was going on. I changed the prefered language in the account tab and selected FR_fr (downloaded from the dev branch) and now it seems to work. I think this should be much more documented that the prefered language is linked to the input data format...

Comment viewing options

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