emonVS Power Supply reporting Strange voltages

Robert,… Just looking to upload new firmware,… 12CTs,… and removing the mains input voltage switch over,…
I have modified your script,… and I can apparently execute commands on my emonpiCMS,… But before I jump in and blow new firmware,… I have some questions if you be so kind,…
Currently,… my emontx4 I have radio control switched off,… data is just sent over USB-C,… will this setting and my CT setting 50A,… 20Amp etc be remembered,…( I have not changed since default I believe,… but that was some time ago ) or is this a case of setting in the new code,… ( which I have found I believe ).
And as Long as I keep the same ID’s then emonPiCMS will essentially ‘see no change’ in CT 1-6,… it will just have CTs 7- 12 to process now… on a new ID
And finally,… the HEX code at:-
emontx4/firmware/EmonTxV4/compiled at main · openenergymonitor/emontx4 · GitHub.

which is the default HEX firmware loaded,… when emonTx4 is purchased,… I just want this as backup so I can at least restore things back as was ‘new’… classic, native, and LPL… what are they pls…
Many Tx

What’s wrong with your editor - ellipses all over the place? What missing words is each intended to represent? If it’s a gimmick, it makes it too hard to read.

Sorry Robert,… I was just using the open energy web editor,… I have not knowingly added any crtl->characters,… I was just typing/entering via keyboard.
the only thing I cut and pasted was the Git-hub reference,… which seems to work for me when I view my post
…It looks ok to me,… baffled…

FWIW, I see the same thing Robert does. (the ellipses - the strings of periods) To wit:

and the original post Robert commented on:

Let me try again,… I have copied the file and loaded in into vi,… and cat’d the file output…:- so here goes ‘take2’
Robert,… Just looking to upload new firmware,… 12CTs,… and removing the mains input voltage switch over,…
I have modified your script,… and I can apparently execute commands on my emonpiCMS,… But before I jump in and blow new firmware,… I have some questions if you be so kind,…
Currently,… my emontx4 I have radio control switched off,… data is just sent over USB-C,… will this setting and my CT setting 50A,… 20Amp etc be remembered,…( I have not changed since default I believe,… but that was some time ago ) or is this a case of setting in the new code,… ( which I have found I believe ).
And as Long as I keep the same ID’s then emonPiCMS will essentially ‘see no change’ in CT 1-6,… it will just have CTs 7- 12 to process now… on a new ID
And finally,… the HEX code at:-
emontx4/firmware/EmonTxV4/compiled at main · openenergymonitor/emontx4 · GitHub 1.

which is the default HEX firmware loaded,… when emonTx4 is purchased,… I just want this as backup so I can at least restore things back as was ‘new’… classic, native, and LPL… what are they pls…
Many Tx

It looks the same to me – and it’s only your posts that look like that, everyone else’s come out just fine. Do you not see what Bill reproduced in his screenshot? I see exactly that. Everywhere there should be either a comma or full stop followed by a space, you, your machine or your web browser is sending comma, 3 dots and a space except at the end of a paragraph – you/it appears to get that right.

Bear in mind the Discourse editor will replace two full stops with an ellipsis.

Ahh, I do use triple full stops in places, but the png file looks fine to me, so odd
Anyhow, went back to vi, and deleted triple full stops, some were full stops, I discovered, but many ( that looked like full stops), were in actual fact a single character, which I can only assume led to the funny display. Hope this works ( no double or triple full stops ).

Take 3:-
Robert, Just looking to upload new firmware, 12CTs, and removing the mains input voltage switch over,
I have modified your script, and I can apparently execute commands on my emonpiCMS, But before I jump in and blow new firmware, I have some questions if you be so kind,
Currently, my emontx4 I have radio control switched off, data is just sent over USB-C, will this setting and my CT setting 50A, 20Amp etc be remembered, ( I have not changed since default I believe, but that was some time ago ) or is this a case of setting in the new code, ( which I have found I believe ). And as Long as I keep the same ID’s then emonPiCMS will essentially ‘see no change’ in CT 1-6, it will just have CTs 7- 12 to process now on a new ID And finally, the HEX code at:-
emontx4/firmware/EmonTxV4/compiled at main · openenergymonitor/emontx4 · GitHub 1.

