Brultech ECM-1240 Energy Monitor

Sean,
When it occurs next, can you email me a copy of your complete log file? I’m guessing I’ll need the whole file in order to debug it and capture the right messages from the Plugin itself. I suspect the last-event occurrence data has probably disappeared from your logs by now.

You already have my Email address, so you don’t need to post that content here (in case it’s sensitive in any way).

Sean,
I’ve uploaded a new copy, which includes some new files, and changed the installation instructions at:
Installation-UI4 – Brultech Power Monitor

there are a bunch of new files that now need to be uploaded, so you might as well upload all 9x of them. They’ll overlay any existing config since I haven’t changed any names, just added a few, and a little refactoring of the code to get ready to support native/raw format.

It adds the poll() method we discussed, that executes every 5 minutes, to attempt to “reset” the connection in the power outage situation you’d experienced. Let me know how that goes, since it’s a bit of an experiment. If it works-around the issue successfully, I’ll open a Ticket to get MCV to fix that particular situation with [TCP-Based] IO dropouts.

As a potentially related issue, if you have two ECM units, and they “start” at the same time (after a power failure) then they’ll routinely transmit data “at the same time”. This causes data collisions, so you’ll want to see each ECM to a slightly different data publication/update frequency.

eg. 50s for the first, 51s for the second, 52s for the third, and so on…

So close, but I need help.

I’m not seeing values in the web interface (see attachment).

I do see data in the LuaUPnP.log

08/28/11 20:10:28.619 luup_log:25: Brultech PowerMeter: debug: processIncomingText:: Buffer=sec=190566&v=1253&c1w=5179&c2w=2734&wsa1=624668649&wsa2=317966239&wsap1=16&wsap2=29941&A1w=&A1ws=38425565&A2w=85&A2ws=4721477&A3w=286&A3ws=42990710&A4w=434&A4ws=28007620&A5w=337&A5ws=23881848&dev=34180&id=3&Resp=, Length=212 <0x3c10>
50 08/28/11 20:10:28.620 luup_log:25: Brultech PowerMeter: debug: Skipping buffer=sec=190566&v=1253&c1w=5179&c2w=2734&wsa1=624668649&wsa2=317966239&wsap1=16&wsap2=29941&A1w=&A1ws=38425565&A2w=85&A2ws=4721477&A3w=286&A3ws=42990710&A4w=434&A4ws=28007620&A5w=337&A5ws=23881848&dev=34180&id=3&Resp= <0x3c10>
50

I’m using a wiznet serial to ethernet converter and have the Brultech in ASCI mode obviously.

Any ideas?

You are nearly there, there’s a prefix missing:

[tt]50 08/28/11 17:49:56.769 luup_log:234: Brultech PowerMeter: debug: processIncomingText:: Buffer=GET /usr/uuuuuuu/dev.php?sec=4044681&v=1216&c1w=&c2w=&wsa1=386751&wsa2=1129950&wsap1=119384&wsap2=400521&A1w=&A1ws=89628&A2w=&A2ws=164811&A3w=&A3ws=&A4w=&A4ws=47655&A5w=&A5ws=347427&dev=xxxxx&id=2&Resp= HTTP/1.0, Length=210 <0x4c12>
[/tt]

as mine is still uploading to Brultech’s my1240.com service (for now)

I hunt for a pattern like:
[tt] local result = s:match(“^[b]GET /.+%?/b HTTP/%d%.%d$”)[/tt]

so it doesn’t really matter what that leading part of the string looks like, but it does need that general form.

There should be a spot to put that into the configuration, probably near where you configured it over to ASCII format.

I played around trying to configure the ECM-IA app (set url info menu option) to output with the text you mentioned, but no avail.

Instead I tried forcing it by changing a function in L_BrultechMeter1.lua (I know this isn’t preferrable, I just want to get it working ::))

function processIncomingText(s)
debug(string.format(“processIncomingText:: Buffer=GET /usr/uuuuuuu/dev.php?%s, Length=%s”, s, tostring(s:len())))

local result = s:match("^GET /.+%?(.-) HTTP/%d%.%d$")

