Emontx esp8266 firmware update failure

I tried compiling the emontx firmware update for esp8266 huzzah & it reported missing EmonLib.h in EmonESP library so copied EmonLib.h from EmonLib library & now I get avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x3a when trying to upload sketch to EmonTx. I’ve chosen Uno board for EmonTx.
Any suggestions?

Uno is correct, but the error message you see is largely meaningless, for some reason the emonTx and your computer are not talking.
Is this the first time you’ve tried to connect and upload to the emonTx?
Is the programmer connected the right way round? The GND is nearest the RJ45 socket.
Is the Arduino IDE using the correct port?

This is the 1st time I’ve tried connecting to the emontx (just bought)

This is the response from the ‘standard’ emontx

'ct1:0,ct2:0,ct3:0,ct4:0,vrms:337,pulse:0
ct1:0,ct2:0,ct3:0,ct4:0,vrms:337,pulse:0
ct1:0,ct2:0,ct3:0,ct4:0,vrms:337,pulse:0
ct1:0,ct2:0,ct3:0,ct4:0,vrms:337,pulse:0
ct1:0,ct2:0,ct3:0,ct4:0,vrms:337,pulse:0

so the connection to th emontx is working OK

I’ve assumed the emontx esp8266 firmware update sketch is uploaded in the normal way

I’ve found a way to upload the sketch; press & hold the reset button until the start of upload indicated by sketch then release the reset button (I have to use the same procedure with my 8 year old mega2560 since connecting a shield to it)

What usb-serial programmer are you using? Is it a 6 wire/term with a reset line (DTR)?

No it’s a 4-wire type (the only one I’ve used in the past when uploding the ESP8266 Huzzah; after putting the Huzzah in upload mode)

What 4 wires does it have? Can you post a link or photo? To upload “hands-free” to an emonTx (and many other devices) you need Vcc, Gnd, Rx, Tx and Reset. (only 5 of the 6 are used, the other I think is either CTS or 3.3v depending on the device)

It’s a 6-pin type (CP2102 breakout) using pins RXI, TXO, VCC & GND (DTR & CTS are not connected)
If I add a connection to DTR on my usb-serial programmer would that allow me to upload the ESP8266 Huzzah without the need to put it in ‘upload mode’?

Now I’m confused, I thought you were uploading to an emonTx?

Yes if you connect the DTR to the reset of the emonTx you will be able to flash the emontx without using the reset button.

With regard to the esp (fore warning, esp are not my strong point) I understood they have a 2 step process, you have to short a pin (boot0?) to gnd and then use the reset line with the programmer. I’m sure someone will correct me if I’m wrong, but I believe you would still need to put the esp into upload mode even with the DTR line connected. (apologies if I am wrong about the esp!)

Sorry for the confusion Paul. I only use the usb-serial programmer when uploading to an ESP8266 Huzzah (it doesn’t have a usb connection).
I am uploading to an emontx using a usb-serial programmer as I believe the usb port on the emontx is only used as a 5V power supply.
To put the ESP8266 Huzzah in ‘boot mode’ you hold down the GP100 button & press the reset button, the onboard red LED then dims indicating the chip is ready for uploading (a real pain if the Huzzah is inside an enclosure) hence my question about being able to upload a sketch to the Huzzah without the need to put it in ‘upload/boot mode’

Well that’s cleared things up nicely (not!) :smile:

Surely you are therefore saying that you use the usb-programmer for both devices as neither has a functional USB port?

No, the “hold down the GP100 button & press the reset button” confirms what I was saying, it requires 2 actions, so you cannot do it with just the DTR. You could use a Pi or a similar device to automate the upload using 2 IO pins with some custom software (there’s probably already something out there to this).

Whether its done by a programmer or manually, you still need to acces it. if you can run wires or terminals out to a programmer, you could just as easily run wires or terminals out to short manually to avoid removing the case.

Correct, if I plug a usb cable into the emontx there is no distinctive Windows audible sound indicating a usb connection has been made, so the emontx usb port is for supplying 5V DC only hence the need for a usb-serial programmer

An easier method is to use an ESP8266 Feather Huzzah which DOES have a usb port & doesn’t need the ‘boot mode’ operation

That does indeed sound much easier

Correct, yes I should of confirmed that earlier. There is no USB controller on the emonTx, the mini usb is purely there for 5v DC only.