Unstable emonTX / emonESP operation

I’ve been collecting data with my emonTX running the 3phase firmware (I compiled both firmware so they use 9600 bps), but I noticed that the data collection stops every now and then. The symptoms are:
CT numbers not updating on the emonESP
MQTT & emonCMS connections stop, even though the emonESP is accessible over wifi

Sometimes rebooting the emonESP fixes it, some other time I have to power cycle the emonTX to make it work again. I attached a screenshot for reference below.

Any idea how to troubleshoot this? Can we somehow leverage the watchdog in the ESP8266? I see no option for that in the web page. Also, any ideas on the root cause? I’m using a HLK-PM01 to power it, that can do 5V/3W, that should be enough for the emonTX & emonESP, no?

According to my maths, 3 W at 5 V is 600 mA. I believe the ESP8266 can draw about 800 mA. So I would strongly suspect that the power supply is failing momentarily.

1 Like

emonESP - one for @glyn.hudson.

I have added an 5V / 1.2A power supply to see if that’s enough to keep the device operational.

I didn’t have access to the data when I wrote that, and it appears it’s likely to be significantly less than that, although I cannot find a “worst case” value quoted, only a ‘typical’ one - which isn’t very helpful in these circumstances.

So I think a 600 mA supply should be adequate, but if it’s “noisy” or prone to drop-outs, then it’s still a prime suspect.

The sketch itself has been in use for a number of years by many people in continental Europe mainly, and there have been very few reports of problems.

I have switched over to a 1.2A power supply and I thought the problem has been solved but it happened once more - but only once. I will keep an eye on the thing and see what happens until the 2A power supply arrives. The esp had 24kb free ram left and interestingly that didn’t change with an esp reboot, I had to reboot the entire emontx to make it work again. I can’t do that from the emonesp, can I?

I do not have an ESP8266, so I cannot help you with that.

1 Like

Just wanted so share an update, the emonTX/emonESP kept freezing with a 1.2A power supply, so I replaced that with a 2A one and it seems to work stable with that. Perhaps this information could be added to the wiki page?

2 Likes

I’m afraid I spoke too soon, as it’s doing it again… Now it’s been hung for 44 hours, I just restarted it. Can somebody please help with how I could find out the root cause for these freezes?

It’s not the emonESP that hangs (I can access the web interface), that just keeps reporting the last values (and that connection to MQTT/EmonCMS has been lost) but if I reboot the emonESP, it’s still hung - I have to reboot the entire emonTX to make it work again.

@glyn.hudson @TrystanLea

As it may be difficult to replicate, it is difficult to debug by others. Do you have a spare RPi?

What is your level of expertise? I’m thinking the only way to be able to debug this is to connect the serial up to the esp and another receiver and see what is being transmitted over the serial link.

It would be, connect emonTX to breadboard, connect esp via breadboard, connect RPi or a programmer to the RX/TX as well. @Robert.Wall, would this work? As long as the second device is passive (i.e. no TX) will that work?

You’re talking to a hoarder, of course I do :slight_smile: I can set up a serial link, but I guess I’ll need a debug version of the emonTX 3phase firmware, right?

Also, I’m wondering if this can have anything to do with the fact that I can no longer flash my emonTX via the exposed UART? I can only flash via ICSP (I was using Arduino as ISP), I reported that in the other thread here: Setup 3-phase emonTX with emonESP using emoncms.org - #25 by Z0l

:rofl:

So the first step I suggest is to connect up an RPi to the serial (independently power the RPi) and collect the serial data and send to emoncms with emonhub.

see

If that is reliable, then the sketch itself on the emonTX is not the issue, the ESP is (which IMHO is more likely). If you feel like trying to discover why, you can then setup a debug and have a go at finding out what is causing it.

I don’t know, but connecting up an RPi gives you another means of flashing directly to try.

@Z0l is this an OpenEnergyMonitor shop bought ESP8266 adapter? Its important not to connect the TX line from the ESP to the RX line of the EmonTx as it can interfere with the configuration and could be leading to the behaviour you are seeing?

Yes, my order ID is #23389. The device came assembled and I am using the same internal connector (just disconnected the emonESP while I flashed a 9600bps image for the 3phase monitoring but put it back the same way).

Thanks @Z0l is the RX pin on the EmonTx disconnected from the ESP8266 adapter? Just wondering if theres a chance we’ve made a mistake in the shop here. Could you take a quick pic of the bottom side of the EmonTx board and the pins on the ESP8266 adapter?

The RX is disconnected on the emonESP; I guess that’s the TX of the EmonTX, right?

1 Like

That looks fine thanks! It won’t be being caused by that then!

Did you try turning off the RFM69 radio in the EmonTx firmware? emontx-3phase/src.ino at master · openenergymonitor/emontx-3phase · GitHub

Yes, only EMONESP is defined, since I’m not using the radio, so that line is commented out.

Ok, good to hear, it sounds like its an issue on the EmonTx rather than the ESP given that you noted that you needed to reset the EmonTx. @Robert.Wall is there anything else on the 3 phase firmware that might be worth @Z0l trying?