which is the default HEX firmware loaded, when emonTx4 is purchased, I just want this as backup so I can at least restore things back as was ‘new’ classic, native, and LPL what are they pls
Many Tx

Now I can read it.

That single character is called an ellipsis. See Unicode Character 'HORIZONTAL ELLIPSIS' (U+2026)

You’ll need to get the answer to that from the sketch you’re going to use. If you use my demonstration sketch that is bundled with the distribution of emonLibDB, then absolutely nothing is saved. The easiest will be to start with “EmonTx4DB_max.ino” which has no radio commands in it, nothing to switch between “guessed apparent power” and real power, and then use the API commands
void EmonLibDB_set_vInput(uint8_t _input, double _amplitudeCal),
double _phase)
and
void EmonLibDB_set_cInput(uint8_t _input, double _amplitudeCal,
double _phase)
to set (i.e. edit: change the numbers) the required values for the necessary channels - all is fully documented in emonLibDB User Doc.pdf

Your best move will be to use the serial monitor to get the emonTx4 to list the configuration settings to screen, then copy and paste that into a text file for safekeeping. You can refer to the file when editing the new sketch.

Correct.

I have no control over what appears on Github, neither is it clear, either from the relevant “Shop” page or Github, which is the “Shop Default” sketch for any particular set of options on the order form. So I can’t say which sketch you had when you received it.

Hi Robert I have compiled and uploaded new firmware,… ( and it actually appears to be working ).
Well If I look in emonhub, it reports CT’s 1-12, (which has to be a plus.)
My only ( known ) problem is the CTs do not show up in emonPiCMS, and only only have 1-6 CTs listed,… which are not being updated,…
But the data is being broadcast on USB as follows;-

