itead / Sonoff_Devices_DIY_Tools

BSD 3-Clause "New" or "Revised" License
548 stars 168 forks source link

About Flash firmware process #24

Open ZZLinvec opened 4 years ago

ZZLinvec commented 4 years ago

Flash firmware works by sending unlock instructions to the device, then setting up a standard HTTP server, and then sending the server address to the device.The device will go to the HTTP server and request data. Of course, I use TCP to set up the server in my tool.

ZZLinvec commented 4 years ago

When the device receives unlock instructions, it will report to EWeLink server. EWeLink server will know that you agree with our statement. The device needs to connect to the network during this process, so a router with Internet access is needed to unlock the device.

alexbk66 commented 4 years ago

Flash firmware works by sending unlock instructions to the device, then setting up a standard HTTP server, and then sending the server address to the device.The device will go to the HTTP server and request data. Of course, I use TCP to set up the server in my tool.

@ZZLinvec - can you please provide more details when you post instructions. I can't understand what you mean.
What do you mean by "setting up a standard HTTP server"?
What do you mean by "sending the server address to the device"? What do you mean by "Of course, I use TCP to set up the server in my tool"? What do you mean by "EWeLink server will know that you agree with our statement"?

Can you please provide detailed instructions how to update firmware in DIY mode?

rradar commented 4 years ago

@ZZLinvec

EWeLink server will know that you agree with our statement.

This statement (loosing/voiding warranty) is illegal in Europe.

You still need to give FULL WARRANTY for the hardware part of your product.

Dump question: When soldering the pins and flashing my firmware I don't agree any (illegal) statement for voiding warranty. For itead everything is fine then?

alexbk66 commented 4 years ago

@ZZLinvec ?

ZZLinvec commented 4 years ago

@alexbk66 At present, it is explained according to my code, and I suggest you to look at my code

ZZLinvec commented 4 years ago

@alexbk66 The Flash firmware code is at the start of the 599 lines of https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/code/Dialog_text.py.

alexbk66 commented 4 years ago

I've got no idea what's going on there. That's the first time I see when device manufacturer to the sample code, not documentation...

ZZLinvec commented 4 years ago

Ha ha ha ha ha ha, document at https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/other/SONOFF%20DIY%20MODE%20Protocol%20Doc%20v1.4.md

alexbk66 commented 4 years ago

Man, I keep asking - how do I update firmware to latest version? For example, for Shelly devices Execute<Update>("ota?update=1"); That's all. So, how do I update firmware on Sonoff devices? I'm asking because I wrote Sonoff plugin for HomeSeer - so I must implement it for my users! Otherwise I will recommend all my users to choose Shelly instead, I have a plugin for Shelly as well.

ZZLinvec commented 4 years ago

All you need to do is set up a standard HTTP server for the device to fetch data, and the server holds the firmware for the device.Then, send the unlock instruction to the device. After the device is successfully unlocked, send the server information according to the OTA instruction.The device will then automatically get the address of the service.After downloading the firmware, the device will restart automatically and the device will start running your program.

ZZLinvec commented 4 years ago

This feature is for users to swipe third-party firmware.But it depends on the device

alexbk66 commented 4 years ago

So there's no way to update Sonoff firmware?