How to connect to EmonCMS ?

Hello,
I'm discovering emonCMS, and try to send informations from an Arduino, through a W5100 based Ethernet shield.
My issue:
- after I create an user account in emonCMS, I can send data to database by using my browser, and copying/pasting the relevant line from my account page. Input data are updated consequently. So, it's ok.
- but, when I send the same data from Arduino board, nothing is updated in emonCMS, and no response comes back from emonCMS to Arduino shield..

I think I have forgotten something in data process. And particularly, I have some doubt about login, as through my Arduino, nothing seems to be send for that function.

As I have updated original Nanode sketch in order to be compliant with W5100, I use Ethernet library from Arduino 1.0 IDE. 

Thank you for your informations.
Clox.

 

 

 

clox's picture

Re: How to connect to EmonCMS ?

More information about my concern:
--> When I connect to emonCMS with a browser, I first have to login, and after that, I can send data for test by copying/pasting in the browser adress the line found in my account page, including my APY key. This is ok, and update inputs in emonCMS.

--> When i try to do the same actions with an Arduino card, I don't send a login command, but directly the data update command (copied from my account page). In this case, data in emon CMS are not updated.

Isn't it the issue to send a data command without first a login command ?
If yes, how to share the login command ?

Hoping it will clarify my concern.
Thanks.

prensel's picture

Re: How to connect to EmonCMS ?

you will need the API key to send data from your emonbase to your emoncms so you dont need to login as you do from the website interface.

 

 

TrystanLea's picture

Re: How to connect to EmonCMS ?

You can find your apikey here:

http://localhost/emoncms3/user/view

To send data you need the write apikey, then just enter it in the URL as so:

http://localhost/emoncms3/api/post?apikey=YOURWRITEAPIKEY&json={power:252.4,temperature:15.4}

clox's picture

Re: How to connect to EmonCMS ?

Issue is now solved. I found solution in this post:
http://openenergymonitor.org/emon/node/484

My concern was in fact how to update the sketch for W5100 based Ethernet interface. In this configuration, command lines are different, and my firts sketch didn't send Host command !

Thanks for your help.

 

Amin Zayani's picture

Re: How to connect to EmonCMS ?

Hey clox,

is your sketch for the base with W5100 open? do you share it somewhere?

I'm also looking to have the same setup and I was wondering if you could share your code.

Greets

Comment viewing options

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