OpenEnergyMonitor Community

emonTxV3 stops and requires reboot (emonhub)

Tags: #<Tag:0x00007f1bd8686708> #<Tag:0x00007f1bd8686618>

I’m using two SCT023R CTs on the mains. I will try shorting the plug with a lead clip or something like that as I don’t like to put my hands in the breaker box if it’s possible to avoid it. I don’t think these CTs have protective diodes.

I’m having my hot water boiler replaced next week so probably won’t try anything until that is finished, hopefully in several days.

Is there anything that needs to be updated on the emonTX3 that I should do while I have it opened up?

Thanks again for your help and I’ll probably get back to you in a week or so. Hope your weather is better in the UK as we will most likely hit 100 F. today and tomorrow.


Let’s not even go there. I understand why you’re tempted, but we don’t want to introduce any more variables into the problem.

There’s no suggestion that they have, so we must assume that they have not, therefore you must isolate, unplug and short the c.t. before energising the circuit again. And the same again when plugging back in.

In order to find out whether the problem is due to the voltage level, the emontx could also be powered via a USB power supply instead of the voltage reference transformer.

I am using the ac/ac transformer because it was recommended as the most accurate. With USB power what sort of calibration changes would I have to make? Thanks.


But you should remove the link on the p.c.b. next to the battery holder.

The USB power supply is presumed to have a larger reservoir capacitor that will carry the emonTx over short brown-outs, whereas in order to avoid inaccuracies due to distorting the waveform from the a.c. adapter, the emonTx’s internal supply uses the smallest practical reservoir capacitor, which barely carries it over one mains cycle (of ours - for you at 60 Hz, the position is slightly less critical, but it still won’t carry it over 2 cycles).

Not strictly true, in fact the USB supply should be more accurate, because it won’t distort the measured wave shape. But the internal supply may well be quieter, meaning that the reading you get with no actual current flowing should be smaller.

With the emonTx located only 3 foot from the emonBase, I would be more than tempted to use a usb lead and usb to serial adapter to connect the emonTx directly to the emonBase. This would give you a better power (potentially more accurate data due to not powering via the AC:AC) and no risk of RF issues, regardless of whether the RFM defective or not. The down side is if the cable and adaptor are on show it’s not the best looking option. But it the rfm module is terminally ill, a usb adapter is much cheaper than a new emonTx if you are not able to replace the rfm module yourself.

Paul, how difficult and expensive would it be to replace the RFM module on the emonTXv3? If it’s SMT components that have to be removed and replaced then I’ll pass.

I can try the direct USB from the Pi using the FTDI I purchased with the emonTX. I did notice in the notes that this method of power is not recommended except for programming.

I also have a Pi power supply I could use to directly connect it to 5V through the USB on board. However, I guess this would not solve anything if it’s the RFM.

Once the emonTX is connected to the Pi via USB port (/dev/ttyAMA0) does the communication begin automatically or do I need to change something in the config?
Also, once I begin using DC power (either USB or FTDI) and I cut the PCB link, do I leave the AC/AC power connected (I realize that it no longer powers the unit) or just remove it?

Sorry for all of these naïve questions but I’m out of my league here and want to be sure I am doing things correctly. Many thanks.

Answering the ones I can:

Very difficult - and you could easily damage your emonTx, and that becomes expensive. You need to simultaneously melt the solder on two rows of 7 connections - see the picture
(It’s the green piggy-back pcb top left.)

But it might establish that it is not the RFM.

Removing the link (it’s on a two-pin header, so nothing to physically cut - just pull the jumper of both pins and put it back on one only for safe keeping) removes the d.c. power. You still want the a.c. to measure the mains voltage.

You might need to edit the sketch so that the output is in an acceptable format for emonHub to parse. The present sketch does that by default, but without checking back and knowing the version you have, I can’t say for certain. If you download the present one, then if you’ve calibrated yours and have a copy of your running sketch from which you can copy the calibration and compile it, I’d do that.

I think it will then work - but Paul will no doubt confirm this.

As Robert says, it is extremely difficult to change the RFM module, the modules themselves are pretty cheap, around a fiver maybe? But at best, it’s a nerve wracking job that is a total gamble and could cost you a emonTx.

You are not the first person to say this. I’m pretty sure wherever you read that, it’s just the way it’s worded. What it really means is to run the emonTx with the USB programmer AND the AC:AC link in place should be avoided except for programming perhaps, with that link un-linked, you can run the emonTx via the programmer forever, it’s just a different 5vdc supply, albeit a fairly low-current one, but there’s plenty of a run of the mill emonTx.

I has assumed you were on a later FW sketch, if that is the case, you simply need to define a new interfacer in emonhub.conf, pretty simple to do from the emoncms config page.

Since you already have a programmer I think you should get that hooked up to see what FW version you have and check the serial output.

Do you have SSH access to the emonBase? It doesn’t matter if you don’t, you could alternatively download and use the Arduino IDE on a PC, your choice. The emonBase does have an “emonUpload” program on it that can check and update the emonTx to the latest FW. If you have made calibration changes (to the emonTx not to emonhub.conf) you probably already have a preferred way to talk to the emonTx via serial.

I would also be tempted to see if the rfm module continues transmitting for an extended time whilst you have got the USB programmer attached, for that you should probably remove the link, but just to get the FW version and possibly update, you would be fine with the link in place still. However it might not be relevant if you are going to use USB instead of RFM, but it might be useful to know for sure if it’s the PSU or RFM. As a matter of interest, do you log line voltage? Is there any pattern like the line voltage is always low when the emonTx stops transmitting for example? It should be easy to see the periods that the emonTX wasn’t sending data as the graph will show a straight line between the last good data point and the first datapoint after a restart.

It’s possible there is a low voltage cause. I have attached a graph which shows July 14 and 20 drop outs, although it dips even lower in other places without shutting down.
vrmsgraph.pdf (383.9 KB)

I have loaded emonUpload on my Pi and will try reflashing the emonTXv3. My CT calibrations were made in the conf file so I’m not sure how to do it otherwise. Will these “scales” be affected (adjusted for SCT023R) by the new firmware in the emonTX?

Thanks and also thanks to Robert for his comments earlier.


That’s totally understandable.
If the dip cover the exact mains cycle or two where the emonTx transmits, it will fail much sooner than if the dip happens and recovers while it’s not transmitting, as I explained earlier.
This is how it looks (simulation) when just on the point of failing (60 Hz mains). The first dip is the LED flash, followed by the RFM transmitting:


But the voltage reported and graphed is the average voltage over the 200 ms sampling snapshot that’s repeated every 10 s. So there’s a very good chance that a short dip will never even be seen, let alone reported accurately.

Emonhub.conf? If so, no - you should be OK by reloading the emonTx sketch.

Ok, so it’s entirely possible that low ac voltage dips are really the culprit? We have been having a 10 days or more of high 90s temp here and there have been some very low points, 113-114 volts. Would a good test of this be adding a 5v power supply in addition to the ac transformer?

Yes. As I explained earlier, the 5 V d.c. supply has a reserve of stored charge that will carry it over a brief drop, certainly over a deeper and longer dip than the on-board supply can handle.

The problem probably isn’t the 113 V low points that you can see, but short (maybe only tens of milliseconds) dips down to a much lower voltage, as I calculated earlier, of below 90 V - and unless you are very unlucky with the components in your emonTx, probably below 80 V.

I’ve taken a screenshot of your pdf so we can see the graph without downloading etc.

To add to Roberts comments, on top of the sample rate and 10s averaging at source, you also have a very low resolution graph, the sample rate there is 3600s, so of each 360x10s datapoints recorded only one is displayed. That could be up to an hour either side of the voltage drop. If you zoom in you might get a very different picture.

But, it isn’t guaranteed to show exactly what we might hope, don’t forget that last good data point before the drop out is not the point at which it failed, the point at which it failed will never be caught in data, because it has failed.

My hope was that checking the graph would perhaps just show that failures tend to occur at times of low voltage, which I think appears to be the case.

In addition to the possible “bad luck” with regard to component tolerances and the voltage drops, the high ambient temperature might (or might not) also be adding to your woes, is the emonTx or the AC adaptor located where it might be getting hotter than it needs to be? eg is it a ventilated area? Is it in direct sunlight? Do you recall if it happens during the cooler times of day?

It would indeed, you might also consider trying to make it run cooler some how to see if that has any impact, shade it, open the cabinet door, put a fan on it temporarily etc, perhaps as a separate test though.

Although, I have to say, I would personally opt for the USB method either way, in fact I would have probably installed it that way from the outset. The option of eliminating any possibility of RF dropouts and getting a more accurate AC waveform without adding another PSU to the mix (more heat, more energy consumption and another power outlet occupied). Depending on how far you want to roll your sleeves up, I would probably adapt the emonpi sketch from 2CT to 4CT and then hook up the emonTx direct to the Pi’s GPIO in place of the RFM69Pi and receive the emonTH’s via the emonTx (thus no USB adaptor is needed). Obviously this is far more involved and only an option if your RFM module on the emonTx is A OK.

I would have concurred up until a week or so ago, when I measured the “no line current” output in identical circumstances except for the power source: in one test the internal a.c. supply and in the other the “shop” USB 5 V supply. The USB “power” - falsely indicated - was higher.

So if “no (or low) power” measurements are critical, it’s something to be borne in mind. Otherwise, use the USB power.

A reminder from history: the internal a.c. power supply was added for exactly the reasons you state: one less socket outlet, one less power supply and potentially lower losses.

Ok, I have added a 5v USB supply to the mix with no changes to anything else. The emonTx went down again last night so that makes 4 or 5 times in the last week (as opposed to once every 5 or 6 weeks before).
The weather is bad outside which may account for the low voltage dips I have been having. Inside I never have more than 80 F where the emonTx and Pi are located. The ac transformer is only slightly warm to the touch.
It seems to be happy for now so I will see if I have any more drop outs.

Many thanks again for all the help and I will keep you posted on my results. Hopefully this will take care of it.

Just to be absolutely clear, the 4 or 5 times and last night were all before you added the USB power supply?

Yes, I just added the 5v USB supply. All drop outs were without the additional DC.

Ok, so far so good. The mains voltage has been all over the place (114-122 volts) and things have held steady with no drop outs for over a week. It will take longer to be sure, but I think the addition of the 5 Volt supply did it.

I’m still not clear on one thing. The wiki states, “When powering the unit via 5V USB/battery it is advisable to remove the JP2 jumper if an AC-AC adapter is present.” I have not done this and assume that JP2 is in place as I was first using the AC/AC supply only. Now with both DC and AC/AC being used, and JP2 in place, everything is working and I’m getting the 10 second LED flashes on the emonTX.

All the help is much appreciated and hopefully my problem has been solved.
Thanks again,

JP2 is the place where the two sources of current join so that either can power the circuit. JP2 is there so that the feed from the a.c. adapter can be cut off so that the USB supply doesn’t back-feed into that regulator i.c.

As Paul said, it’s advisable to remove the jumper - though I admit I rarely bother - but then I use the emonTx for development and support, it’s not a permanent fixture.