Use an ESP8266 to OTA program a Moteino?

Started by WhiteHare, October 12, 2015, 02:29:48 AM

WhiteHare

#15
@jra Thanks! 

To facilitate rapid hookup of 2mm parts to regular arduino's, I'm using these prototype shields:
http://www.ebay.com/itm/201259671475?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

Based on your feedback I just ordered some extra esp12e's from Ali Express at $1.95 each:
http://www.aliexpress.com/store/product/New-version-ESP-12E-replace-ESP-12-ESP8266-remote-serial-Port-WIFI-wireless-module/731260_32339917567.html
FWIW, in the past I've purchased inexpensive pro mini's from that vendor without issue, and by upgrading to e-packet delivery, they arrived quickly.

As cheap "just in case" insurance, I also ordered some of these adapter boards:
http://www.aliexpress.com/item/Serial-WIFI-ESP8266-module-adapter-plate-Full-IO-port-leads-only-adapter-plate/32273534748.html
However, I haven't used that vendor before, so caveat emptor.

TomWS

Quote from: WhiteHare on October 17, 2015, 09:26:11 AM
@jra

Thanks! 

To facilitate rapid hookup of 2mm parts to regular arduino's, I'm using these prototype shields:
http://www.ebay.com/itm/201259671475?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
That's a useful board!  Good find!
Quote
I just ordered some extra esp12e's from Ali Express at $1.95 each:
http://www.aliexpress.com/store/product/New-version-ESP-12E-replace-ESP-12-ESP8266-remote-serial-Port-WIFI-wireless-module/731260_32339917567.html
FWIW, in the past I've purchased inexpensive pro mini's from that vendor without issue, and by upgrading to e-packet delivery, they arrived quickly.
Good info, thanks.

Tom

WhiteHare

#17
Quote from: WhiteHare on October 17, 2015, 09:26:11 AM
I also ordered some of these adapter boards:
http://www.aliexpress.com/item/Serial-WIFI-ESP8266-module-adapter-plate-Full-IO-port-leads-only-adapter-plate/32273534748.html



As an aside, I just now compared (by eye) the spacing between pin rows on an ESP8266-12E with that of an RFM69W, and it looks virtually the same.  Not only that, but they have the same number of pins.  So, the above 33 cent (delivered!) adapter plate may well turn out to be the cheapest way to adapt 2mm pitch RFM69W's to a breadboard friendly 2.54mm pitch!

Wish I could find an equally cheap and equally good matching adapter plate for an RFM69HW!  So far the closest I've found for that were some adapter wings.

WhiteHare

Quote from: jra on October 16, 2015, 05:39:56 PM
You also need a well regulated 3.3v power source...

@jra Which voltage regulator are you liking the best for use with ESP82866's?

I'm finding that the lowpowerlab's FTDI adapter v.2,  when configured to deliver 3.3v, doesn't have enough power to run even a simple blink program on the Huzzah.  I measured it as delivering only 3.1v when connected to the adafruit ESP8266.  If run through the LDO of the Huzzah, the delivered voltage was too low to run the blink program.  If I wired the same unit so as to directly power the Vcc of the Huzzah, then the blink program would run, but be unstable: it kept resetting itself.  It might work (though not sure), if I configured it to deliver 5v to the LDO, but I want to leave it as is for when I'm programming 3.3v Pro Mini's. 

So I'm presently powering the Huzzah through a USB console cable.  That delivers adequate 5v voltage to the Huzzah.  However, it's only 4 wires and so it can't do a reset.  Because of that I'm presently doing resets manually on the Huzzah, and that does allow me to upload sketches.  Again, by the time the ESP-12E's arrive, I want to have a better setup.

Which FTDI adapter do you like best for working with ESP8266's?

Felix

WhiteHare, the 3.3V of the FTDI comes from the FT231XS chip's regulated supply that cannot offer more than about 50mA. It was never intended as a power supply, just a jumper option in case 3.3V 50mA is needed for something. The default is the USB 5V that is passed through and can supply 500mA to your target.

50mA in low power electronics is enough to "fly you to the moon".
The ESP devices need several times more than that, so I expect they can fly you to mars with those power requirements. Good luck running on batteries.

TomWS

#20
Quote from: WhiteHare on October 17, 2015, 04:19:35 PM
Quote from: WhiteHare on October 17, 2015, 09:26:11 AM
I also ordered some of these adapter boards:
http://www.aliexpress.com/item/Serial-WIFI-ESP8266-module-adapter-plate-Full-IO-port-leads-only-adapter-plate/32273534748.html



that adapter board doesn't pick up the 12E's pins on the bottom row (SPI and additional GPIO).  Maybe you're ok with that, but it did catch my eye.
Quote
As an aside, I just now compared (by eye) the spacing between pin rows on an ESP8266-12E with that of an RFM69W, and it looks virtually the same.  Not only that, but they have the same number of pins.  So, the above 33 cent (delivered!) adapter plate may well turn out to be the cheapest way to adapt 2mm pitch RFM69W's to a breadboard friendly 2.54mm pitch!

Wish I could find an equally cheap and equally good matching adapter plate for an RFM69HW!  So far the closest I've found for that were some adapter wings.
I don't quite understand this.  The RFM69W and RFM69HW have the same footprint.  Where is the problem?  Did you mean RFM69CW and RFM69HCW respectively?  These are both 16mm row spacing with 2mm pitch, but the RFM69HCW pins interfere with the adapter's VCC & GND planes.  The RFM69CW, with its 14 pins can be offset to avoid the planes.

