Help (Please excuse me for being stupid)

Hi,

Would appreacited some help.
 

Have built the emonTx V2.2 board, checked the voltage was ok before soldering the RF-module on and I have set the IRQ port (DIO3) voltage to 3V with solder.

I have chosen to use the Raspberry Pi as the base station with a hard drive.

Installed the Arduino IDE and cp2102 driver, and download the sketches into the sketchbook under the parent titles of Libraries and OpenEnergyMonitor; then uploaded the sketch [emonTx CT123 voltage] to the emonTx board and the LED flashes and I can hear the transmission burst on the speakers connected to my laptop so I assume the upload has been successful.

My confusion lies in which sketches do I have to upload, in particular the libraries, which specific libraries are required (just those specified in the [emonTx CT123 voltage] sketch header?) and I take it I need to paste them into the main sketch (i.e. [emonTx CT123 voltage]) as each time I upload I will overwrite the sketch loaded previously onto the emonTx board.

If I have to add the libraries to the main sketch I would appreciated some advice/instruction or links to where I can find clear easy to follow instructions within the forum or elsewhere.

I expect that the solution may be obvious to others, I tend to solve problems myself, but in this instance I need assistance as I fear my Asperger’s and dyslexia are getting the better of me and I can’t see the answers even though they may well be apparent within the forum.

Hoping someone can help me, as up to this point have enjoyed getting back into electronics/programming which I haven’t been involved in since college (22 years ago eek!)

Thanks.

Ad84's picture

Re: Help (Please excuse me for being stupid)

Im pretty  new to this all too, but i'll try to help. Ive also never used an emonTx before but i have made an energy monitor using an arduino, so i reckon i can clear it up a bit for you.

From looking at the firmware you are correct with uploading the emonTx CT123 voltage sketch to the board. This should allow you to view to current/voltage etc from the serial port monitor in the arduino ide ( top right button with magnifying glass on it). The sketch needs two libraries EmonLib.h and JeeLib.h.  Make sure you have them available in the ardiuno ide; check Sketch>Import Library and look for EmonLib.h  and JeeLib.h if they are not there you haven't installed the libraries correctly.

To connect to the pi, i believe your gonna have to put it all together yourself. There is another example sketch named g_TransmittingData.ino in the guide folder. This gives an example of how to send data over RF using the JeeLib libary .

The libraries are declared at the start of the sketch (look for #include "EmonLib.h" in the sketch) and are compiled with the sketch when they are uploaded. Think of them as extra instruction sets that make your life easier. For this purpose all you have to do is make sure they are installed correctly and the ardiuno compiler does the rest.   

 

Hope this helps, also please someone correct me if im wrong!

 

 

Robert Wall's picture

Re: Help (Please excuse me for being stupid)

All the instructions for setting up the Arduino IDE under Windows 8 (XP, Vista & 7 are broadly similar) are here: http://openenergymonitor.org/emon/buildingblocks/setting-up-the-arduino-...

You don't need to move the libraries once they are installed in the proper place - the IDE will find them when you compile the sketch. As you seem to have uploaded the sketch OK, I think you have done all that correctly. If your compile fails, check the list of libraries needed at the top of the sketch, and if one is missing, you'll need to download it and install alongside the rest. Note: you need to rename some libraries. If you do, it will be clearly stated in the 'README'.

If you connect the Serial monitor as Ad64 says, you should see something printed in the window - you might need to set the baud rate to what it set inside the sketch (Serial.begin(9600); probably). You don't need the RPi for this.

I can't help you with the RPi - you need this: http://emoncms.org/site/docs/raspberrypihdd

Feel free to ask again when something isn't clear - we have experts in the various areas so help isn't far away.

 

calypso_rae's picture

Re: Help (Please excuse me for being stupid)

Have you shown that a simple sketch (which doesn't use any libraries) can be uploaded, such as blink.ino?

Robert Wall's picture

Re: Help (Please excuse me for being stupid)

Excession76 says his emonTx_CT123_voltage sketch is working, so he must have compiled and loaded it correctly. (The emonTx V2 does NOT come pre-loaded with a sketch.)

What I maybe should have pointed out a bit more clearly is the standard libraries (emonLib, Jeelib etc) don't have to be copied into the sketch directory, and can't be separately loaded into the emonTx. The libraries and the sketch are combined by the compiler/linker part of the IDE, and the whole thing uploaded. But (as is the case with emonTx_CT123_voltage) sometimes the sketch is split into two or more files, and these do have to be alongside the main sketch in the same directory. However many source files the sketch spans, all are combined with the libraries by the compiler and uploaded as one entity into the emonTx.

Excession76's picture

Re: Help (Please excuse me for being stupid)

Thank you all for your replies, not feeling so lost now!

Should be able to figure it out now (he says!)

Again thanks.

 

Comment viewing options

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