2024-04-17 12:59:56,661 DEBUG    MQTT       Publishing: emon/emonpi_5/t4 0
2024-04-17 12:59:56,662 DEBUG    MQTT       Publishing: emon/emonpi_5/t5 0
2024-04-17 12:59:56,663 DEBUG    MQTT       Publishing: emon/emonpi_5/t6 0
2024-04-17 12:59:56,664 DEBUG    MQTT       Publishing: emon/emonpi_5/pulsecount 0
2024-04-17 12:59:56,697 DEBUG    USB0       Analog in = 0
2024-04-17 12:59:56,800 DEBUG    USB0       Ch 1 I=3.230 W=699 VA=775 Wh=65 pf=0.9010
2024-04-17 12:59:56,903 DEBUG    USB0       Ch 2 I=0.113 W=4 VA=27 Wh=0 pf=0.1322
2024-04-17 12:59:57,005 DEBUG    USB0       Ch 3 I=0.108 W=8 VA=26 Wh=0 pf=0.2958
2024-04-17 12:59:57,108 DEBUG    USB0       Ch 4 I=0.088 W=3 VA=21 Wh=0 pf=0.1361
2024-04-17 12:59:57,211 DEBUG    USB0       Ch 5 I=1.968 W=445 VA=473 Wh=36 pf=0.9413
2024-04-17 12:59:57,315 DEBUG    USB0       Ch 6 I=1.192 W=173 VA=286 Wh=18 pf=0.6040
2024-04-17 12:59:57,418 DEBUG    USB0       Ch 7 I=0.022 W=0 VA=5 Wh=0 pf=0.0016
2024-04-17 12:59:57,521 DEBUG    USB0       Ch 8 I=0.022 W=0 VA=5 Wh=0 pf=-0.0401
2024-04-17 12:59:57,624 DEBUG    USB0       Ch 9 I=0.009 W=0 VA=2 Wh=0 pf=-0.0429
2024-04-17 12:59:57,728 DEBUG    USB0       Ch 10 I=0.009 W=0 VA=2 Wh=0 pf=-0.0277
2024-04-17 12:59:57,831 DEBUG    USB0       Ch 11 I=0.008 W=0 VA=2 Wh=0 pf=-0.0393
2024-04-17 12:59:57,934 DEBUG    USB0       Ch 12 I=0.009 W=0 VA=2 Wh=0 pf=-0.0890
2024-04-17 13:00:01,557 DEBUG    EmonPi2    735 NEW FRAME : OK 5 162 2 81 0 243 2 38 92 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (-0)
2024-04-17 13:00:01,559 DEBUG    EmonPi2    735 Timestamp : 1713355201.557728
2024-04-17 13:00:01,559 DEBUG    EmonPi2    735 From Node : 5
2024-04-17 13:00:01,559 DEBUG    EmonPi2    735    Values : [674, 81, 755, 235.9, 0, 0, 0, 0, 0, 0, 0]
2024-04-17 13:00:01,560 DEBUG    EmonPi2    735 Sent to channel(start)' : ToEmonCMS
2024-04-17 13:00:01,560 DEBUG    EmonPi2    735 Sent to channel(end)' : ToEmonCMS
2024-04-17 13:00:01,792 DEBUG    MQTT       Publishing: emon/emonpi_5/power1 674
2024-04-17 13:00:01,793 DEBUG    MQTT       Publishing: emon/emonpi_5/power2 81
2024-04-17 13:00:01,794 DEBUG    MQTT       Publishing: emon/emonpi_5/power1pluspower2 755
2024-04-17 13:00:01,795 DEBUG    MQTT       Publishing: emon/emonpi_5/vrms 235.9
2024-04-17 13:00:01,796 DEBUG    MQTT       Publishing: emon/emonpi_5/t1 0
2024-04-17 13:00:01,797 DEBUG    MQTT       Publishing: emon/emonpi_5/t2 0
2024-04-17 13:00:01,798 DEBUG    MQTT       Publishing: emon/emonpi_5/t3 0
2024-04-17 13:00:01,799 DEBUG    MQTT       Publishing: emon/emonpi_5/t4 0
2024-04-17 13:00:01,800 DEBUG    MQTT       Publishing: emon/emonpi_5/t5 0
2024-04-17 13:00:01,800 DEBUG    MQTT       Publishing: emon/emonpi_5/t6 0
2024-04-17 13:00:01,801 DEBUG    MQTT       Publishing: emon/emonpi_5/pulsecount 0
2024-04-17 13:00:01,964 DEBUG    EmonPi2    736 NEW FRAME : OK 24 182 0 0 0 204 1 26 0 1 0 0 0 (-62)
2024-04-17 13:00:01,965 DEBUG    EmonPi2    736 Timestamp : 1713355201.964103
2024-04-17 13:00:01,965 DEBUG    EmonPi2    736 From Node : 24

I thourght for a while I was on to something,… now I have come across a brick wall in that avdude does not want to play ball with the command that had previously workd??

avrdude -C/opt/openenergymonitor/EmonScripts/update/avrdude.conf -v -pavr128db48 -carduino -D -P/dev/ttyUSB1 -b115200 -Uflash:w:$targetfile:i

Hello @diyhouse (@Robert.Wall on the phone with Mark as I type this)

Here’s the firmware example that you need that will print in the right format that emonHub can pickup:
https://github.com/openenergymonitor/emontx4/tree/main/firmware/EmonTx4_DB_12CT_WiFi

This prints data to serial in the following format:

MSG:1,V1:243.23,P1:100,P2:200,P3:300...  up to P12:Value

EmonHub will pick this up and forward via MQTT to Emoncms.

This firmware example was initially developed for use with the EmonESP WiFi module and so only prints out the voltage and power values but it works fine with the EmonHub interfacer that reads from the USB port

I’ve deleted my reply to @diyhouse’s pleas - I was clearly wasting my time trying to help.

1 Like

Apologies @Robert.Wall I should have tried to help earlier.

