Is there written application (windows) that send data to EmonCMS. Purpose is to send data to EmonCMS, and node will get it from private feed. Or any fragment of code...
»
Archived Forum |
|
PC based application send data to EmonCMSSubmitted by batulzii on Thu, 06/02/2014 - 01:48Is there written application (windows) that send data to EmonCMS. Purpose is to send data to EmonCMS, and node will get it from private feed. Or any fragment of code... » |
Re: PC based application send data to EmonCMS
Not to my knowledge.
But you can use... a browser. See the input API help. Entering the right URL, including the API key, is a solution. Or logging in, then entering the right URL without API key.
Or you can easily setup a small script using a function to call the URL. That would be wget in linux shell scripts, or urllib2 in python, perhaps can you chose python, or use a windows function in a batch script.
The rest is specific to your own case, I guess, so I don't see how the application could be already written.
Re: PC based application send data to EmonCMS
using System.Net;
string url = "http://www.emoncms.org/input/post.json?json={power:200}";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
How do you think about this code in C#? need write MS app.
Re: PC based application send data to EmonCMS
This won't work unless you are logged in to EmonCMS as Jérôme says, you would need to add the apikey...
Re: PC based application send data to EmonCMS
Yes, it was as simple snippet. Done simple Windows application to send data to EmonCMS.
Thanks for helping!
Re: PC based application send data to EmonCMS
Perhaps are you willing to share the code ? Some people here use windows as well and may be interested.
Re: PC based application send data to EmonCMS
Sure. Please, find attached. Only change API accordingly. I keepit simple and people can make own easy. This is RAR file, so please rename with .rar extension. I do not have zipper.