Help with Sonoff flashing

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Help with Sonoff flashing

#1 Post by vbhoj74 » 05 Mar 2017, 12:11

I'm not an expert with this, but do have some coding background.

I bought few sonoff basic and couple of sonoffTH 16 directly from ITEAD, got delivery last week, and since then I tried to flash espeasy bin to 3 generics and 1 TH16 (v2), it flashes but after reboot there is no SSID, no LEDs, nor does the button works. I thought maybe I was flashing incorrectly, so to check I tried to flash a basic sketch as below which worked.

Using Arduino (Generic ESP8266 / 80 Mhz / 40 Mhz / DIO / 115200 / 1M (SPIFFS) / CK / Disabled / None on Com6) I flashed a generic blink & join wifi scketch from here:

https://github.com/SuperHouse/BasicOTAB ... ABlink.ino

The sonoff, booted, joined the wifi, and started blinking fine. So the device is working, which means I'm not doing any error in flashing.

Then Uploaded ESPeasy src sketch, instructions from below:
http://www.letscontrolit.com/wiki/index ... are_Upload
post that, I'm getting the below output on serial monitor with no response from the sonoff:

Code: Select all

ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset
This is how my sonoff generic looks like:

Image
Image

Any help will be greatly appreciated. I'm basically trying to get this working with smarthings using a custom firmware listed here:
https://community.smartthings.com/t/rel ... ches/45957

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Help with Sonoff flashing

#2 Post by paxi » 05 Mar 2017, 13:23

Try a precompiled image from here and use the included flash.cmd: http://www.letscontrolit.com/downloads/ ... 47_RC8.zip

Then powercycle the device. Use mains power or a seperate 3.3V supply, FTDI adapters usually don't provide enough current to run the esp. It can take a while for the "ESP_0" SSID to appear (WPA "configesp", IP 192.168.4.1). This worked for me with a bunch of sonoffs.

After confirming "stock" espeasy works you may try the custom version again but if you still have problems with that you'd have to bother the maintainer. ;)

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#3 Post by vbhoj74 » 05 Mar 2017, 13:58

Thanks for the reply.

I tried flashing the R120 and R100 bin before with same results. Tried flashing R147 as you suggested, still same result. Waited 15 mins for the SSID to appear. Here is the flash log:

Code: Select all

D:\NodeMCU_ESP8266\Sonoff\stock ESPeasy 147>esptool.exe -vv -cd nodemcu -cb 115200 -cp COM6 -ca 0x00000 -cf ESPEasy_R147_1024.bin
esptool v0.4.6 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
        setting board to nodemcu
        setting baudrate from 115200 to 115200
        setting port from COM1 to COM6
        setting address from 0x00000000 to 0x00000000
        espcomm_upload_file
        stat ESPEasy_R147_1024.bin success
        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
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_open
Uploading 431376 bytes from ESPEasy_R147_1024.bin to flash at 0x00000000
        erasing flash
        size: 069510 address: 000000
        first_sector_index: 0
        total_sector_count: 106
        head_sector_count: 16
        adjusted_sector_count: 90
        adjusted_size: 05a000
        espcomm_send_command: sending command header
        espcomm_send_command: sending command payload
        setting serial port timeouts to 10000 ms
        setting serial port timeouts to 1000 ms
        espcomm_send_command: receiving 2 bytes of data
        writing flash
......................................................................................................................................................................................................................................................................................................................................................................................................................................
starting app without reboot
        espcomm_send_command: sending command header
        espcomm_send_command: sending command payload
        espcomm_send_command: receiving 2 bytes of data
closing bootloader
        flush start
        setting serial port timeouts to 1 ms
        setting serial port timeouts to 1000 ms
        flush complete

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Help with Sonoff flashing

#4 Post by paxi » 05 Mar 2017, 14:39

The log looks ok.
There may be some residual settings in the flash, try to clear it with the attachment in this post:
viewtopic.php?f=5&t=721&p=13435#p13435

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#5 Post by vbhoj74 » 05 Mar 2017, 15:01

Flashing that bin is giving me errors, do I need to change any param in the cmd?

Code: Select all

