Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an erase.sh script that will erase the Sonoff's flash #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rickvdl
Copy link

@rickvdl rickvdl commented Nov 24, 2019

I encountered some issues while connecting the Sonoff to my WiFi using the captive portal. The captive portal would not close and the Sonoff would not connect to my WiFi. After reading this very helpful comment: #3 (comment) I managed to solve the issue by erasing the Sonoff's flash before flashing the firmware.

I have added a little helper script and updated the README on how to solve this issue should you encounter it.

Copy link

@gsvan gsvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Do you by chance know how modify and then compile my own bin file from advance folder?
Thanks

@rickvdl
Copy link
Author

rickvdl commented Nov 24, 2019

@gsvan I haven't tried this yet, but I suspect it is (at least) running make on the Makefile that can be found in the sonoff_advanced directory. I will try this in the coming days so if I have any more information I will let you know :)

@gsvan
Copy link

gsvan commented Nov 24, 2019

That will be great, please let me know as I have no idea where I should put those advance directory files to compile :) thank you

@NajibNour
Copy link

NajibNour commented Nov 29, 2019

Beautiful!!! It resolved the wifi issue for me!! you did, however, forget the "./" before esptool.py

@magnip
Copy link

magnip commented Dec 18, 2019

@gsvan I haven't tried this yet, but I suspect it is (at least) running make on the Makefile that can be found in the sonoff_advanced directory. I will try this in the coming days so if I have any more information I will let you know :)

Hi did you get chance to test building using the makefile and if successful what route you took. I need to be able to change the gpio outputs. binary files work great I've even managed to combine
them into a single bin for flashing, I just can't seem to get a hold of compiling from the advanced
folder. any help would be appreciated.

@rickvdl
Copy link
Author

rickvdl commented Dec 18, 2019

@magnip Hi, sorry no unfortunately not. I ended up setting up a home-assistent instance on a raspberry pi and running tasmota on my switches, so I'm afraid I won't be of much help here. Good luck :)

@mariuszmikolajczak
Copy link

@rickvdl Hey! Thanks for this PR, it helped me to successfully flash my sonoffs. 👍

@pablorierad
Copy link

I have this problem and I can't find the solution. Sonoff won't connect to my wifi, the captive portal won't shut down.

This doesn't seem to solve my problem.

I have a Sonoff RF R2

Any solutions?
Thank you

@rickvdl
Copy link
Author

rickvdl commented Feb 3, 2020

@pablorierad Did you confirm erasing actually worked? (It might be that you have to change the serial port in the .sh script to your actual port)

@pablorierad
Copy link

pablorierad commented Feb 3, 2020

Thank you for your immediate response.

I copy the code from my terminal to show the procedure. I don't think I'm wrong about anything.

First I erase

iMac-de-Pablo:esptool-master pablorieraduarte$ sudo ./esptool.py -p /dev/cu.usbserial-A92DH7ZN --baud 115200 erase_flash
esptool.py v2.9-dev
Serial port /dev/cu.usbserial-A92DH7ZN
Connecting....
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: dc:4f:22:be:b9:f7
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 3.1s
Hard resetting via RTS pin...
iMac-de-Pablo:esptool-master pablorieraduarte$ 

Then I load the firmware

iMac-de-Pablo:esptool-master pablorieraduarte$ POWERON_STATE="ON"
iMac-de-Pablo:esptool-master pablorieraduarte$ SONOFF_PORT="/dev/cu.usbserial-A92DH7ZN"
iMac-de-Pablo:esptool-master pablorieraduarte$ 
iMac-de-Pablo:esptool-master pablorieraduarte$ #SONOFF_PORT="/dev/cu.SLAB_USBtoUART"
iMac-de-Pablo:esptool-master pablorieraduarte$ sudo ./esptool.py -p $SONOFF_PORT --baud 115200 write_flash -fs 1MB -fm dout -ff 40m 0x0 ./firmware/rboot.bin 0x1000 ./firmware/blank_config.bin 0x2000 ./firmware/Sonoff_$POWERON_STATE.bin
esptool.py v2.9-dev
Serial port /dev/cu.usbserial-A92DH7ZN
Connecting....
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: dc:4f:22:be:b9:f7
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash params set to 0x0320
Compressed 3104 bytes to 2169...
Wrote 3104 bytes (2169 compressed) at 0x00000000 in 0.2 seconds (effective 119.3 kbit/s)...
Hash of data verified.
Compressed 2048 bytes to 23...
Wrote 2048 bytes (23 compressed) at 0x00001000 in 0.0 seconds (effective 1025.7 kbit/s)...
Hash of data verified.
Compressed 476756 bytes to 337774...
Wrote 476756 bytes (337774 compressed) at 0x00002000 in 30.0 seconds (effective 127.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
iMac-de-Pablo:esptool-master pablorieraduarte$ 

After turning it on, the captive portal appears, I try to connect to my wifi but it never closes or connects, I can see it with my router.

@rickvdl
Copy link
Author

rickvdl commented Feb 3, 2020

@pablorierad Right, that looks OK to me, I'm sorry but I don't have any clue on what could be wrong, I don't maintain this project :) FYI I switched to Tasmota myself and let HomeAssistant do the communication with Homekit, since it appears to be a lot 'lighter' for the Sonoffs to run and it's much better supported.

Cheers

@gsvan
Copy link

gsvan commented Feb 3, 2020 via email

@gsvan
Copy link

gsvan commented Feb 3, 2020 via email

@pablorierad
Copy link

@rickvdl Thank you. I'll keep looking for a solution.

@gsvan Yeah, I only have 2.4gHz.

@pablorierad
Copy link

I found the solution.

My problem was that I didn't connect to my router, the solution was to change the name of my network.

Only with that it already works.
I hope I can help someone.

@ThomPatterson
Copy link

This proved to be a necessary first step. FWIW I was successful in flashing a Sonoff S31 Lite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants