Arduino IDE + mongodb

 

I am developing a project to send data from sensors(CT) to mongodb using Arduino IDE and emonTx. So far, I have been able to read the power value from emonTx to my Arduino IDE(by which I mean I can display the power value in Serial Monitor).

I am now trying to save this data(power value) to mongodb and I have no idea if there are any already existing library for this. 

Any inputs/comments would be really appreciated.

Regards,

Dasharath

Robert Wall's picture

Re: Arduino IDE + mongodb

I have not heard mongodb mentioned here, it is possible someone uses it but as we have emoncms, which you can download and run on your home server, Raspberry Pi or LAMP / MAMP / WAMP server, it is not very likely that anyone knows much about it.

I think you have two separate problems. If you are not using an emonBase (either an NanodeRF, OKG Base or Raspberry Pi with RFM12Pi) then you're going to have to take the wired serial output from the emonTx and write a service or a script on the machine running the IDE to intercept the port and route the output into your database. Again, this is not the usual configuration that most people use, and I cannot remember anyone saying they have done this. This thread Directly connecting Emontx and Raspberry PI? might help you, or you could try a search of this site [ Google: <search term> site:openenergymonitor.org ]

When you have solved that one, you need to find how to write the data into your database, then modify the emonTx sketch to send its data in the format you require.

dashrathng's picture

Re: Arduino IDE + mongodb

Clarification: I am using NanodeRF.

Can you please suggest me how to use emoncms with emontx and NanodeRF? I could not find any instructions out there. I am new to this stuff, so I am looking for step by step instructions. 

If you could point my to the right material/webpage that would be great. Thank you.

 

Robert Wall's picture

Re: Arduino IDE + mongodb

EmonTx + NanodeRF is a standard basic configuration. You won't find any information about that "out there", all the data you need to set that up is here on this site, and you can download demonstration sketches via the Github link, and open an account at emoncms.org, or use your own local copy of emoncms.

Start here: OpenEnergyMonitor Guide Your NanodeRF is your base station in place of the Raspberry Pi, you can read about the NanodeRF under Modules.

dashrathng's picture

Re: Arduino IDE + mongodb

Hi Robert, Thanks for the reply.

I have got emonTx, NanodeRF and emoncms up and running :-).

However, I am not able to pass data from NanodeRF to emoncms. I am running emoncms locally (on WAMP). I have run NanodeRF_multinode sketch and found out that ether.dhcpSetup() in dhcp_dns tab always returns 0, but I have no idea why.

My configurations in NanodeRF_multinode:

char website[] PROGMEM = "";

static byte hisip[] = { 127,0,0,1 };

boolean use_hisip = true;

char basedir[] = "/emoncms";

I apologize if I have missed out any basic configuration. Appreciate your help.

 

-Dasharath

 

 

 

dashrathng's picture

Re: Arduino IDE + mongodb

There was a problem with my router and I figured it out. Thank you.

Robert Wall's picture

Re: Arduino IDE + mongodb

Have you put your WAMP server "online"?

I assume basedir is the location of your emoncms as seen from the web side?

hisip is wrong. You have the IP of the machine WAMP is running on as seen from inside, you need its IP as seen from your router, possibly a 192. . .address. You need to instruct the router to make that IP address static because it is hard-coded in the NanodeRF.

See how you get on with those changes.

Comment viewing options

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