D:\NodeMCU_ESP8266\Sonoff\ESPEasy flasher>esptool.exe -vv -cd nodemcu -cb 115200 -cp COM6 -ca 0x00000 -cf ESPEasy_R0_1024.bin
esptool v0.4.6 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
        setting board to nodemcu
        setting baudrate from 115200 to 115200
        setting port from COM1 to COM6
        setting address from 0x00000000 to 0x00000000
        espcomm_upload_file
        stat ESPEasy_R0_1024.bin success
        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
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_open
Uploading 1048576 bytes from ESPEasy_R0_1024.bin to flash at 0x00000000
        erasing flash
        size: 100000 address: 000000
        first_sector_index: 0
        total_sector_count: 256
        head_sector_count: 16
        adjusted_sector_count: 240
        adjusted_size: 0f0000
        espcomm_send_command: sending command header
        espcomm_send_command: sending command payload
        setting serial port timeouts to 10000 ms
        setting serial port timeouts to 1000 ms
        espcomm_send_command: receiving 2 bytes of data
        writing flash
.       read 0, requested 1
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed
warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x04
closing bootloader
        flush start
        setting serial port timeouts to 1 ms
        setting serial port timeouts to 1000 ms
        flush complete

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Help with Sonoff flashing

#6 Post by paxi » 05 Mar 2017, 17:32

Hmm, strange. This always worked for me.

How are you powering the sonoff for flashing?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#7 Post by Shardan » 05 Mar 2017, 18:21

First:
Please use a separate power supply, not the one on the board.
One wrong touch and it gets really dangerous.

As paxi said, the USB adapters usually don't give enough power for that.

Which memsize did you choose? If i remember right, the sonoff basic has 1 MB so you should use the 1024-binary.

I usually use ESPlorer after programming for two purposes.
First i send a RESET command. That clears up all the free memory
of the ESP to remove remnants of the old firmware.
Second to monitor the device and see what ESPEasy gives back.
This usually gives some hints if something goes wrong.

Besides all that i've seen several reports about sonoff basics not working at all,
obviously they were "dead on arrival"

Regards
Shardan
Regards
Shardan

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#8 Post by vbhoj74 » 06 Mar 2017, 05:58

paxi wrote: 05 Mar 2017, 17:32 Hmm, strange. This always worked for me.

How are you powering the sonoff for flashing?
When flashing I'm powering using the FTDI, then reboot using main power (after removing FTDI).
Shardan wrote: 05 Mar 2017, 18:21 First:
Which memsize did you choose? If i remember right, the sonoff basic has 1 MB so you should use the 1024-binary.

I usually use ESPlorer after programming for two purposes.
First i send a RESET command. That clears up all the free memory
of the ESP to remove remnants of the old firmware.
Second to monitor the device and see what ESPEasy gives back.
This usually gives some hints if something goes wrong.

Besides all that i've seen several reports about sonoff basics not working at all,
obviously they were "dead on arrival"

Regards
Shardan
I tried with both 1024 & 512 mem sizes, as some blogs suggested they ran into same problem using 1024 sizes.
I'm not aware of ESPlorer or how to use, however I downloaded the same and it seems to be the IDE for lua language, can you kindly point me to a guide where I can flash .ino files and how to clean the memory ?

I'm not one but 10 sonoff basics, when the 1st one did not work, I tried with 2nd, then 3rd, and then stopped for obvious reasons. All my sonoff were bought directly from ITEAD.

Even I'm feeling that it is something to do with memory clearing, as the basic blink sketch (in OP) which worked for me is now no more working after the flash. Or I may have bricked one of the sonoff, just want to test with memory clearing before I move to the 2nd unit. Need guidance on how to clear the memory.

vojtishek
Normal user
Posts: 70
Joined: 12 Jan 2017, 08:00

Re: Help with Sonoff flashing

#9 Post by vojtishek » 06 Mar 2017, 09:19

Hi,
I had same issue and my problem was bad solder job, after resoldering flashed without any problem. 3.3V and 120mA is enough to program device. I'm using FTDI with 3v max 120mA. I've used flash.cmd with 1024 and your com port. You can also try to switch TR and RX , sometimes mismatched.

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#10 Post by vbhoj74 » 06 Mar 2017, 11:23