if (result ~= nil) then
    decodeBufferText(result)
else
    debug("Skipping buffer=GET /usr/uuuuuuu/dev.php?" .. s)
end

end

The output in the log file looks correct, but it’s still not showing any data in the UI4 gui :frowning:

08/29/11 10:57:59.980 luup_log:58: Brultech PowerMeter: debug: processIncomingText:: Buffer=GET /usr/uuuuuuu/dev.php?sec=243774&v=1253&c1w=644&c2w=&wsa1=785931537&wsa2=394009123&wsap1=16&wsap2=32849&A1w=&A1ws=46067518&A2w=10&A2ws=6486579&A3w=138&A3ws=54418949&A4w=22&A4ws=32387183&A5w=25&A5ws=30193765&dev=34180&id=3&Resp=, Length=205 <0x3c10>
50 08/29/11 10:57:59.981 luup_log:58: Brultech PowerMeter: debug: Skipping buffer=GET /usr/uuuuuuu/dev.php?sec=243774&v=1253&c1w=644&c2w=&wsa1=785931537&wsa2=394009123&wsap1=16&wsap2=32849&A1w=&A1ws=46067518&A2w=10&A2ws=6486579&A3w=138&A3ws=54418949&A4w=22&A4ws=32387183&A5w=25&A5ws=30193765&dev=34180&id=3&Resp=

If you want the “quick hack”, until you configure the ECM-IA component correctly, make the following change:

FROM:
[tt] local result = s:match(“^GET /.+%?(.-) HTTP/%d%.%d$”)[/tt]

TO:
[tt] local result = s:match(“^(.-) HTTP/%d%.%d$”)[/tt]

But you really need to find that string in their tool…

Still no luck even with the hack. Attached are some screenshots of the configuration. I don’t know what else to do. I spent all weekend on it :frowning:

I think I see the problem now, I should have paid more attention when you first posted data.

The ECM-1240’s actually have 3 modes of data transmission:

[ul][li]Binary[/li]
[li]HTTP[/li]
[li]ASCII[/li][/ul]

and there’s an item on the ECM-1240 Setup Tab of the IA tool that lets you select which you want. In the case of the original Plug-n-Play models, they upload to My1240.com over HTTP.

The HTTP Format is almost the same as the ASCII format, except each line begins with “[tt]GET /…?[/tt]” and ends with “[tt]HTTP/1.0[/tt]”

If you look back at your logs, and compare them to mine, you’ll see that as a difference so that’s why the Pattern-match hack that I gave you isn’t working (since there’s not “HTTP/1.0” on the end)

Anyhow, in the IA tool, change the setting to “[tt]HTTP[/tt]” (from “[tt]ASCII[/tt]”) and then Save. That should force the log to look like the one that I posted.

You may also need to setup the IA Settings under the Menu “Set URL Info”, as I’m not sure what the defaults are there.

Mine has:

POST Root URL: [tt]my1240.com[/tt]
POST URL extension: [tt]/usr/ba/dev.php[/tt]

but I’m assuming those are default(s).

Anyhow, give that a whirl and post your logs as needed.

That did it!

I tried HTML mode previously but I suppose I wasn’t patient enough. The disadvantage is the 10 second polling interval instead of 2 seconds (<10 seconds is just greedy anyway ::slight_smile: )

Thank you very much for #1 developing the plugin, #2 supporting me!

Side note, I’m not uploading to my1240.com and didn’t need to configure “Set URL info” in the IA.

I’m trying to get my Brultech working with Vera and could use some help. I have the Brultech connected via an EtherBee device. When I use the Brultech software on my PC, I am able to receive data as expected.

I have installed the Brultech plug-in as well as the IPSerial plug in and configured that for the EtherBee device (port 4883). When I reboot Vera, it attempts to open the IO port but fails (error is: “Brultech [45] Failed to open IO port”)

Any ideas as to what I have wrong?

Chris

With an EtherBee attached ECM, you don’t need IPSerial Plugin, as the Brultech plugin natively supports connecting to it. I’ve augmented the install instructions to give a starter/stub config for an EtherBee attached device. I’ve also uploaded the Build to the 0.1.5 ZIP file so you might want to download that to ensure you also have the latest.

