Using the EmonTx v3 with the ESP8266 Huzzah WIFI module

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

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?

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.

Emonesp is a great addition to open energy.
I have one problem.
I get a server error = -1 from emoncms.org, and the data is not being posted to emoncms.org.
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?

Raymop

@Raymop, what do you have set in the EmonESP nodename field? by default, it is emonesp I think? At the moment emoncms.org 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).

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: 192.168.1.141
Server started

Here is what I post as a test:
http://192.168.1.141/input?string=CT1:3935,CT2:325,T1:12.5,T2:16.9,T3:11.2,T4:34.8

Here is response from ESP
CT1:3935,CT2:325,T1:12.5,T2:16.9,T3:11.2,T4:34.8
Got ‘CT1:3935,CT2:325,T1:12.5,T2:16.9,T3:11.2,T4:34.8’
/input/post.json?json={CT1:3935,CT2:325,T1:12.5,T2:16.9,T3:11.2,T4:34.8,psent:0,psuccess:0,freeram:28408}&node=1&apikey=abc123etc
Plain old HTTP
Emoncms error: server error: -1

And nothing gets posted to emoncms.org, due to the error

Here I test sending the same input string vis the API to emoncms.org:

https://emoncms.org/input/post.json?json={power:200}&apikey=abc123etc

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

Do I need to use SSL. maybe?

@raymop

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

1 Like

Hi guys,
I’m trying to implement the EmonTX v3 + ESP8266 solution using a nodemcu (like this Get Started With NodeMCU - Hackster.io ) 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.

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.

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:

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.

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.

No need to connect the RTS line currently.

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

1 Like

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

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?

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

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

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.

Ian

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

Replaced post to Hardware::emonESP.