Integrating EmonTx V4 with EmonBase

The RF12demo_RFM68CW_Test code has an option for ‘RF69’ , so hopefully Alan’s emonPi has a RFM69 in it.

@rupert - I should have clearly stated this earlier - I’m using an emonBase (no LCD etc.). I didn’t realise the community to referred to that variant as emonBase only (rather than emonPi). Does this change things significantly for this issue?

I checked back in my OEM account and I ordered the emonbase in March 2019, and I ordered it with the additional ‘RaspberryPi RF add-on: RFM69Pi - 433Mhz’. I flashed/upgraded the SD card once since then. And, this radio module was working with the emonTx V3 originally.

This makes a big difference. I wish you had used the correct description earlier. I’ve changed the title of the thread accordingly.

You must presume much of the information and suggestions we’ve made are likely to be inapplicable or wrong, e.g. there is now no concerns about running Continuous Monitoring, because the emonBase is incapable of monitoring power and energy.

What do you mean exactly? Can the emonBase + RFM69Pi module not interface with the emonTx V4?

Let’s start again.

Look at the radio module sitting on your Raspberry Pi, look at Docs → Learn → Electricity Monitoring → Networking → Networking → RFM12B & RFM69CW Wireless Transceiver Modules and identify the radio module you have, either an RFM12B or an RFM69CW. I would expect it to be the latter but it’s not a given. This will determine the software you need to load into the processor on the RFM**Pi on which the radio module sits. While you’re there, make a note of the frequency, it should be 433 MHz.

Go into emonCMS → Admin → Update →UPDATE FIRMWARE ONLY and select RFM12Pi or RFM69Pi according to the type you have. This should give you “emonBase RFM69Pi firmware…” (or RFM12B), and update. If it’s an RFM12B you have, you must unfortunately downgrade your emonTx4 back to the Classic JeeLib software, because as I wrote above, the RFM12B can’t use the LPL library.

There is no ADC in a Raspberry Pi. It is physically unable to measure voltage or current, from which the power and energy values are calculated. If you add on the GPIO connector (instead of your RFM12Pi or RFM69Pi) what is effectively either a 2-channel emonTx V3 or a 6-channel emonTx4, you then have an emonPi or an emonPi2. Which is how you misled us and I told you the wrong software to load.

An emonBase then - well that was a bit unexpected! For version 1 of both, assuming a RFM69 radio module:

An emonBase is a Raspberry Pi with an atmega328 processor + RFM69 radio module add-on board on the GPIO, that can receive and transmit radio data for the Pi to process. It can receive voltage, power, energy etc data measured by your emonTx4 and log them, produce graphs etc.

An emonpi is a Raspberry Pi with a different atmega328 +RFM69 add-on board on the GPIO. It has the radio functions above, but also can make voltage, power, energy etc measurements on its own.

Because the functions of the two boards are different, the code required in the atmega328 processor on the two boards is different, but both can contain code for either Jeelab and LPL radio formats.

As Robert says, to upgrade the emonBase you have to LPL radio format (as you say that you have a RFM69Pi - 433Mhz):

emonCMS → Admin → Update →UPDATE FIRMWARE ONLY
Select port:ttyAMA0 Hardware: rfm69pi Radio format: RFM69 LowPowerLabs
Firmware: emonBase RFM69Pi firmware lowpowerlabs v1.1.1

You will need to make sure that your emonHub interfacer and node5 configuration entries are correct as discussed before.

And then hopefully it all should work!

Guys, thanks again. I’m still learning (having previously had a system that essentially worked out of the box), and I do appreciate the time you’re giving me here!

I definitely have the RFM69CW - 433 MHz Option.

Since you both cleared up the confusion around the wrong info I supplied, I updated the RFM69Pi, and the emonTx V4 to the LPL versions. Here is the output from the serial interface:

|emonBase_rfm69pi_LPL V1.1.1
|OpenEnergyMonitor.org
OK 17 57 0 0 0 80 76 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 117 48 117 48 117 0 0 0 0 (-24)

|emonPi CM V1.1.1

Also, from config file:

INTERFACERS:

[[RFM2Pi]]
    Type = EmonHubOEMInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0
        com_baud = 115200 # 9600 for old RFM12Pi
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        subchannels = ToRFM12,

        group = 210
        frequency = 433
        baseid = 5                              # emonPi / emonBase nodeID
        calibration = 230V                      # (UK/EU: 230V, US: 110V)
        quiet = true                            # Disable quite mode (default enabled) to enable RF packet debugging, show packets which fail crc
        # interval =  300 

NODES:

[[5]]
    nodename = emonpi
    [[[rx]]]
       names = Msg, power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulse1count,pulse2count,E1,E2
       datacodes = L, h, h, h, h, h, h, h, h, h, h, L, L, l, l
       scales = 1, 1,1,1, 0.01, 0.01,0.01,0.01,0.01,0.01,0.01, 1, 1, 1,1
       units = n,W,W,W,V,C,C,C,C,C,C,p,p,Wh,Wh

Can spot anything wrong here? When the emonTx is not connected via USB to the emonBase, I can see the red LED flashing every ~10 seconds (so I’m assuming it’s trying to send some data out).

It’s working!! It was the baud rate in the RFM2Pi Interfacer… @Robert.Wall mentioned this earlier, but I lost it in the mess I had made… so changing from 115200 to 38400 now shows the radio data.

Thanks again for giving me the time here Robert and Rupert!

Good to hear that you’ve programmed the RFM69Pi successfully

The baud rate in the interfacer should be 38400.

The entry for node 5 - this would be the entry for an emonPi and would be for the measurements coming from the emonPi add-on board - which you don’t have. So you won’t see any input data from node 5.

You do need a correct node entry for the emonTx4 - I believe you had set it to node 17, so

[[17]]
    nodename = emontx4cm17         (use your own name here)
    [[[rx]]]
       names =  MSG, Vrms, P1, P2, P3, P4, P5, P6, E1, E2, E3, E4, E5, E6, T1, T2, T3, pulse
       datacodes = L,h,h,h,h,h,h,h,l,l,l,l,l,l,h,h,h,L
       scales =       1,0.01,1,1,1,1,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
       units = n,V,W,W,W,W,W,W,Wh,Wh,Wh,Wh,Wh,Wh,C,C,C,p

Yippee! Good to hear it’s all working!

1 Like