SonOff without flashing firmware

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!
gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Monday 25 December 2017 21:25

vodor wrote:
Monday 25 December 2017 16:25
So I did checkout the beta from command line however never set it to use beta release via the domoticz interface. I did that again and it started working. So now I have 2 confirmed working setups with the plugins. Later the week I will be installing a few more switches.
Thanks for reporting back, that's 3 persons with a working install of the Sonoff V0.0.1 plugin :D

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Tuesday 26 December 2017 1:46

My Python plugin for Sonoff is now available on Github:
https://github.com/gerardwr/Sonoff-Domoticz

Both the initial version and revised version are published there.

vodor
Posts: 29
Joined: Friday 19 February 2016 15:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by vodor » Wednesday 27 December 2017 8:56

gerardwr wrote:
Tuesday 26 December 2017 1:46
My Python plugin for Sonoff is now available on Github:
https://github.com/gerardwr/Sonoff-Domoticz

Both the initial version and revised version are published there.
Awesome and very well done gerhardwr. I think this year im going to do something about learning some python.

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Wednesday 27 December 2017 10:27

vodor wrote:
Wednesday 27 December 2017 8:56
Awesome and very well done gerhardwr. I think this year im going to do something about learning some python.
Thanks @vodor, was fun creating the plugin.

Those are good intentions to learn some Python the coming year. Happy Newyear.

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Wednesday 27 December 2017 11:42

irongarment wrote:
Monday 25 December 2017 0:17
I have noticed the server will stop if I un-power the Sonoff device. There is an error reported. I should probably post an Issue on mdopp's GitHub.

But not today. It's Christmas Day. :)
Reported it today, here :
https://github.com/mdopp/simple-sonoff-server/issues/5

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Wednesday 27 December 2017 20:22

I have not given up the dream to "one day" create a Domoticz Python plugin that will
combine the functionality of the mdopp local Sonoff server AND the Domticz plugin I
recently created. Not yet!

I'm currently experimenting with the Python code of the Sonota server. It is designed to replace the Sonoff firmware with the Tasmota firmare, that's not what we want. But if you strip the firmware update part of the code it's also a fully working environment to config and serve Sonoff devices.
https://github.com/mirko/SonOTA

In combination with the earlier developed Domoticz plugin this is all the functionally you need to create a fully integrated Domoticz plugin. But the remaining Sonota code is too complex to add "as is" to plugin.

So the next step would be to strip the code further and migrate the complex Sonota mechanisms to simpeler code to add to the plugin. So that's what I'll try to do in the coming period. For fun!

In case you're interested in what I'm attempting, have a look here:
https://github.com/gerardwr/Sonoff-Domo ... ment%20log

Any help on moving forward is welcome!

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Saturday 30 December 2017 0:09

gerardwr wrote:
Wednesday 27 December 2017 20:22

I'm currently experimenting with the Python code of the Sonota server. It is designed to replace the Sonoff firmware with the Tasmota firmare, that's not what we want. But if you strip the firmware update part of the code it's also a fully working environment to config and serve Sonoff devices.
https://github.com/mirko/SonOTA
There's an "issue" reported on the SonOTA github, with some Sonoff devices with newer stock firmware refusing to work with the SonOTA software. It seems that the newer stock firmware increased the security measures in using websockets verification (rather technical). Here's a list of devices that work/not-work with the SonOTA software. Also contains a reference to the related github "issue":
https://github.com/mirko/SonOTA/wiki

Please note that the mdopp server from this topic uses the same websockets mechanism as SonOTA does. That could mean that if you have a device using the newer stock Sonoff firmware (V1.6.x??) the mdopp software may fail you.

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Saturday 30 December 2017 1:50

gerardwr wrote:
Saturday 30 December 2017 0:09
Please note that the mdopp server from this topic uses the same websockets mechanism as SonOTA does. That could mean that if you have a device using the newer stock Sonoff firmware (V1.6.x??) the mdopp software may fail you.
mdopp has confirmed that his sofware is also affected by the newer Sonfoff stock firmware:
https://github.com/mdopp/simple-sonoff- ... -354513312

Is this is not resolved the use of newer Sonoff's in Domoticz as described in this topic is not possible anymore :?

vodor
Posts: 29
Joined: Friday 19 February 2016 15:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by vodor » Sunday 31 December 2017 11:14

gerardwr wrote:
Saturday 30 December 2017 1:50
gerardwr wrote:
Saturday 30 December 2017 0:09
Please note that the mdopp server from this topic uses the same websockets mechanism as SonOTA does. That could mean that if you have a device using the newer stock Sonoff firmware (V1.6.x??) the mdopp software may fail you.
mdopp has confirmed that his sofware is also affected by the newer Sonfoff stock firmware:
https://github.com/mdopp/simple-sonoff- ... -354513312

Is this is not resolved the use of newer Sonoff's in Domoticz as described in this topic is not possible anymore :?
So flashing the original way via soldering etc. still remains? So why on earth don't they give you a way to flash without it the easier less intrusive way. They could have just plugged the security hole and made a legitimate easy way to flash without the need for soldering. Seems a bit spiteful. *sigh*

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Sunday 31 December 2017 12:20

vodor wrote:
Sunday 31 December 2017 11:14
So flashing the original way via soldering etc. still remains?
Yes, removing the stock firmware and replacing it with another one using the serial connection will still work.

But then you will lose the original functionality with the Ewelink App, since there's is no way installing a fresh stock firmware anymore.

