EmonESP does not connect to emonCMS

@Robert.Wall, yes, as I am in Germany we are using a four wire system. Does this affect the function of the sketch, even if there are just 3 live wires? I always thought the 3-phase sketch is exactly made for the the field of application that I am using in right now?!

Yes it is - AND for the 3-phase system where there is no neutral wire.

In your 4-wire system, you measure the voltage from L1 – N, and L2 is 120° later and L3 is 120° later than that.

In a 3-wire system, you can only measure the voltage L – L, so you treat L3 as the neutral and measure voltage L1 – L3, and then L2 lags 60° behind L1.

But because the ‘neutral’ or L3 carries part of the power, the individual power for L1 and L2 has no meaning in reality, and that is why it adds CT1 & CT2 powers and prints CT2 power = 0.

#define WIRES 4-WIRE or #define WIRES 3-WIRE is the switch that changes the timing and the print output.

2 Likes

@Robert.Wall, thank you for your explanation.
Actually I have set the switch to
#define WIRES 4-WIRE
I just looked into the last sketch I have uploaded to my TX. So that shouldn’t be the culprit

It defaults to 4-WIRE, and both are the same anyway up to “CT2:” and then 3-wire prints “0.0” and your prints a number.

So I think EmonESP is putting the comma on the front.

@Robert.Wall, could @stephan20 monitor what the TX is passing to the EmonESP to check? (I’m sure there is but…)

Sorry, I can’t help there. All I did to add the ESP output format was steal it from another sketch. If there’s an FTDI connector free, or a means to tap onto however the ESP connects to the emonTx, it might be possible to use the Arduino monitor to watch what’s going down the wire.

Could you unplug the EmonESP to view the data as a test?

It seems there may be a debug function in the EmonESP so you can see what it has received

@borpin, you mean logging the serial output of the TX with a FTDI. Sure that shouldn’t be a problem, but I guess I will do this another day because my TX is mounted in the neighbors house. It’s a little too late now for working there :wink:

How do I get this data? Connect a ftdi to the emonESP while it is connected to the TX and then start the serial monitor? I am a bit confused

Sorry, I don’t know, I just looked at the code and could see it printed out (somewhere) what it had received. Trying to work out what it then does with it, but cpp is not my strenght :slightly_smiling_face:

The current version on GitHub differs to what you posted above

in the current GitHub version, 4-WIRE (ie the #else) has a leading comma on “,ct1:” so it looks like its coming from the sketch, unless another version is in play and it’s just coincidentally the same error.

That is exactly the sketch that I am using on my emonTX. Looks like the leading comma in the else section is the problem

And therein lies the issue

Version control…

So, let me try to upload the V1.6 to my TX on tuesday. Hopefully this will fix my CMS problem :slight_smile: So far, thank you to all contributors

Yes, there is also a typo issue with 4-WIRE setting in the emonESP code. Check after ‘else’… (line before else was corrected yesterday.)

#if defined EMONESP && !defined SERIALOUT
#if WIRES == 3-WIRE
Serial.print(F("ct1:")); Serial.print(realPower1+realPower2);            // These for compatibility, but whatever you need if the receiver is configured to suit. 
Serial.print(F(",ct2:0.0"));
#else
Serial.print(F(",ct1:")); Serial.print(realPower1);
Serial.print(F(",ct2:")); Serial.print(realPower2);
#endif

I have updated the git repository to mirror @Robert.Wall’s v1.6 and taken the oppertunity to use git annotated tags: Release v1.6 fix for incorrect space character in the formatted output · openenergymonitor/emontx-3phase · GitHub Did I get it right @borpin?

This topic was the 4-WIRE comma issue
This topic was the 3-WIRE space issue

1 Like

Looks like it :grin: although it only ever shows me the latest tag from the command line for some reason.

Just one thing to be careful of, be consistent in the format you use. v1.6, is different to V1.6 which is different to 1.6 and previous versions were 1.x.0

It doesn’t matter what you use, just be consistent.

Just wanted to tell you, that everything works fine after flashing the fixed V1.6 to the TX.
The emonESP connects correctly to the emonCMS

1 Like