You’ll want to “undo” the Serial-Port to Brultech attachment that you’ve done, and configure the Brultech’s IP Address instead (install instructions have a screenshot of this)

The EtherBee itself needs to be configured to send the HTTP-format messages (which was the default for the old Plug-n-Play models)

Deleted the serial port and followed your instructions - but still no luck. I’m looking at the logs and not seeing much. After a reboot I see:
01 10/03/11 9:20:06.859 luup_log:45: Brultech PowerMeter: Running Network Attached I_BrultechPowerMeter.xml on 192.168.13.7:4883 Device# 45, id <0x402>

Occasionally I see this:

01 10/03/11 9:37:15.860 IOPort::Connect connect -1 192.168.13.7:4883 <0x4011>
25 10/03/11 9:37:19.860 IOPort::Connect device 45 connecting to 192.168.13.7:4883 iodevice: 0 path (null) <0x4011>
25 10/03/11 9:37:19.861 IOPort::Connect connect 1: 192.168.13.7:4883 <0x4011>

But I can’t see any evidence that it is getting or parsing any of the data.

Any ideas?

I believe the IOPort::… messages come from the Serial layer, so there are likely still remnants of the Serial Port association left behind in the Serial Port Configuration UI.

If this is the case, make sure that the “Assignment” is blanked out, instead of being attached to the Brultech as you had in your past diagram.

Additionally, the Plugin was built for the original “Plug and Play” models of the Brultech (setup to talk to the my1240.com service). These come pre-configured a certain way that the Plugin is expecting, including:

a) Automatic Output of HTTP-style data every 50 seconds from each ECM-1240.
b) The EtherBee is configured in either “Mixed” or “Client” mode.

It’s been a while, but I believe I had to change the EtherBee to be in “Server” mode so that Vera could connect to it, this is done using one of the tools from Brultech (a tool somewhat shared with the WIZnets, since that’s 1/2 of what’s inside a EtherBee)

Any ECM-1240 can be configured in this way, it’s just that the “Plug and Play” models came preconfigured in that manner.

If either (a) or (b) is missing, then the MiOS Plugin will not be able to connect and “see” the data.

@mckervey, @smilligan,
Could one of you paste some screenshots of the Setup under Brultech’s Windows-based config tools? My Windows box is down and I cannot get into the tools to show the config.

That did the trick - I don’t have the PnP model but we now know we can get a non-PnP model into the proper mode. I reconfigured the Etherbee to mixed mode. Server mode works too, but doesn’t allow you to make changes via the IA tool. Mixed mode appears to allow your plug-in to work and allows me to make changes with the IA tool.

I have also played around with the Packet Send Interval. 30 seconds appears to be working just fine.

I will keep noodling with this over the next few days and report back if I see anything.

Thanks for your help and for the plug-in.

Cool. I chatted with @smilligan in the background, and he provided a few screenshots of the EtherX and ECM-IA Tools running with the “right” values in them.

I’ve uploaded these to the Wiki, for future reference:
Installation-ECM1240 – Brultech Power Monitor

They’re a bit crude, but they should give folks a better clue on how to reconfigure.

Thanks for the screenshots Sean, appreciated!!

One gotcha I encountered (and Brultech confirmed) was that after you switch to HTTP mode, you must reboot the ECM-1240 before you can set the POST URL. After setting the POST URL, perform another reboot and you are ready to go.

@ChrisAZ,
Thanks for that info, I’ve added it to the Reconfiguration instructions in the Install Wiki.

I now have 14 channels all [neatly] wired into my Sub-Panel (thanks to my father-in-law).

I can’t wait for their 32 channel “GreenEye” version to be available so I can re-purpose my ECM-1240’s for the Oven and AirCond (hanging directly off the main Panel, on the other side of the garage) and maybe water/gas metering.

Is it Christmas yet? ;D

Yeah, they’ve been in that mode for a while now. Really happy with my 2x ECM-1240 units, as I have more data than I can poke a stick at, but still lusting after “unbundling” my grouped channels…

So it’ll be either a GreenEye or a lump of Coal…