Emontx V3.2 firmware problem


Im trying to program a emontx v3.2.
My problem is when i use sketch for rfm/3.2 3phase voltage i dont get the data in emoncms. i can see that i get a warning in emonhub log.

if i try other sketch for 3.4 i get compile error.

I tested platformio but i did get this to work. i use arduino ide to program.

any help or guides are welcome as im a newbe.

I am sorry you have a problem, but the first rule is you must give us enough information to be able to help you.

OK, so you have a problem, but how does that help us to know what your problem is?
(Take a look at the first few points on the FAQ page when you have a moment to spare.)

What IS the warning?

My first guess - and given what you have written, it is only a guess: Have you got the correct data format defined in emonhub.conf?

I do not, cannot, nor will not support platformio. I too use only the official Arduino IDE.

Did you set up your Arduino IDE according to the page in the ‘Learn’ section - including all the libraries you require?

Is this the sketch you are using:

emonTx V3 CT1234 + 3-phase Voltage example

An example sketch for the emontx module for
3-phase electricity monitoring, with 4 current transformers

and 1 only voltage transformer

Part of the openenergymonitor.org project
Licence: GNU GPL V3

Authors: Glyn Hudson, Trystan Lea
Builds upon JeeLabs RF12 library and Arduino
Extended for 3-phase operation: Robert Wall
V.1 7/11/2013 Derived from emonTx_CT123_3Phase_Voltage.ino
V.2 28/1/2015 Altered to use low-pass filter and subtract the offset, to remove filter settling time.

emonTx V3 Shield documentation:http://openenergymonitor.org/emon/modules/emonTxV3
emonTx firmware code explanation: http://openenergymonitor.org/emon/modules/emontx/firmware
emonTx / emonTx Shield calibration instructions: http://openenergymonitor.org/emon/buildingblocks/calibration

REQUIRES in [Arduino]/libraries
avr/wdt.h // the UNO bootloader
RFu_JeeLib.h // Download RFu_JeeLib:GitHub - openenergymonitor/RFu_jeelib: Modified version of the JeeLib RFM12B wireless radio driver for use with the Ciseco RFu 328 units V1.x with an RFM12B

