emonTX using ESP8266 Huzzah WIFI - Strange numbers

Ah, that changes things quite a lot!

I’ve revisited the sums I did when deciding whether it was practical that emonLibCM_getWattHour(…) should return a signed value:

The average UK home uses about 3.7 MWh per annum, so at that rate, the signed long integer will overflow after 580 years.

The maximum value for a USA consumer appears to be about 16 MWh but even so, that is good for 134 years.

If an emonTx/emonPi were to remain in service for 50 years, it would need an average consumption of 43 MWh per annum to overflow a signed long integer. (In the UK, that would cost around £8,000 per annum.)

I didn’t think the use of an unsigned value was justified on the grounds of it being necessary to have the capacity to store the value of twice those numbers.

hi Robert, haa that was it… (embarrassed red face). I have been running another older emonTX without the additional power supply without issue for about 6 months now and I unfortunately made the assumption that new ones would work the same, apologies.

I added the additional adaptor to the test and rebooted and I got the readings I was expecting.

Thanks again all for your help and I will try and be less stupid next time!

1 Like

That doesn’t make sense. It’s the emonTx V2 that on its own required both a 5 V d.c. adapter to power it and a 9 V a.c. adapter to measure the voltage.
The emonTx V3 can work with only an a.c. adapter because it was designed that way and the current demand is small, so it doesn’t unduly spoil the waveform that it’s measuring. Adding the ESP8266 increases the current demand by many times and the emonTx should simply not work when the ESP8266 is added, unless you also add the 5 V d.c adapter to supply the extra power that’s needed.

Understand but it dose seem to work on this older one. With the WIFI card attached is happily sending what I assume is correct data with only the one power supply. Just to double check I did connect up the v9 adaptor and power cycle it to see if there was any dramatic change in the ct reading and I could not see one. very strange.

So you were running on only a 5 V d.c adapter?

If you’re running off only a 5 V. d.c. adapter and you’re using the old discrete sample sketch, it will have assumed a nominal 230 V and it’s giving you its best guess at the apparent power on that basis. Give it a 9 V a.c. adapter and it can calculate real power, which is what you pay for. So when you added the 9 V a.c. adapter that feeds the voltage input, it was able to calculate the accurate real power. I would have expected you to have seen some change.

The “latest” sketch pre-loaded by the shop uses the continuous monitoring library, EmonLibCM. That can work with or without the 9 V a.c., and it knows the difference, but it appears that the “latest” default sketch must have the a.c. adapter for it to calculate the real power, it doesn’t use the guessed nominal voltage to show approximate apparent power instead.

Yes that’s correct. All makes sense now, thanks for persevering with me! Do you think its a viable option if I want to deploy these for customers with only the one 5v adaptor that I flash it down to the older version?

I take you mean with the ESP8266 module sending to emoncms.org?

It’s viable, but in my opinion (and I’m biased), the best answer would be to write or customise a sketch that uses emonLibCM to calculate apparent power when the a.c. adapter is unavailable. OK, you won’t receive the full benefit of the better accuracy that emonLibCM offers with the a.c. adapter, but at least you’ll catch all the peaks that the old Discrete Sample sketch misses.

If you never use the ISM band radio, you could also simplify things and leave that out.

Interesting. I was making that exact same calculation recently and didn’t have those stats, so thanks. In the end I based my calculation on my L&G meter which has 2x 6-digit registers (one for import and one for export) so can read up to 1000 MWh before wrapping. Like it, I tally positive and negative energy separately, so both are unsigned but I report in WattSeconds so was trying to decide between 32-bits and 64-bits. 32-bits really just doesn’t cut it for WattSeconds; if I’ve done the maths right you need about 41 bits to match L&G’s 1000 MWh. So in the end I went with 2x 64-bit registers for each channel (and then same again for Reactive Energy):

1 Like

Hi Rob, sorry for digging up an old thread but was wondering if there was any way of me load on or set a specific sketch so I am sure that the emonTX will work off the one adaptor. I understand it wont be as accurate but I don’t need it to be 100%.

Hold fire. I think Trystan is about to reissue the “latest” sketch that will calculate the ‘best guess apparent power’ if it doesn’t have an a.c. adapter.

2 Likes

@TrystanLea any thoughts on this. If I could get the emonTX to only need one power connection I would take 5. Even better if they had the ESP8266 build in ;). Or is someone wants to build me a custom set :slight_smile:

Hello @boydo, I have updated the firmware to @Robert.Wall’s latest that supports apparent power only mode, its available here GitHub - openenergymonitor/EmonTxV3CM: EmonTxV3 Continuous Monitoring Firmware (Default shipped EmonTxV3 firmware) or if you have an up to date emonPi/emonBase you can flash the firmware directly from the base station. That will make it possible to use the EmonTx without an AC-AC adaptor, but with USB power for the ESP8266 adapters (if that’s the route that you are taking).

1 Like

Thanks Trystan,
When you say …

Is that implying that I can update the TX from the PI web interface? If so how?
Going to have a go flashing it using USB to UART but would be interested to know for future.
Thanks again, much appreciated.
Richard.

Edit: Update to latest firmware and single wire USB power works a charm!, thanks again.

1 Like