Using the EmonTx v3 with the ESP8266 Huzzah WIFI module

Tags: #<Tag:0x00007f10a7c7e430> #<Tag:0x00007f10a7c7e2f0>
(stephen krywenko) #43

curious why reinvent the wheel - i hooked my esp8266 differently then you guys as I see no need to have the emontx arduino handle that. and let the esp8366 processor handle all the wifi related stuff including error correction and what have you ( two processors are better then one :slight_smile: ). . and simply as i do unplug the esp8266 from the emnotx to program it , its easy and simple and if you wanted you could just install end user lua module . and on connection of the esp8266 to emontx . simply use that esp8266 interface web interface to setup the wifi via any wireless device… oh well different strokes for different folks I guess - i get that you want to have it all interface with each other but you just reduce already limited resources… where i increase mine by adding an extra processor power and 6 more gpios and 1 analog pin that run independently of the emontx


(Jeremy Poulter) #44

I am not entirely sure I understand your point. The Huzzah/ESP8266 is just plugged in to the EmonTx and is doing all the WiFi setup, config, MQTT, EmonCMS posting etc. The EmonTx is doing nothing more/less than the they would in the standalone variants. It would be good for you to share some more details of your setup.

Are you using Lua as per-installed on the Huzzah?


(kevin) #45

I originally tried 115200 with my setup of a Huzzah running ESPEasy with onboard USB to Serial, and an EmonTX V3.4 running the descrete sampling sketch. With that setup I got intermittent dropped packets, and after I downgraded it to 57600 all was well. This could well be down to my different ESP hardware / firmware combination, but figured you might want to know about it.
I’ve also expanded the ESP to output PWM to power my dimmer without any dropped packets.


(Paul Raymond) #46

Emonesp is a great addition to open energy.
I have one problem.
I get a server error = -1 from, and the data is not being posted to
I am testing using the API.
If I post the same input to .org the data is accepted by .org with status of “ok.”

Any ideas?



(Trystan Lea) #47

@Raymop, what do you have set in the EmonESP nodename field? by default, it is emonesp I think? At the moment only supports numeric node names, something I intend to fix soon. If you change the nodename to a number below 31, it should work (if that’s the issue).


(Paul Raymond) #48

Hi Trystan: I thought of that. And switched the node to be = to 1.
But, still get that error.
Here are some logs…

Copy of boot-up results:
EmonESP 1675561
Firmware: BUILD_TAG
Connecting as client to ----- epass:-----
Connected, IP:
Server started

Here is what I post as a test:,CT2:325,T1:12.5,T2:16.9,T3:11.2,T4:34.8

Here is response from ESP
Got ‘CT1:3935,CT2:325,T1:12.5,T2:16.9,T3:11.2,T4:34.8’
Plain old HTTP
Emoncms error: server error: -1

And nothing gets posted to, due to the error

Here I test sending the same input string vis the API to{power:200}&apikey=abc123etc

The input is correctly noted on
Node 0
Node: Key Name Process list last updated value
0 power 29s ago 200

Do I need to use SSL. maybe?



(Paul Raymond) #49

I was using the read only key, when I should have been using the read/write key for the API.

1 Like

(Maurizio) #50

Hi guys,
I’m trying to implement the EmonTX v3 + ESP8266 solution using a nodemcu (like this ) but something is not working as excepted. The serial output of the emontx is correct via serial output (if I use a PC). The nodemcu MQTT is posting as expected. The problem is putting them together. When I connect the emontx to the nodemcu nothing happens, I mean no data comes from emontx to the nodemcu. if I open the EmonESP web page, the section 4. Latest data is empty and consequently no data is posted via MQTT.
Do you have any suggestion? Is the nodemcu not appropriate for some reason that I don’t know?

Thank you in advance.


(Paul) #51

Taking what you have said at face value and the fact you suspect the interaction between the 2, I would recommend rechecking the Rx and Tx lines as the emonTx isn’t labelled as you might expect.


(Maurizio) #52

Hi Paul,
thank you for the suggestion! Now works properly. So, if someone will have the same issue, the solution is to connect the RX pin of the emontx with the RX pin of the nodemcu (or whatever). Le me say that this is not so intuitive! :slight_smile:


(Robert Wall) #53

Agreed. It’s normal, established convention to swap over and connect Rx-Tx and Tx-Rx in the cable between the two devices. In the case of the emonTx, the swap is done inside the emonTx, so when you’re connecting anything else to the emonTx, you do not swap the connections over.


(Tomasz Napierała) #54

Hi guys, great job with ESP8266 sending data from EmonTX. I have one questions though: I’m also using NodeMCU or Wemos D1 mini. Which PIN should I use for RTS connection? I checked Huzzah specs and this particular pin is not marked.


(Jeremy Poulter) #55

No need to connect the RTS line currently.


(Tomasz Napierała) #56

Thanks. All worked like a charm. Really great job, this is making Emon much more affordable.

1 Like

(George (aka Costas the coder)) #57

IMHO, essential if OEM is to make it into the mainstream.


(Egon Herrmann) #58

Hi there. I just want to thank the developers for adding support for the ESP8266 to the project.

I would also like to confirm that it is possible to use the EmonTX Shield and an Arduino in the same way. I successfully used a Wemos D1 mini (in stead of a Huzzah) powered directly from my Arduino UNO’s onboard regulator, posting 2 CT measurements and a temperature reading to emoncms.og without hick-ups so far.

Has anybody done any power consumption measurements on the ESP when using it in this way? I’m curious about what the smallest power supply I can get away with. I’m currently using a 9V 1A psu though the Arduino’s regulator. Will I take a risk by using a 5V 700mA psu connected directly to the Aruino’s 5V rail in stead?


(Glyn Hudson) split this topic #59

2 posts were split to a new topic: Using RobotDyn Uno + ESP board with EmonESP


Using RobotDyn Uno + ESP board with EmonESP
(chris_cronin) #60

I can’t see what sketch to upload to the ESP8266 module, please help


(ian) #61

All the details towards the bottom of this page.

I recommend platform.lO

I got in a terrible mess until I switched from Arduino IDE.



(Bert Tammer) #62

Problem with configuring emonESP with the local emoncms host: says Please enter emoncms server and node.

Replaced post to Hardware::emonESP.