|
Post by papa on Jul 19, 2017 18:00:24 GMT
From Walmart, I bought 2 WorkChoice Wi-Fi Controlled Outlets (ECOPlugs), following up on a jimkernsjr recommendation. Almost every time, my FTDI programmer uploads successfully to a Sonoff, but it took me at least a week to work out uploading to the current ECOPlug. This ECOPlug's construction is different from previous pictures. See the images below. The good news (Spouse Acceptance Factors & protecting from mains voltages) is a solid, compact, squat cylinder encases the device. More good news is that one removes 3 screws from the base plate, tugs on the male electrical prongs & everything comes out in one piece. The ESP8266 board (top of images 2 & 3) looks mostly similar to previous pictures. image 1 image 2 image 3 Top of the case ESP8266 daughter ESP8266 daughter uppermost, power supply board lower The more challenging news: the ESP8266 board is no longer screwed down separately inside the case. Instead the ESP8266 board is a daughter board physically attached to the base plate which restricts access. In image 3 above see the narrow clearance below the ESP8266 board. I was not successful in soldering programming wires to the necessary pads & even if I was successful, I'm not sure the case had room for the wires. From my experience, the usual connections & procedures were not quite sufficient to re-flash the device with our programming.
|
|
|
Post by papa on Jul 19, 2017 18:02:43 GMT
My soldering to the ESP8266 board pads was not working so I tried small alligator clips instead (preventing bridges with electrical tape & thin cardboard). Update: I also tried a home-made programming jig which ultimately succeeded. More on that below.I believe I connected my FTDI programmer to the ESP8266 board as jimkernsjr & others instructed. As seen when the WiFi antenna is uppermost FTDI ESP8266 daughterboard GND GND (upper right pad) VCC VCC (2nd down from upper left) RX TX (5th pad down from upper right) TX RX (6th pad down from upper right) GND GPIO0 or GPIO0 to ESP8266 board GND pad ^^ Using recommended board settings in Arduino IDE When the FTDI programmer / ESP8266 board is powered, the ESP8266 board's blue LED flashes. Uploading fails Grounding GPIO0 or leaving it disconnected did not seem to make any difference.
|
|
|
Post by papa on Jul 19, 2017 18:04:57 GMT
The Setup instructions (for app programming) say to press the ECOPlug's button while powering the device. When wi-fi indicator (blue led) turns off, release the button. After a pause, the blue LED resumes flashing. I've tried uploading after that procedure & also while holding the button continuously. The upload fails in both cases.
I've also tried these connections, adding 3.3 volts from an external power supply (PS): As seen when the WiFi antenna is uppermost FTDI ESP8266 daughterboard FTDI GND & PS GND GND (upper right pad) PS VCC VCC (2nd down from upper left) RX TX (5th pad down from upper right) TX RX (6th pad down from upper right)
GPIO0 to ESP8266 board GND pad
Uploading with the external power supply ^^ was also not successful.
|
|
|
Post by papa on Jul 19, 2017 18:08:32 GMT
This is the uploading error output from the Arduino IDE ...
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de> setting board to ck setting baudrate from 115200 to 115200 setting port from COM1 to COM6 setting address from 0x00000000 to 0x00000000 espcomm_upload_file espcomm_upload_mem setting serial port timeouts to 1000 ms opening bootloader resetting board trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload read 0, requested 1 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload serialport_receive_C0: 23 instead of C0 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload read 0, requested 1 resetting board trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload serialport_receive_C0: 5B instead of C0 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload read 0, requested 1 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload read 0, requested 1 resetting board trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload serialport_receive_C0: 23 instead of C0 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload serialport_receive_C0: 5B instead of C0 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload read 0, requested 1 warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed
|
|
|
Post by papa on Jul 19, 2017 18:17:08 GMT
When the FTDI / ESP8266 board are powered (blue LED flashing) & I have Serial Monitor (SM)on, the following SM results display & repeat:
[15SX_D]Send Reg to P2P Server :203.66.65.34 [15SX_D]Send Reg to P2P Server :203.66.65.34 ####WH_Data:48 ####WH_Data:0 ####WH_Data:0 ####WH_Data:0 Hw ret_data:0 [Pow_detect]A ret_data:0 362 W ret_data:0 1723 V ret_data:0 [1089 ~ 6535 ] #######Today_Hw_Total:0 ============================== When I click the button, Serial Monitor shows ...
short key press_count>=150ms! short key no press!......... Key Short Press!Led Status:0,Level:1 [red power LED toggles]
or short key press_count>=150ms! short key no press!......... Key Short Press!Led Status:1,Level:0
If I hold the button, this repeats until I release: short key press_count>=150ms!
|
|
|
Post by papa on Jul 19, 2017 18:18:36 GMT
If I hold the button down during power up & then release it, serial monitor shows:
No Press Long Key,Restore! after 8bit macaddr:780236DF [15SX_D]Send Reg to P2P Server :203.66.65.34 No Press Long Key,Exit Time! [Flash]Write Flash DST:0 [Flash]Write Astromic to Flash 3 Sector_2 Successful:1108 [Flash]Write SN to Flash 1 Sector2 successful 28 [Flash]Write Factory Information to Flash 1 Sector2 successful 44 New System Restore ! ********** System Reboot ************ del if0 bcn 0 del if1 usl sul 0 0
ets Jan 8 2013,rst cause:4, boot mode:(3,7)
wdt reset load 0x40100000, len 816, room 16 tail 0 chksum 0x8d load 0x3ffe8000, len 788, room 8 tail 12 chksum 0xcf ho 0 tail 12 room 4 load 0x3ffe8314, len 288, room 12 tail 4 chksum 0xcf csum 0xcf
2nd boot version : 1.2 SPI Speed : 40MHz SPI Mode : QIO SPI Flash Size : 8Mbit jump to run user2
r *****************BOX INFOR******************** ^_^Hello,ESP8266! FirmWare Ver:1.6.0 SDK Ver:1.0.0 Compile Time:May 28 2015,14:18:25 data : 0x3ffe8000 ~ 0x3ffe89e4, len: 2532 rodata: 0x3ffe89f0 ~ 0x3ffe90a0, len: 1712 bss : 0x3ffe90a0 ~ 0x3fff4228, len: 45448 heap : 0x3fff4228 ~ 0x3fffc000, len: 32216 [Memory_Infor]Heap is:31944 ***************************************** [Flash]Read the Dst:0 [^_^]Get Power Detect Write_OffSet_flag:10 [Flash]SN SLqrUjtRAq Read Flash 3 Sector0+1024+512 Successful ! [Flash]Factory Infor IP: 203.66.65.34 SSID:ECO-Plugs Wifi_Main_Name:ECO- Read Flash 3 Sector0+1024+512+128 Successful ! nRouter_Conn_Flag:0 [15SX_D]Write 2014-01-01-0-0-0 to Flash [15SX_D] Basic SN:SLqrUjtRAq alias:ECO-780236DF pwd:780236DF [15SX_D]Internet Top-Cms:61.220.255.143 M-P2P:203.66.65.34 S-P2P:203.66.65.34 Wifi_Main_Name:ECO- [Wifi]Try to re-Connect SSID:ECO-Plugs PWD:ECO-Plugs Error out! ^_^Creat UDP BoardCast :25! ^_^Creat Comm Server Success :80 ! [Memory_Infor]Heap is:21320 ^_^Creat TCP Upgrade Server :1932! [15SX-D]SSID: SLqrUjtRAq in_ssid:SLqrUjtRAq PWD:780236DF Main_Name:ECO-780236DF Version 1.6.0 2015-05-28 [15SX-D]P2P-Svr Create esp_udp Socket at Port: 3171 p2p_port:11620 Main_Name:ECO-780236DF TopCms:61.220.255.143 Wifi_Main_name:ECO- [Memory_Infor]Memory is:20976 mode : sta(38:2b:78:02:36:df) + softAP(3a:2b:78:02:36:df) add if0 dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1) add if1 bcn 100 [Flash]Write Flash DST:0 No Press Long Key,Exit Time! ================================================
Some points in the above seem like the programming looks for reflashing, but exits before it happens. "Press Long Key" might be significant, but I could not discover how to achieve that long key. Holding the push button down just displays "short key press_count>=150ms!" until released. ====================================
Update: Note that the ECOPlug's as is programming sends information to a web site which I'd rather avoid by reflashing the device.
|
|
|
Post by papa on Jul 19, 2017 21:18:10 GMT
To put a Sonoff in flashing mode, one holds down the push button (Gnding GPIO0) while plugging the connected FTDI into USB. In that case, the Wi-Fi connecting LED does not light.
From the Sonoff behavior, I reasoned that perhaps on the ECOPlug ESP8266 board, I needed to find the pin pad that (by GNDing it during power up) would turn off Wi-Fi searching (& flashing blue LED).
One by one (just before powering FTDI), I GNDed all pin pads except GNDs, VCC, TX & RX. Blue LED flashed in all cases.
For good measure, one by one just before powering FTDI), I connected all pin pads to VCC except the GNDs, TX & RX. Blue LED flashed in all cases.
Worth a try, but no help.
|
|
|
Post by papa on Jul 20, 2017 19:30:14 GMT
I did more research about setting up the ESP8266 board for flashing. Some suggested GNDing another pin pad in addition to GPIO0, maybe GPIO15. While powering up the FTDI & ESP8266 board, along with GNDing GPIO, I (one by one) grounded all the pin pads except GNDs, VCC, TX & RX. In some cases the blue or red LED might go on or off, but uploading still failed. While powering up the FTDI & ESP8266 board, along with GNDing GPIO, I (one by one) pulled high (connected to VCC) all the pin pads except GNDs, VCC, TX & RX. In some cases the blue or red LED might go on or off, but uploading still failed. I tried pulling GPIO0 high. Uploading still failed. Besides the previously published programming connections (see above) to be made before power up, the most promising addition was also Gnding CHIP_EN. When the WiFi antenna is at the top, the CHIP_EN pad is next below VCC, 3rd down from the top left. See the image in this post.
BTW, the current ECOPlug ESP8266 board has an UNpopulated place for a reset button (the small button outside the case would have engaged it). From checking the pin connections, I believe that pushing that reset button would have GNDed CHIP_EN as is (see below) partly needed for putting the board into flash mode (along with GNDing GPIO0). Hmmm, were the makers trying to prevent users from getting into a corner, trying to prevent us from re-flashing with our programming, or just saving the cost of the push button?
|
|
|
Post by papa on Jul 23, 2017 20:41:06 GMT
My research on successfully flashing ESP8266 boards often referred to not enough power being available to enter flashing mode: Not enough steady power from FTDI USB programmer, wires too long or thin, bad connections to the pads, etc. My alligator clipping to the pads was not stable enough. A programming jig I made was not always reliably touching the right pads. Sometimes recommended for smoothing power was a large capacitor between the VCC & GND pads on the ESP8266 board, maybe 470 microFarads or 1,000 microFarads. I decided to improve my programming jig & try a 220 microFarad capacitor, the biggest I had on hand.
I would have ordered a ESP8266 programming jig, but all I saw presupposed 16 pads on the board. The ECOPlug boards have 18 pads, 9 on each side.
When I completed the above improvements plus GNDing CHIP_EN, I successfully reflashed my 2 ECOPlugs. Now I can use Over the Air (OTA) programming with the ECOPlugs as documented by jimkernsjr.
Below, I will summarize what worked for me.
|
|
|
Post by papa on Jul 23, 2017 22:04:02 GMT
How I Re-Flashed an ECOPlug (Updated Model) << Image 4. For the necessary connecting points, see this image of the ECOPlug's former ESP8266 board that I got from here. Yellow text & lines are from the original image. Orange & white text or lines are my updates. The current board looks similar to this, except it's missing the 3 large mounting holes & the push button side connects to the bottom circuit board through right angled pins. In some way, make the following connections between an FTDI programmer & the ESP8266 board: As seen when the WiFi antenna is uppermost FTDI ESP8266 daughterboard GND GND (upper right pad) via the negative lead of a large capacitor (> 219 microFarads) VCC VCC (2nd down from upper left) via the positive lead of the large capacitor RX TX (5th pad down from upper right) TX RX (6th pad down from upper right) GND GPIO0 or GPIO0 to ESP8266 board GND pad CHIP_EN GND << New connection added to previous list (3rd pad down from upper left)To make the above connections, you might solder wires to the ESP8266 board's pads, but be aware the wires & capacitor may well not fit into the closed case. Or as I did, you might make a programming jig to press on top the pads.
|
|
|
Post by papa on Jul 24, 2017 0:41:27 GMT
The Programming Jig I Made to Get the Connections Above:I'm sure someone more experienced could make a better jig, perhaps with pogo pins, but this one worked for me. 5) Jig Off 6) Jig Installed Note: Image 6 is the current board version rotated 90 degrees clockwise from the former board's Image 4 position. See the labels for the WiFi antenna. Get the following ready, BUT WAIT until the next post to connect to power & USB.I used a semi-clear portion of a plastic ice cream tub lid, fairly stiff, but soft enough to pierce with a needle. With tracing & a straight edge, I made the basic shape of the board. Gradually, with utility knife & small nippers, I cut out the rectangular hole for around the white-labelled metal shield & notches to go around the push button & right-angled connectors. Notice that the pads around the shield are visible through the semi-clear plastic. Once I had the jig cut to fit securely, but not too tightly around shield, etc, I used a small needle to pierce two small holes over the needed pads. With a larger needle, I expanded holes over the VCC & GND pads to receive the capacitor leads. Over the other pads, the small needle holes would receive pieces of resistor leads, thin wires that will take a fair amount of bending. Each wire goes down through the plastic, is bent to make a flattish loop, a wire "stitch," to sit across a pad (at right angles to the rectangular metal shield), is bent again to go up through the pad's other needle hole, & is bent once more to secure the wire to the top of the plastic. Each wire lead on the Rx-TX side can extend horizontally from the jig. The wire leads on the CHIP_EN-VCC side can extend vertically from the jig. For each pad, make sure the wire stitch is over its pad ... make sure nearby wires do not touch each other. Unless the pad is supposed to be GNDed, do not let a pad's wire touch the rectangular metal shield which is connected to GND. Make a final check of each pad's wire stitch being over its pad. As you can see from my very pierced jig, the plastic will allow you to change holes & wires to better locations. To connect pad wires to its FTDI counterpart, I used an insulated wire bared on each end, one end had a small alligator clip to attach to a jig "whisker" & the other end was bared enough to bottom in its FTDI socket. (FTDI VCC connects to the large capacitor's positive leg that touches ESP8266 VCC pad.) I also had two insulated wires with an alligator clip on each end. One wire would connect GPIO0 to GND (negative lead of capacitor). The other wire connected CHIP_EN to GND.
|
|
|
Post by papa on Jul 24, 2017 2:12:49 GMT
I'm assuming you've augmented the Arduino IDE & used the settings from jimkernsjr's ESP8266 thread. BEFORE connecting FTDI/jig to power & USB ...Visually check the wires stitches' locations over the pads. When sure, clamp the jig's wire stitches firmly on the ESP8266 pads. 7) Spring-loaded wooden clothes pin 8) Spring-loaded metal hair clips To clamp the jig to the ESP8266 pads, I re-purposed spring-loaded wooden clothes pins. I rotated the wooden pieces in the spring to make a fairly shallow clamp to fit in the tight space beneath the ESP8266 board. I wonder if metal hair clips like pictured above might work as clamps, especially if flattened & the inner surfaces were insulated (electrical tape?) against shorting out undesired connections. For now, do NOT connect GPIO0 to GND & do NOT connect CHIP_EN to GND. Do make the rest of the connections. Now (while properly augmented & set Arduino IDE is running), connect FTDI / jig to power & USB. In the IDE, if necessary, select the FTDI's port under the Tools menu. Open the serial monitor. At this point, the ESP8266 board's blue LED should flash AND the serial monitor should show output like here. When you click the push button, the red power LED should toggle on or off. These results indicate that the ESP8266 board's VCC, GND, & TX are connecting properly. If not, re-examine your work. If the last paragraph was successful, disconnect from power / USB. Make ALL necessary connections on the jig, including GNDing GPIO0 & CHIP_EN. At this point, I believe the blue LED will be off & the board ready for flashing. You can proceed with uploading new programming for the ECOPlug. Those of you using this forum's approach, use jimkernsjr's sketch & a customized ECOPlug header file (ECOxxxx.h), upload new programming to the ESP8266 board. After Arduino IDE compiles the sketch, it should show a growing line of periods signalling upload progress & the board's blue LED should flash rapidly. A little while after the upload finishes, the blue LED should blink & then be on steady. indicating connection with your WiFi router & with MQTT on your host computer. If so, you can disconnect FTDI / jig & reassemble the ECOPlug in its case. It should be ready to use (with the right OpenHAB entries, examples here) & to reprogram (if desired) over WiFi connection (OTA) as jimkernsjr described.
|
|