^ I was just trying with holding the jumpers in the holes, good idea, will do it in a proper way, did not had headers with me, ordered some.

vojtishek
Normal user
Posts: 70
Joined: 12 Jan 2017, 08:00

Re: Help with Sonoff flashing

#11 Post by vojtishek » 06 Mar 2017, 12:13

That will be the most probable the issue. You need to solder all pins really properly, otherwise it won't work.
It's little bit challenging, I can say :).

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#12 Post by Shardan » 06 Mar 2017, 14:22

vbhoj74 wrote: 06 Mar 2017, 05:58 I tried with both 1024 & 512 mem sizes, as some blogs suggested they ran into same problem using 1024 sizes.
I'm not aware of ESPlorer or how to use, however I downloaded the same and it seems to be the IDE for lua language, can you kindly point me to a guide where I can flash .ino files and how to clean the memory ?

I'm not one but 10 sonoff basics, when the 1st one did not work, I tried with 2nd, then 3rd, and then stopped for obvious reasons. All my sonoff were bought directly from ITEAD.

Even I'm feeling that it is something to do with memory clearing, as the basic blink sketch (in OP) which worked for me is now no more working after the flash. Or I may have bricked one of the sonoff, just want to test with memory clearing before I move to the 2nd unit. Need guidance on how to clear the memory.
I've checked my Sonoff Basics - they have 1024M Memory so that should be the .bin-file.

I don't use ESPlorer for flashing even if it might be possible. It's used here just for Monitoring.
With ESPEasy set the speed to 115200.
At starting up it Shows one or two lines of "chinese" then the boot message from ESPEasy should show up.

ESPlorer is a lua and microPython GUI, right. But for Monitoring and sending commands it works nicely.

I'm at work atm,so i'll try to give some advice but can't check:
- In the left pane there is a tab "NodeMCU" or "AT NodeMCU", if i remember right.open this tab.
- in the right pane Chose the COM port, mostly it is already selected.
- then still in the right pane click "Open" and power up the ESP to start Monitoring.

- in the left pane bottom there is a field for commands.
Type "RESET" into that field and click send.

But anyways: First get some pin headers and solder them in.
Holding the pins into the holes by hand will cause issues.
Regards
Shardan

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#13 Post by vbhoj74 » 06 Mar 2017, 15:24

thanks guys, I'll try with header pins & report back, will get them in 3-4 days.

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: Help with Sonoff flashing

#14 Post by paxi » 06 Mar 2017, 16:44

ESPlorer just for serial monitorimg seems overkill to me. I use PuTTy for that, it's just a few kB and runs without intall right from the exe.

Did you check output voltage of your FTDI? Mine happily provides 5V even when set to 3V, only the TX line changes voltage by the switch.

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#15 Post by twisztdauthority » 08 Mar 2017, 09:53

I too have recently gotten in a shipment of 5x sonoff basic switches from ITEAD this past week and am having a very similar issue.
my pins have been soldered on so I know this is not the issue.

It takes about 10+ attempts to get espeasy to do a complete flash without failing somewhere in between, usually in a different spot everytime.
When I am finally able to get a complete flash, nothing seems to work after that.
I get no output in the serial monitor, even after restarting. Baudrate 115200
Also no SSID appears after being plugged into mains.
Ive tried to flash 2x sonoffs and I am getting the same result with both.
the other 3x boards are running original eWelink firmware just fine.


I tried flashing multiple firmware, even one to just do a memory test and get no response at all in the serial monitor. No LED flash or response from pressing the button.
I cannot decipher what memory chip these current shipment of boards have, i googled them and got no results.

I still need to try an external 3.3v power supply.
I have only been using the ftdi232 (red) supplied 3.3v power but i see it working for so many other users so i do not see why this would be the issue.

I spent at least 6 hours trying to fix this issue so i'm hoping to figure something out so I can buy more and convert the rest with 3rd party firmware.

This is the error i get in arduino during a failed flash:
............................................................................... [ 33% ]
................................................................................ [ 66% ]
............................................................warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed
warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x04
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#16 Post by twisztdauthority » 08 Mar 2017, 10:33

