Community
OpenEnergyMonitor

Community

Emontx-shield and emonBase interfacing

Tags: #<Tag:0x00007fdb68d00638> #<Tag:0x00007fdb68d004d0>

I’ve got an arduino uno, an emontx-shield and a emonBase. I’m hoping to use a CT sensor for measuring power consumption of a device. Can the arduino with the emontx-shield be used wirelessly to relay data back to the emonBase or would additional equipment be required? (I do also have an RFM69Pi for the emonBase)

Sounds like you have all the main ingredients there, you haven’t mentioned a AC:AC adapter though, a CT along will only let you measure current, without a AC:AC input you can only report approximate apparent power by multiplying the current by a fixed voltage value, you cannot report realpower without an AC waveform.

I assume you’ve got the PSU(s) for the RPi and the Arduino sorted too?

But basically yes, a working arduino uno plus emontx-shield can indeed send data wirelessly to an rfm69pi attached to a working emonbase without further parts (providing they are on the same frequency of course 868/433)

This thread seems to follow on from Setting up a CT sensor with an emonBase

I’m just going to approximate power by times it to a fixed voltage. What files are required to be uploaded to the arduino, I see from the wiki this file:

I’ve had a glance at it included the emonLib.h and .ccp as well but the #include <JeeLib.h> I’ve downloaded but not sure as to what needs including from it:

Could do with a brief explaination since everytime I try and verify it fails :upside_down_face:

The instructions for setting up the Arduino IDE (including the libraries) are in:
Learn→Electricity Monitoring→Using the Arduino IDE

Awesome! Cheers I’ll have a go over, thanks Robert! :grinning:

Thanks! Installed and extracted all the libraries and the code has got a lot further. The only error I’m now receiving is at:
send_rf_data(); // SEND RF DATA - see emontx_lib
The error says:
‘send_rf_data’ was not declared in this scope
Am I still missing something?

There were two files in the “Shield_CT1234” directory that you downloaded for the sketch. Do you have them both?

No idea why it wasn’t working, it verifies now. Fantastic, you’ve been a big help!

1 Like

It obviously had not seen the second file, emontx_lib.ino, for some reason - it should show on the second tab in your Arduino IDE. The line with the error told you that!

I’ve set everything up and uploaded Shield_CT1234. This I think connected successfully as nodes 11, 12, emontx and emon pi are now on the inputs. Non of them are updating however. I have a CT plugged into the CT 1 port. I have now notice in emonHub it says “warning MainThread Device communication error - check settings”

That problem is almost certainly associated with one of the many topics presently active that discuss emonCMS problems. It needs someone else to steer you through this.

But, unless you have other devices you haven’t mentioned, you should be seeing only one Sensor Node in emonCMS - your Arduino & Shield, which is probably Node 10 (unless you’ve changed it - look in the .ino file at line 50), and possibly Node 5 (emonPi) though I would have thought not.

Nodes 11 & 12 are the defaults for the three-phase sketch.

Have you changed the data that your sketch is sending? If so, you must change emonhub.conf to suit, because unless the data arriving exactly matches what is expected, it’s rejected. But that wouldn’t produce the error message you are seeing.

Are you using the rfm69pi or connecting your shield directly via serial USB?

I’m guessing, via rfm69pi. If you have inputs appearing in emoncms it was working at somepoint, have you changed any serial port settings in emonhub.conf (or in the OS) or is it possible you have knocked the add-on board? Is the rfm69pi LED flashing to indicate packets received?

Can you please post some of the lines from emonhub.log that come before that message? oh and check your loglevel is DEBUG in emonhub.conf.