@diyhouse I’ve now updated the firmware example to remove the unused and commented radio code. It’s a lot cleaner now and should be easier for you to adapt as needed.

This is what the raw serial print out looks like as viewed in the Arduino serial window. I havent got the expansion board plugged in, hence random values on those channels:

EmonTx4_DB_12CT_WIFI
Starting reports every 9.80 seconds approx
MSG:1,V1:241.83,P1:0,P2:0,P3:0,P4:0,P5:0,P6:0,P7:2,P8:5,P9:7,P10:9,P11:12,P12:18
MSG:2,V1:241.95,P1:0,P2:0,P3:0,P4:0,P5:0,P6:0,P7:2,P8:4,P9:6,P10:9,P11:12,P12:18

EmonHub will be able to read this in and will then pass this data on to Emoncms.

EmonTx4_DB_12CT_WiFi

[With my newbie hat on]
So this is suitable for a direct serial connection to the emonPi2? How was I to know this from the name? It’s not even listed here Firmware — OpenEnergyMonitor 0.0.1 documentation at all, in fact there’s nothing there for 12 c.t’s. It never occurred to me to look in Github at something with Wi-Fi on the end of the name and have to read the bit at the top that says it can be used for a direct serial link after all.

[With my contributor of a dozen years hat back on…]
Is it really that hard to provide a list in plain English, or as a table, of sketches suitable for the various possible arrangements that newbies (and oldies who haven’t kept up with developments and are upgrading) can understand?

If you want to know OEM’s greatest failing, it is providing (almost) all the information anyone could conceivably need, and at the same time making it impossible to find it.

2 Likes

Robert,… Many tx for your help here,… without your help, and pointers I would have not been able to appreciate what to look for as you might say, and what to edit.
I am pleased, ( finally ) to report I have my 12 CT ( Only nine installed ) board with a sketch that does not switch to a default input voltage, although it does sit at around 10v, but I’m not complaining, that’s close enough for me ( which is where this thread started, the 12 CTs came along the way and seemed appropriate to kill two birds with one stone as they say ), and is radio free, as I feed directly from EmonTx4 into my EmonPi.
Which I now understand takes serial.print data, ( of the correct format, essentially comma delimited pairs ) into the EmonHub service, and then re-formats to a common format used and processed by EmonCMS.

1 Like

In response to Roberts comments,… as a relative Newbie,… when planning my upgrade,… I was looking for compiled hex code ,… format that I could ‘fall back on’ and upload, should my updates mess things up completely, ( a plan B if you like ). But to this end I was unsuccessful, ( and I read a lot of forum and wiki stuff ) I just had to hope when I compiled and uploaded it worked.
Sketches need a version number in their filename, please, the description can go inside.

And as part of the admin/updates page of emonPi ( or equiv. ) it would be really useful to be able to upload a default firmware, ( to any openenergy device ) or maybe select an alternative of the desktop. ( this would make applying updated sketches more idiot proof ).

I love what you guys are doing / done, pls be considerate to the not so knowledgeable users hunting for things. Programmers know where everything is ( they wrote it ) and know what s/w is supposed to do, the minions are not so lucky and we have to sometimes stumble upon solutions

Apologies @Robert.Wall! you’re right of course. I’m preparing now for the EmonTx5 firmware release and I’m trying to rationalise these different variants. I will update soon with the result of this.

Where did you get to with this? what was the reason for this incorrect voltage, are you editing the sketch to use the current values given that the real power values cant be correct if the voltage is not correct?

I’ve renamed the firmware to EmonTx4_DB_12CT_serial and added this to the available firmware list in the docs, apologies for not doing this sooner!

This is just ‘what is reported’ by my EmonTx4, the measured voltage is zero I ( check out my scope trace from the 18 Feb in this thread ) believe, as it comes from my EV supply, which I can easily isolate.
But Here is my display during a simulated power outage today,… rather than the previous square wave where the emonTx4 switches back to default, every now and then.