just tested with an external measured 3.3v battery supply and still same result. Flash firmware end up crashing less than half way through.

this is the output from espeasy:

writing flash
................................................................................................................................................... read 0, requested 1
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed
warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x04
closing bootloader
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
Press any key to continue . . .




Starting to think this is some sort of memory issue.

Hope the thread OP doesnt feel hijacked, just trying to see if this last shipment of ITEAD sonoffs has something funky possibly going on.
I have not even been able to get the generic blink & join sketch that you posted working.

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#17 Post by vbhoj74 » 08 Mar 2017, 11:11

Its actually good to see I'm not alone with this issue. And I know that holding the pins can have issues, but it does not seem like in my case, I took extra care to hold them in place, however will try with the headers when I get the shipment. I too feel that the issue is something which their fresh lot, and it is not just with the basic models but the TH models as well.

The generic blink worked for me once, at the end even that stopped working.

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#18 Post by twisztdauthority » 08 Mar 2017, 21:30

I ordered another ftdi232 basic and (10x) 4mb memory chips to swap in.
Unfortunately it will be a couple weeks before I get to try these out.
It would be silly to have to replace the memory chips for this to work but I've noticed the ones on my board are different from others so maybe this has something to do with my memory errors.

here is a picture for reference
Image

At this point id even be happy just to get them back to the default firmware but i understand that it is not available.

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#19 Post by vbhoj74 » 09 Mar 2017, 03:14

I've the same exact memory chips on mine.

Can you post the link and price from where you are getting those memory chips from ?

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#20 Post by twisztdauthority » 09 Mar 2017, 03:22

I may just be flashing with improper parameters but i cannot get any info about the chip in the picture so im not even sure if its 1mb.

The ones i ordered are the 4mb chips that have been talked about in other sonoff threads.
link >>> http://www.ebay.com/itm/201098254024
currently 10x for $2.49 free shipping, so cheap ill take the gamble.
Soldering these little guys might be a challenge

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Help with Sonoff flashing

#21 Post by JustmeNL » 09 Mar 2017, 09:22

Hi,

I have had the same problems at first but using a soldered header and holding the button during the complete flashing process helped.

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#22 Post by twisztdauthority » 09 Mar 2017, 09:43

In regards to my sonoff,
Ive tried to hold the button through the entire process on a few flashes but this still failed to produce anything different.

My question is that even if i do get a complete flash every once in a while, why is there zero serial output from the port?
If the board was dead it likely wouldn't initiate the flash process at all.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#23 Post by Shardan » 09 Mar 2017, 14:47

Some facts about programming adapters:

The power supply of those adapters is weak.

My experience has shown that it does not work on every try i did.
It may do sometimes with a single ESP-01, i know those postings in the net were people described that it worked for them.
Definitely it never worked without issues even with the small ESP-01 for me, I have tried a lot.
For a somewhat "bigger" circuit as a sonoff basic it will very likely fail.

So the flash program shows a successfull transfer of data.

Nice, but what does this really say?
These programs do not "read back" the flash memory, programming is not verified.
It just can see that the boot loader says it receives data.
So the "successfull transfer" just says "i have sent data without interruption". That's all.
If the flash could be written correctly is on a completely other note.
A failing flash write may be a result of weak power, it's called "flash burning"
for a reason - it needs some power.

Beware of cheap FTDI adapters sold on several platforms in the net.

The FTDI232 is very popular. As a result it might be one of the most often faked chip on the market.
The manufacturer (Future Technology Devices Inc.) has taken measurements against these chips.
The drivers from FTDI are able to identify these faked chips. If you flash firmware, it seems to work.
But the driver inserts "NON GENUINE DEVICE FOUND" instead binary data into the transmitted data, this ruining your firmware.
As the flash is not verified after flashing, you see a "successfull transfer" after flashing - and you have no firmware on your chip.

I know these drivers were revoked in 2014 but do you know that since the version 2.12.12.0 (2/2016) the genuine check is back?

I assume most of the offered cheap FTDI programmers (around 2..4 EUR) won't work correctly for this reason.
I tried some of those myself and dumped them at last. Nowadays I use a programmer cable orginially
manufactured by FTDI. It came for around 20 EUR and voilá! It works like a charme out of the box.