Tom

jra

@whitehare Ditto what Felix said, none of the USB-TTL adapters that I know of supply enough 3.3v current to drive an ESP.  Pull from the 5V USB bus and drive a separate regulator.  I generally use LM1117's because I already have a ton of them and, not to belabor the point, their relatively high dropout voltage is not an issue if you're not using batteries.  For you I would look at something more efficient, maybe a buck converter or even a buck-boost converter.  Something like a 3v3 version of https://lowpowerlab.com/shop/buckregulator or https://www.adafruit.com/products/2745 or build your own around ti's 63000 series http://www.ti.com/product/tps63001/description.

As far as USB-TTL adapters I use CP2102's like http://www.ebay.com/itm/Replace-FT232-6Pin-USB-2-0-to-TTL-UART-Module-Serial-Converter-CP2102-STC-/321546809495 because you can easily solder on a pair of headers and get the pins you need.  Don't confuse RST (resets the CP2102 itself) with RTS (Request to Send) which is the one you want.

WhiteHare

Quote from: Felix on October 17, 2015, 09:37:38 PM
WhiteHare, the 3.3V of the FTDI comes from the FT231XS chip's regulated supply that cannot offer more than about 50mA. It was never intended as a power supply, just a jumper option in case 3.3V 50mA is needed for something. The default is the USB 5V that is passed through and can supply 500mA to your target.
Thank you!

Quote from: Felix on October 17, 2015, 09:37:38 PM
50mA in low power electronics is enough to "fly you to the moon".
The ESP devices need several times more than that, so I expect they can fly you to mars with those power requirements. Good luck running on batteries.
Just to clarify, I envision the trips to mars will be limited to the duration of OTA programming events, and my rocket engines will be more than a coin cell.  That said, I do sense it may have a crew payload of only 1 (moi), but maybe it will find other uses too.

joelucid

Just out if interest: what do you find complicated about Felix ota method?

TomWS

Quote from: joelucid on October 18, 2015, 01:18:55 PM
Just out if interest: what do you find complicated about Felix ota method?
I'm curious as well.  I use Felix's flash and DualOptibootloader method and it works well enough.  I just use a different method to load the flash in a bootloader compatible format.

Tom

WhiteHare

Quote from: jra on October 18, 2015, 11:04:52 AM

As far as USB-TTL adapters I use CP2102's like http://www.ebay.com/itm/Replace-FT232-6Pin-USB-2-0-to-TTL-UART-Module-Serial-Converter-CP2102-STC-/321546809495 because you can easily solder on a pair of headers and get the pins you need.  Don't confuse RST (resets the CP2102 itself) with RTS (Request to Send) which is the one you want.

Thanks!  I just ordered one from a domestic shipper, and it should be here by next weekend, if not sooner.   :)  Among other things, it does include an RTS (see attached photo):

WhiteHare

#26
Quote from: jra on October 18, 2015, 11:04:52 AM
@whitehare Ditto what Felix said, none of the USB-TTL adapters that I know of supply enough 3.3v current to drive an ESP.  Pull from the 5V USB bus and drive a separate regulator.  I generally use LM1117's because I already have a ton of them and, not to belabor the point, their relatively high dropout voltage is not an issue if you're not using batteries.  For you I would look at something more efficient, maybe a buck converter or even a buck-boost converter.  Something like a 3v3 version of https://lowpowerlab.com/shop/buckregulator or https://www.adafruit.com/products/2745 or build your own around ti's 63000 series http://www.ti.com/product/tps63001/description.


The Huzzah uses the SPX3819 as its voltage regulator:  http://www.exar.com/common/content/document.ashx?id=615
Costs 72 cents from digikey.  I like that it can be turned on/off with an enable pin.  However, I just now did the measurement, and I find that if the only thing I do is set the LDO enable pin to ground, then the Huzzah still draws 500uA at 5v, which obviously isn't good at all!  Given this, it's funny that the SPX3819 datasheet would say "When disabled, power consumption drops to nearly zero. "

I couldn't get the current lower than about 416uA by disabling the ESP8266 alone.  Strangely enough, if I then subsequently also disabled the LDO, then the current rose to about 500uA again.


jra

The Huzzah spec sheet says there is a 10K pullup from EN to V+/Bat.  If you connect it to ground to cut power it sounds like you will still have 5V/10K = 500uA flowing through the pullup.

WhiteHare

#28
Looks as though it can run on 3x AA batteries without a regulator from 4.5v down to 3.1v (http://forum.makehackvoid.com/t/esp8266-operating-voltage-range-and-sleep-current/286/58), so I'm going to run with that assumption.  I'll wait to do those experiments until the cheap 12E modules arrive, though, as I have only one Huzzah.


WhiteHare

Quote from: jra on October 19, 2015, 07:24:22 AM
The Huzzah spec sheet says there is a 10K pullup from EN to V+/Bat.  If you connect it to ground to cut power it sounds like you will still have 5V/10K = 500uA flowing through the pullup.

@jra

Poking around I found a class of integrated load switches (e.g. http://www.micrel.com/_PDF/mic94060.pdf) whose datasheets guarantee OFF currents of less than 1ua.  Looks as though it could turn on and off an ESP8266 easily and without wasting much power.