log from emonhub 
2020-03-11 22:32:14,245 DEBUG    RFM2Pi     acknowledged command:  b      - set MHz band (4 = 433, 8 = 868, 9 = 915)
2020-03-11 22:32:14,351 DEBUG    RFM2Pi     acknowledged command:  g    - set network group (RFM12 only allows 212, 0 = any)
2020-03-11 22:32:14,456 DEBUG    RFM2Pi     acknowledged command:  c      - set collect mode (advanced, normally 0)
2020-03-11 22:32:14,562 DEBUG    RFM2Pi     acknowledged command: ..., a - send data packet to node , with ack
2020-03-11 22:32:14,667 DEBUG    RFM2Pi     acknowledged command: ..., s - send data packet to node , no ack
2020-03-11 22:32:14,710 INFO     MainThread Setting emoncmsorg url: http://emonpi
2020-03-11 22:32:14,772 DEBUG    RFM2Pi     acknowledged command:  l      - turn activity LED on DIG8 on or off
2020-03-11 22:32:14,977 DEBUG    RFM2Pi     device settings updated: 69 i5 g212 @ 433 MHz  Lock: 1
2020-03-11 22:32:24,331 DEBUG    RFM2Pi     701 NEW FRAME : 10 0 0 0 0 0 0 0 0 0 0 218 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-03-11 22:32:24,333 WARNING  RFM2Pi     701 RX data length: 24 is not valid for datacodes ['h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'L']
2020-03-11 22:32:35,326 DEBUG    RFM2Pi     702 NEW FRAME : 10 0 0 0 0 0 0 0 0 0 0 218 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-03-11 22:32:35,327 WARNING  RFM2Pi     702 RX data length: 24 is not valid for datacodes ['h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'L']
2020-03-11 22:32:46,397 DEBUG    RFM2Pi     703 NEW FRAME : 10 0 0 0 0 0 0 0 0 0 0 218 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-03-11 22:32:46,398 WARNING  RFM2Pi     703 RX data length: 24 is not valid for datacodes ['h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'h', 'L']

from serial output
serial output

i use

  emonTxV3 Discrete Sampling
  If AC-AC adapter is detected assume emonTx is also powered from adapter (jumper shorted) and take Real Power Readings and disable sleep mode to keep load on power supply constant
  If AC-AC addapter is not detected assume powering from battereis / USB 5V AC sample is not present so take Apparent Power Readings and enable sleep mode
  Transmitt values via RFM12B radio
  Part of the openenergymonitor.org project
  Authors: Glyn Hudson & Trystan Lea 
  Builds upon JCW JeeLabs RF12 library and Arduino 
  Licence: GNU GPL V3


/*Recommended node ID allocation
-ID-	-Node Type- 
0	- Special allocation in JeeLib RFM12 driver - reserved for OOK use
1-4     - Control nodes 
5-10	- Energy monitoring nodes
11-14	--Un-assigned --
15-16	- Base Station & logging nodes
17-30	- Environmental sensing nodes (temperature humidity etc.)
31	- Special allocation in JeeLib RFM12 driver - Node31 can communicate with nodes on any network group

Change Log:
V2.0 (19/06/15) : Add support for new interrupt pulse counting sensor, multiple temperature sensors & new V3.4 compatiable packet structure
V1.3.1 - Remove filter settle routine as latest emonLib 19/01/15 does not require 
V1.3 - fix filter settle time to eliminate large inital reading
V1.2 - fix bug which caused Vrms to be returned as zero if CT1 was not connected 
V1.1 - fix bug in startup Vrms calculation, startup Vrms startup calculation is now more accuratre

#define emonTxV3                                                      // Tell emonLib this is the emonTx V3 - don't read Vcc assume Vcc = 3.3V as is always the case on emonTx V3 eliminates bandgap error and need for calibration http://harizanov.com/2013/09/thoughts-on-avr-adc-accuracy/

#include <RFu_JeeLib.h>

my problem is that i dont get the input in emonpi.

My guess was correct. These two lines do in fact tell you all - when you know the secrets.

NEW FRAME : 10 tells me that your V3.2 is NodeID=10
data length: 24 is not valid for ... tells me that the entry in emonhub.conf does not match the data that your sketch is sending.

Now - the first problem, you have a sketch that will not give you the correct values for a 3-phase system. The sketch you have is only for a single phase UK mains supply.

The sketch you want is NOT GitHub - openenergymonitor/emontx-3phase: emonTx 'approximate' 3-phase firmware - that will not work on your V3.2, the sketch you need appears to have been deleted from GitHub.

So here it is:
emonTxV3_3Phase_Voltage.ino (23.4 KB)

Note line 26. You must have the RFµ library for your V3.2

All the instructions to set up and calibrate the sketch are in the comments at the beginning.

When you get that working, you need to edit the entry in emonhub.conf. You can do this in your web browser from emonCMS.
Go down to the block that looks like this:

    nodename = emontx1
       names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
       datacodes = h,h,h,h,h,h,h,h,h,h,h,L  
       scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
       units = W,W,W,W,V,C,C,C,C,C,C,p

This is for Node 10

You need to change it to match the data structure in line 170, so change it to

    nodename = emontxV3.2
       names = power1, power2, power3, power4, vrms
       datacodes = h,h,h,h,h
       scales = 1,1,1,1,0.01
       units = W,W,W,W,V

When posting code, put three backticks ``` only a line before the code, and another 3 only on a line after the code.

// This is a comment in the code

tnx for the sketch.

i just found out that emonhub setup and i have now the inputs.

tnx for your tips and guide. :smiley:

do you have a sketch that also support temp onewire?

Not for the V3.2, but it should be possible to add it to that 3-phase sketch. You will need to take the temperature measurement parts out of the sketch you originally used and merge them into the 3-phase sketch.

emonTxV3_3Phase_Voltage.ino (23.4 KB)

im trying to get this sketch with temp. ds1820 one wire.
anyone that can guide or show me where to input code for one wire. i tryed but compile failed and it seems like im not understand it 100%.

Thinking further about your problem, it might be easier for you to use the modern 3-phase PLL sketch. Although this does incorporate temperature measurement, only one temperature sensor may be used, and it will not work with the RFM12B radio that your emonTx V3.2 uses.

The code that drives the RFM69CW is a separate file, and I have an equivalent file for the RFM12B radio. I have not tested it with the 3-phase sketch, I might be able to do that for you in the next few days. If you think the sketch will be useful to you, I will do that, but you must wait for a few days until I have the time to do it. Please let me know if you would like me to do that.

Hello Robert

tnx for your good support.

It would be nice if you had time to do it. I think it will help me a lot. then at the same time I can learn from what you change in the sketch.

I want to test esp connected serial. maybe i can change the hardware to work with esp and don’t need rfm12b.

If you want to use the ESP8266, then the radio is disabled automatically when the option for the ESP8266 is selected, so you can use that sketch without modification.
There is also an option to set the I/O pin assignments for the emonTx V3.2. Be sure to download and read the PDF file that explains all the settings.