If you want cheap programmers, try those breakout boards or cables with a CP2102 or CH340G chip.
These are used on the NodeMCU V2 / V3 and usually work without issues.
Always watch out they deliver 3,3V, not 5V - don't fry your ESP. Some of these boards can be jumpered to 3,3/5 V

Regards
Shardan
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#24 Post by Shardan » 09 Mar 2017, 15:28

twisztdauthority wrote: 09 Mar 2017, 09:43 In regards to my sonoff,
Ive tried to hold the button through the entire process on a few flashes but this still failed to produce anything different.

My question is that even if i do get a complete flash every once in a while, why is there zero serial output from the port?
Holding down the button all the time should not be necessary or even make any difference.
When starting up the ESP it "looks" if GPIO0 is connected to ground - in other words if the button is pressed.
That's the signal to start the boot loader process instead of the firmware in the flash.
At the point data transfer has started the button can be released.

For reasons what might have gone wrong see my posting above.
If the board was dead it likely wouldn't initiate the flash process at all.
Sure? It is not the most likely thing that might happen but i can imagine some reasons that would cause this behaviour.
A "dead" bit in the flash rom or just a broken "write" line to the rom for example.
Remember there is no "read back" after flashing. The data is sent to the boot loader. There is no check if the rom
really contains your binary after flashing. So all you know is that data was transferred to the serial of the ESP.
Regards
Shardan

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#25 Post by vbhoj74 » 09 Mar 2017, 15:47

Does this seems to be original FTDI chip ? :

http://in.element14.com/ftdi/um232h/mod ... dp/1870926

I can order one and try with this, if its the original version of what we are using now.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#26 Post by Shardan » 09 Mar 2017, 16:17

Hello,

sadly i can't guarantee for this chip being a original one.
Reports say that even reliable manufacturers have been cheated with cheap chip fakes,
Depending on the price it looks good anyways.

Just a hint from my daily tinkering:
For myself i prefer programming cables like this one:

http://media.rs-online.com/t_large/R7676200-01.jpg

There are cables manufactured by FTDI themselves so there are no problems with fake chips.
The handling of these cables for programming ESP's or tinkering with a raspberry is much easier.

As said watch out the programmer you buy has 3,3V TTL output. 5 V will destroy the ESP.

Regards
Shardan
Regards
Shardan

vojtishek
Normal user
Posts: 70
Joined: 12 Jan 2017, 08:00

Re: Help with Sonoff flashing

#27 Post by vojtishek » 09 Mar 2017, 18:35

I'm using this one without any problem.

https://www.aliexpress.com/item/1PCS-CH ... 0.0.lbFk6h

There is a switch between 3.3v and 5v.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#28 Post by Shardan » 09 Mar 2017, 21:48

vojtishek wrote: 09 Mar 2017, 18:35 I'm using this one without any problem.

https://www.aliexpress.com/item/1PCS-CH ... 0.0.lbFk6h

There is a switch between 3.3v and 5v.
Yes. It's a CH340G chip, that usually works without issues. It's the chip used on the NoceMCU V3.

Regards Shardan.
Regards
Shardan

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#29 Post by twisztdauthority » 09 Mar 2017, 22:15

This is the FTDI chip i have been using:
http://www.ebay.com/itm/FT232RL-3-3V-5- ... SwMNxXUxko

I ordered 3x different FTDI programmers from china so ill be posting back to this thread as soon as i get to test those out on my problematic sonoffs:
http://www.ebay.com/itm/262770616165?_t ... EBIDX%3AIT
http://www.ebay.com/itm/291816553699?_t ... EBIDX%3AIT
http://www.ebay.com/itm/291866940913?_t ... EBIDX%3AIT


Im still weary as if this is a power supply issue since Ive attempted to power from a separate power supply measured at 3.3v and still had same issues.

Ive also seen a few people who have powered through the mains on the sonoff while programming using just the Ground, Tx, and Rx leaving out the 3v3 Vcc but this inherently has its own risks of electrocution or frying something and i'm not willing to take that risk just yet.

Id like to thank the thread Op and others for sharing their experiences so far.

I have 5x more sonoff basics on the way =)