UNLESS, you have made a backup BEFORE you flashed the new firmware. I seems that the stock firmware is tied to a specific Sonoff (using MAC address?).
I suppose if you backup the entire flash and save it in a secure place you can always flash it back again. BUT if have not tried that, so I can't confirm that this will work.
So why on earth don't they give you a way to flash without it the easier less intrusive way. They could have just plugged the security hole and made a legitimate easy way to flash without the need for soldering. Seems a bit spiteful. *sigh*
Ageed! Itead has shown little interest in opening up their firmware for "hacker" use. I guess they want to tie down their users to their own services so they can use the information for something else. The question remains, what's the "someting else", :twisted: or 8-)

gerardwr
Posts: 74
Joined: Saturday 28 January 2017 12:30
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by gerardwr » Sunday 31 December 2017 13:51

gerardwr wrote:
Sunday 31 December 2017 12:20
UNLESS, you have made a backup BEFORE you flashed the new firmware. I seems that the stock firmware is tied to a specific Sonoff (using MAC address?).
I suppose if you backup the entire flash and save it in a secure place you can always flash it back again. BUT i have not tried that, so I can't confirm that this will work.
Found a procedure to backup the stock firmware of a Sonoff device using a serial connection, it seems to be specific for each Sonoff. Did NOT try it myself yet!
https://github.com/mirko/SonOTA/issues/1

Code: Select all

Specifically, to backup:
esptool.py -p COM5 read_flash 0x0 0x100000 backup-0x00000.bin (note this is slow ~2 mins)
And to restore:
esptool.py -p COM5 -b 921600 write_flash 0x0 backup-0x00000.bin

vodor
Posts: 29
Joined: Friday 19 February 2016 15:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by vodor » Monday 01 January 2018 22:07

Damn that seems like a mission and yes one really has to question itead's intentions behind locking you into their cloud service.

Anyway for what its worth today I connected 8 x SonOff switches without issues using the sonoff-server and your plugin without any issues.
All of them was "model":"ITA-GZ1-GL","version":"1.5.5". I am considering also blocking their firmware server on my router to ensure they don't accidentally decide to connect and get new firmware.

serak
Posts: 6
Joined: Friday 15 December 2017 12:51
Target OS: Linux
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by serak » Tuesday 02 January 2018 23:48

I think, i can confirm Problem with newest firmware. I have Sonoff s20 with firmware 1.6.0 and I can't connect it to simple-sonoff-server. Because of some problems I've connected linux server direct to wifi AP itead_xxx and used part of script setup.sonoffdevice.js (_initdevice) only and succesfully imported settings to device (StatusCode 200). Now is device probably connected to router (two light flashes every two seconds) but device is not visible in device list on sonoff-server (http://192.168.1.100:1081/devices).

Ginkeltjes
Posts: 1
Joined: Thursday 04 January 2018 23:36
Target OS: Windows
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by Ginkeltjes » Thursday 04 January 2018 23:37

I think it would be a good idea if people post/vote here:
http://support.iteadstudio.com/support/ ... 1000017070

vodor
Posts: 29
Joined: Friday 19 February 2016 15:47
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by vodor » Friday 05 January 2018 10:09

Ginkeltjes wrote:
Thursday 04 January 2018 23:37
I think it would be a good idea if people post/vote here:
http://support.iteadstudio.com/support/ ... 1000017070
Good idea for what its worth. I added my support thanks.

DosN
Posts: 15
Joined: Monday 29 January 2018 8:58
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by DosN » Tuesday 30 January 2018 13:27

Could somebody explain , how to controll a sonoff with domoticz and without flashing(so with original Ewelink software from ilead).

I try to flash it , without success. i used different tools and bin file .. but nothink works for me

In this forum i see , it is also possible without flashing . But what is actual needed?
Do i have to sign up all SONOF units to the Ewelink cloud?
and setup this in domoticz like?
ON: http://127.0.0.1:1080/devices/deviceID/on
OFF: http://127.0.0.1:1080/devices/deviceID/off
or is there more to setup like a MQTT ??

maximus
Posts: 12
Joined: Wednesday 15 November 2017 23:40
Target OS: -
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by maximus » Saturday 17 March 2018 15:08

Hi,

i cant connect the the sonoff-server on pi3.

How did you do that with the network-manager?

I get problems with rasbian stretch and network-manager.

Does it works better with the new standard dhcpcd?

vivatauro
Posts: 5
Joined: Saturday 21 April 2018 11:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: SonOff without flashing firmware

Post by vivatauro » Thursday 26 April 2018 22:08

Hi guys:

Thanks for the great job you are doing with this. Actually I followed the instructions, and spend long hours... without success.
I could read the sonoff Device stopped working for this. Which is really bad. I bought 10 of them!
Do you happen to know if a new firmware was released or any other integration method with Domoticz?

Thanks and have a good day

User avatar
ecvn
Posts: 9
Joined: Sunday 29 April 2018 23:29
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Rotterdam
Contact:

Re: SonOff without flashing firmware

Post by ecvn » Sunday 06 May 2018 18:41

vivatauro wrote:Hi guys:

Thanks for the great job you are doing with this. Actually I followed the instructions, and spend long hours... without success.
I could read the sonoff Device stopped working for this. Which is really bad. I bought 10 of them!
Do you happen to know if a new firmware was released or any other integration method with Domoticz?

Thanks and have a good day
I followed a tutorial on YouTube (can't remember the name of the video but it was presented by a enthusiastic geeky bald guy who explained it really well) using the SonOTA over the air (OTA) method. Worked for me on the devices (4) I didn't already updated to version 1.6. The other ones I already updated unfortunately aren't supported so I have to flash these modules the old fashion way (still have to do this). Please pay special attention to which version the modules are on when your purchase them. Almost all modules are 1.6 or later so no (as far as I know) OTA method available. Good luck!


Verzonden vanaf mijn iPhone met Tapatalk
PM > Dutch + English

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests