emonTX to emonbase via wifi


I need to link several emonTX to an emonbase for local monitoring. They are in different buildings so well out of range of RF communication. Can I make this work with the Huzzah WIFI modules instead? If so then can you tell me how? They can all go on the same VLAN if necessary.


Welcome, Andy, to the OEM forum.

You can add the ESP8266 module, but due to the increased power consumption, you’ll also need the 5 V USB power supply.

Note that the input via Ethernet/WiFi bypasses emonHub, and goes straight into emonCMS.

Thanks for the quick reply.
So I’m still not sure how can I log data on my emonbase. I’ve added an ESP8266 and the extra power supply to an emonTX but I’m not sure what the correct setup is.

Have you set the output format of the emonTx appropriately?
Which sketch are you using?

Maybe this will be of some help:

1 Like

All sorted now thanks. I had a typo in the apikey.

1 Like

Good useful information. Thanks.

1 Like

Hello - jumping in here with a not-dissimilar question. Running an EmonTx as a PV diverter using one of the earlier sketches for that purpose (and d…n good it is, too!). Connecting to an EmonLCD to see what is going on. So far so good. All the kit is in the cellar

Now I also have an airsource heat pump, 25m away in the garage, and I’m setting up to monitor this (and the forthcoming batteries) with an EmonCMS setup. So I’ve got another EmonTx for the garage and because I need inputs from wide-ranging places I’ve got a Huzzah Wifi running on that second EmonTx.

Now I want my PV diverting EmonTx to be WiFi enabled as well, so I built another Huzzah module and plugged it in. Obviously it doesn’t work!

Based on @Robert.Wall comment, I know the data from the EmonTx needs to be in a specific format for the Huzzah wifi, and that current builds of the firmware for the EmonTx are correct in that regard. However, what do I need to do to one of the PV Diverter sketches to make my PV diverting EmonTx communicate with its wifi module?

Or do I just give up, leave the diverter as it is, and get another EmonTx to get me the data I need from the cellar?


That’s the simple, safe and expensive way, but a possibility.

Slightly more complicated, but nevertheless it should be possible.
First, to keep the emonGLCD going, you must keep the RFM12… bits of the diverter sketch.
What you need to add is Serial.print... statements with the data you need in around the same place as the “send” statement for the RFM12B in loop( ). You’ll need to crib the format from one of the other emonTx sketches that does work with the ESP8266.

But, do you need to do that? if you have an emonBase/emonPi, is it within range of the cellar? If so, you can use the 433/868 MHz ISM band radio that’s already sending the data to the emonGLCD.

I can’t help a lot this week - my laptop died and I’m struggling with an old one out of mothballs, with no access to all my data. I’m hoping to be up and running a week today.

If you need any more help, say which or attach the sketch you’re using in the diverter emonTx.

Thank you Robert.

  • I don’t know which sketch I am using! I did it several years ago, and don’t have IDE folder on my laptop anymore. And as far as I can tell, I can’t ‘read’ the EmonTx and de-compile the sketch that is running on it?
  • I guess I should re-upload a modified sketch, as you say – I’m anxious about breaking what is currently working very well!
  • The reason I want to go down this route is that the RFM12B signal struggles to get out of the cellar, and just makes it to the EmonGLCD. In the rest of the house, and where I want to install the EmonBase, there’s no chance of picking up the RFM12B :frowning:

But thanks for what you have said – I think I need reload my newer EmonTx (currently sitting at the ASHP end of the house) with a modified PV sketch to see if I can get it to work as you describe. If it doesn’t, I can always plug the current diverter EmonTx back in…… Not that there’s much to divert at the moment!


So helpful… :blush:


That is unfortunately the case.
Presumably, you don’t have a suspect file with the extension “.ino”? It’s only that which we need.

You are likely to have either one of Robin Emley’s or Martin Roberts’s sketches, from here: Choosing an Energy Diverter — OpenEnergyMonitor 0.0.1 documentation

Robin now has his own website at www.mk2pvrouter.co.uk, and there you’ll find later and refined versions of the sketches listed in Learn, but beware, they use the I/O of his dedicated hardware, so you’ll need to change pin numbers for a standard emonTx.

Neither he nor MartinR use the Serial output format dedicated to the ESP8266, so neither has an advantage there. Robin produces a steady stream of kits, so he must be doing something right.

The other thought that occurs to me is you can’t have the sketch for the emonGLCD either? Which means that if you can’t remember the RF packet that your emonTx is transmitting, and you’ve no means to “sniff” it and reverse engineer it, to make the emonTx send the same packet, or you will need to get a sketch for the emonGLCD too, simply so that the two can continue to work together.

Except that with an an RFM12 hat on my Pi, I think I’ve been able to work out what each ID is. But you are right. All in all a challenge. Oh that I hadn’t wiped my Mac clean to give to my other half a few weeks ago!

Thank you for the warning on the pins, though. That would have kept me puzzled. I may go back to the original sketches pre his own hardware… I seem to recall that’s around the time I put my system together…