Will post back if I make any progress.

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#30 Post by twisztdauthority » 10 Mar 2017, 00:50

After further inspecting my FTDI programmer through Ft_prog, my serial #A50285BI indicates that I have been using a fake chip/programmer this whole time!

It doesn't seem to be "bricked" but this could very well be a reason for the failed flash attempts.

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#31 Post by vbhoj74 » 10 Mar 2017, 04:52

twisztdauthority wrote: 09 Mar 2017, 22:15 This is the FTDI chip i have been using:
http://www.ebay.com/itm/FT232RL-3-3V-5- ... SwMNxXUxko
By the looks of it, it seems we both were using same FTDI asapters, I bought it from:

http://www.ebay.in/itm/172493707105?_tr ... EBIDX%3AIT

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Help with Sonoff flashing

#32 Post by JustmeNL » 10 Mar 2017, 09:01

Hi,

Then you might want to check your ftdi driver version:

http://hackaday.com/2016/02/01/ftdi-dri ... hips-again

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#33 Post by vbhoj74 » 10 Mar 2017, 13:12

My windows 10 is always up to date and so should be the driver. Avoiding FTDI alltogether, I ordered couple of CH340G, let me try them once I get the shipment.

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Help with Sonoff flashing

#34 Post by JustmeNL » 10 Mar 2017, 13:15

The problems with fake FTDI chips are caused by an up to date driver.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#35 Post by Shardan » 10 Mar 2017, 16:47

JustmeNL wrote: 10 Mar 2017, 13:15 The problems with fake FTDI chips are caused by an up to date driver.
Older drivers may run - if they are availlable at all for W10.
More problem is that the new FT232 driver is rolled out by win-update automatically.
You may block Driver updates with Windows .- but that stops all drivers from updating,
that's what i would call a damn stupid idea. Updates usually come for a reason.

Anyways remember:

First: It is wantonly negligent and somewhat stupid in my eyes to use (or recommend to use) outdated software.

Second: For programming an ESP the FTDI has no advantage over the CP2102 and CH340G.

Third: The problem is not "an up to date driver" that locks fake chips. That turns things ridiculously upside down.
FTDI puts a lot of money and effort into developing this chip. They have the right to take measurements against criminals
that pirate their work. FTDI paid the development, it's their income.

So the problem are criminals copying those development even being too lazy to build their own driver and too niggard to pay for a product licence.
(BTW they are even too lazy and niggard to copy the driver and remove the genuine check.... that would be consequently at least :-) )

CH340G and CP2102 are sold for around 3..4 USD in EU.
If one can't afford 15€ for a original FTDI, he should take one of these chips instead
supporting counterfeiting or plagiarizing of merchandise, these chips do the same job anyways.

Shardan
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#36 Post by Shardan » 10 Mar 2017, 17:02

twisztdauthority wrote: 09 Mar 2017, 22:15 This is the FTDI chip i have been using:
http://www.ebay.com/itm/FT232RL-3-3V-5- ... SwMNxXUxko

I ordered 3x different FTDI programmers from china so ill be posting back to this thread as soon as i get to test those out on my problematic sonoffs:
http://www.ebay.com/itm/262770616165?_t ... EBIDX%3AIT
http://www.ebay.com/itm/291816553699?_t ... EBIDX%3AIT
http://www.ebay.com/itm/291866940913?_t ... EBIDX%3AIT


Im still weary as if this is a power supply issue since Ive attempted to power from a separate power supply measured at 3.3v and still had same issues.

Ive also seen a few people who have powered through the mains on the sonoff while programming using just the Ground, Tx, and Rx leaving out the 3v3 Vcc but this inherently has its own risks of electrocution or frying something and i'm not willing to take that risk just yet.

Id like to thank the thread Op and others for sharing their experiences so far.

I have 5x more sonoff basics on the way =)

Will post back if I make any progress.
Hello,

after my ranting may i do a bit of prophecy game? :P

The one you were using up to now... around 5 USD - a fake chip, won't work.
The first new one - same chip, even cheaper, most likely a fake chip too.
The second new one - i have tested that chip but not that specific adapter. Chances are it works.
The last one - as far as i can tell from the pictures i have successfully tested such an adapter already.

For some of these types you may get different drivers. Look for "VCP" (Virtual Com Port) drivers.
Regards
Shardan

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Help with Sonoff flashing

#37 Post by JustmeNL » 10 Mar 2017, 20:32

Hi Shardan,

I agree with you, but to help the OP who now doubts his flashmemory, and everything in between, it could prove handy to know what went wrong and why.

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#38 Post by vbhoj74 » 11 Mar 2017, 02:31

Well, to be honest when I bought the FTDI adapter only to flash the sonoff after reading the process in blogs how to do the same, no one cautioned about the fake FTDI adapters, I bought into them thinking they were genuine.

Even after the guidance provided here, and selecting to buy 10x the price of the fake I bought, no one can tell if I'm paying that price to buy another fake. Ppl can price them higher just to make them look genuine.

Which is why I settled for the safer CH340G.

twisztdauthority
New user
Posts: 8
Joined: 08 Mar 2017, 09:33

Re: Help with Sonoff flashing

#39 Post by twisztdauthority » 11 Mar 2017, 07:42

Shardan wrote: 10 Mar 2017, 17:02
twisztdauthority wrote: 09 Mar 2017, 22:15 This is the FTDI chip i have been using:
http://www.ebay.com/itm/FT232RL-3-3V-5- ... SwMNxXUxko

I ordered 3x different FTDI programmers from china so ill be posting back to this thread as soon as i get to test those out on my problematic sonoffs:
http://www.ebay.com/itm/262770616165?_t ... EBIDX%3AIT
http://www.ebay.com/itm/291816553699?_t ... EBIDX%3AIT
http://www.ebay.com/itm/291866940913?_t ... EBIDX%3AIT


Im still weary as if this is a power supply issue since Ive attempted to power from a separate power supply measured at 3.3v and still had same issues.

Ive also seen a few people who have powered through the mains on the sonoff while programming using just the Ground, Tx, and Rx leaving out the 3v3 Vcc but this inherently has its own risks of electrocution or frying something and i'm not willing to take that risk just yet.

Id like to thank the thread Op and others for sharing their experiences so far.

I have 5x more sonoff basics on the way =)

Will post back if I make any progress.
Hello,

after my ranting may i do a bit of prophecy game? :P



The one you were using up to now... around 5 USD - a fake chip, won't work.
The first new one - same chip, even cheaper, most likely a fake chip too.
The second new one - i have tested that chip but not that specific adapter. Chances are it works.
The last one - as far as i can tell from the pictures i have successfully tested such an adapter already.

For some of these types you may get different drivers. Look for "VCP" (Virtual Com Port) drivers.

I hope your prohpecy will come true.. Im not sure why I ordered the first one but chances are at least one out of those three will work. I hope! fingers crossed. Just got to wait for the snail mail to arrive.

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#40 Post by vbhoj74 » 13 Mar 2017, 14:39

Got the headers, using the same FTDI adapter tried to re-flash the sonoff basic with the custom firmware:

here is the output I get with putty when I rebooted it and powered it with the FTDI, it keeps looping:

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

Code: Select all

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3de0c112
~ld

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3de0c112
~ld

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3de0c112
~ld
With the FTDI disconnected and applying mains, still no SSID.

I will probably get the CH340G tomorrow, will update.

vbhoj74
Normal user
Posts: 14
Joined: 05 Mar 2017, 11:56

Re: Help with Sonoff flashing

#41 Post by vbhoj74 » 14 Mar 2017, 15:47

So the CH340 worked like a breeze, flashed in one go and the SSID came up in a minute. So it was the FTDI issue for me.

this is the one I bought and works for me:

http://www.ebay.in/itm/111921959292?_tr ... EBIDX%3AIT

Thanks everyone for all the great help !

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Help with Sonoff flashing

#42 Post by JustmeNL » 14 Mar 2017, 18:47

Hi vbhoj74,

Good to hear!

I'm glad for you that it was not your module's serial flash but the usb-serial adapter.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Help with Sonoff flashing

#43 Post by Shardan » 14 Mar 2017, 19:48

vbhoj74 wrote: 14 Mar 2017, 15:47 So the CH340 worked like a breeze, flashed in one go and the SSID came up in a minute. So it was the FTDI issue for me.

this is the one I bought and works for me:

http://www.ebay.in/itm/111921959292?_tr ... EBIDX%3AIT

Thanks everyone for all the great help !
Congrats!

That's the module i've tested and it works nicely for me too.
Regards
Shardan

starfish
Normal user
Posts: 38
Joined: 16 Feb 2017, 23:46

Re: Help with Sonoff flashing

#44 Post by starfish » 16 Mar 2017, 04:48

I had a similar problem when flashing a sonoff esp8266 module with 1M RAM. The espeasy flashing tool flash.cmd and flashesp8266.exe didnt indicate any error when uploading binaries but the ESP_0 AP never showed up after.
The only way to upload I found was the https://drive.google.com/file/d/0B3dUKf ... sp=sharing
ESP8266_flasher . Using this one, I could sucessfull flash ESPEasy_v2.0.0 mega binaries as well as the older R120 or R148.

Barcors
New user
Posts: 2
Joined: 21 Sep 2017, 13:07

Re: Help with Sonoff flashing

#45 Post by Barcors » 21 Sep 2017, 13:43

Hi everyone,
I have the same issue discussed here. I have tried a lot of things and firmwares with no luck.
I just want to add that firmwares Tasmota or Espeasy is not working on my sonoff basic device except this one:
https://youtu.be/lZOYQSDSoJw
This is Russian one but there in description is link to sketch.
Might be someone smarter can tell why this one is working on sonoff basic and other ones (Tsmota or Espeasy) - not.
P.S. My FTDI module is this one: CH340 USB to ESP8266 ESP-01 Wifi Module
and this one: CP2102 USB 2.0 to TTL UART Module 6Pin Serial Converter
And they flashing the same good.
Last edited by Barcors on 23 Sep 2017, 07:19, edited 1 time in total.

Madbanana
Normal user
Posts: 13
Joined: 16 Oct 2016, 20:48

Re: Help with Sonoff flashing

#46 Post by Madbanana » 21 Sep 2017, 23:47

Guys, don't know if this will help your issues, having used Sonoff relays for ages with no issues, two more arrived recently. I couldn't get either to flash with standalone programs, had to use Arduino IDE and set the flash mode to DOUT.

Seems the flash chips in the new ones are different to my old ones which happily worked on DIN.

I don't know if there's good reason or just chance but may be worth a try.

good luck!

Barcors
New user
Posts: 2
Joined: 21 Sep 2017, 13:07

Re: Help with Sonoff flashing

#47 Post by Barcors » 23 Sep 2017, 07:31

Today I have got luck flashing Espurna to sonoff basic relays. Espurna works great. :!: And you know it works "out of the box" with Amazon Alexa just need to set up names of your relays, wifi and thats it.
I must worn you that flashed and setted up relays must be left for a while to settle and after that you can ask Alexa to find new devices.
I have used exe flasher from espeasy 2 and bin file from Espurna. Downladed from github espeasy 2 zip, unarchived. Downloaded Espurna 1.9.2 and put file in to espeasy folder where other bin files. Run flasher. Choose com port and Espurna file an flash. :P
I would be happy if I helped someone because I was in trouble by myself for a long time. :shock:

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Help with Sonoff flashing

#48 Post by papperone » 23 Sep 2017, 08:57

Barcors wrote: 23 Sep 2017, 07:31 Today I have got luck flashing Espurna to sonoff basic relays. Espurna works great. :!: And you know it works "out of the box" with Amazon Alexa just need to set up names of your relays, wifi and thats it.
I must worn you that flashed and setted up relays must be left for a while to settle and after that you can ask Alexa to find new devices.
I have used exe flasher from espeasy 2 and bin file from Espurna. Downladed from github espeasy 2 zip, unarchived. Downloaded Espurna 1.9.2 and put file in to espeasy folder where other bin files. Run flasher. Choose com port and Espurna file an flash. :P
I would be happy if I helped someone because I was in trouble by myself for a long time. :shock:
Thanks to share your experience but I'm not sure you noticed this is ESPEasy forum not Espurna forum :mrgreen:
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests