Looking for detailed description for hacking a sonoff
-
Couldn't you just run the MySensors ESP gateway on it (presenting it as a binary switch)?
@hek two issues with your proposal:
- ESP-12 which is used for MySensors ESP GW has got more GPIOs and 4Mb memory. Sonoff has a limited number of GPIOs and 1Mb memory marginally better than ESP-01. This can be upgraded, but not easy. I can do SMT, but here is a challenge. See below

- connect nrf24l01+ - I did not figure out how to do that given that GPIOs are limited. Sure Arduino can be connected, but it is not the same
-
I hacked a sonoff dual:
https://itead.freshdesk.com/support/discussions/topics/11000006870It should be easy to upload a wifi gateway sketch. I made an MQTT integration.
-
Thanks for the great replies.
I'm not currently using MQTT, I'm running the Ethernet gateway via a W5100. Can I use the ESP boards, i.e this or the nodemcu without the need for an NRF24?
-
Thanks for the great replies.
I'm not currently using MQTT, I'm running the Ethernet gateway via a W5100. Can I use the ESP boards, i.e this or the nodemcu without the need for an NRF24?
@Mark-Swift how would you intend to use Sonoff with MySensors? Do you have the ESP GW?
I am using several Sonoffs with Domoticz via a JSON script. https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's
-
So - I agree re: Sonoffs - we've written our own software at the tech blog and though not quite step by step it is easy enough to use and ROMS are available to save you having to get into compiling code. We use Node-Red and MQTT as the base of everything - so you have a number of ESP sensors and relay controllers etc all talking to a Raspberry Pi - or something much cheaper like an Orange Pi Zero running Armbian for example - and basically you're sending simple MQTT messages around the house - nothing has to go outside unless of course you want remote control at a distance. Modifying Sonoffs is easy - I'm sitting in front of some now updating them with our software - just in the process of figuring our which port is used for the second relay in the DUAL product.
-
@alexsh1 Replace the FLASH in the Sonoff - easier in the latest models as they've put the FLASH chip on the back (Sonoff TH16 etc) - on the originals it was jammed in next to the programming button and a pain to replace.
-
@alexsh1 Replace the FLASH in the Sonoff - easier in the latest models as they've put the FLASH chip on the back (Sonoff TH16 etc) - on the originals it was jammed in next to the programming button and a pain to replace.
@peterscargill Peter, I am stuck with the previous model (WiFi + 433) and changing FLASH is literally impossible even with a small tip. Using a hot fan is not an option as it would melt down all plastic including the button.
-
Here is a working example of using Sonoff with MySensors and the mqtt gateway.
No need to replace any flash etc... -
Here is a working example of using Sonoff with MySensors and the mqtt gateway.
No need to replace any flash etc... -
So I have been debating on getting some of these sonoffs. I am assuming the WiFi gateway in the build section of the site is what I would need to build? Is there a better option for using these with my Vera Plus?
-
So I have been debating on getting some of these sonoffs. I am assuming the WiFi gateway in the build section of the site is what I would need to build? Is there a better option for using these with my Vera Plus?
-
@dbemowsk no, the wifi gateway above is to connect nrf24l01+ via wifi. For Sonoff I just reflashed it with easyesp and it works via my normal router with Domoticz. You can have the MQTT setup with Sonoff - thats what @peterscargill did
@alexsh1 said in Looking for detailed description for hacking a sonoff:
For Sonoff I just reflashed it with easyesp and it works via my normal router with Domoticz. You can have the MQTT setup with Sonoff - thats what @peterscargill did
Will it work with Vera? I purchased one of these recently from WalMart which also runs on an esp8266 module. I wonder if I can run run the easyesp firmware on that one also?

-
@alexsh1 said in Looking for detailed description for hacking a sonoff:
For Sonoff I just reflashed it with easyesp and it works via my normal router with Domoticz. You can have the MQTT setup with Sonoff - thats what @peterscargill did
Will it work with Vera? I purchased one of these recently from WalMart which also runs on an esp8266 module. I wonder if I can run run the easyesp firmware on that one also?

@dbemowsk Unfortunately, I am not familiar with Vera. Can you send http or json commands from Vera? If yes, it will work. On RPi this is easy to implement.
Generally speaking you can flash many devices with easyesp if you find how to connect FTDI. I have ESP-01 and ESP-12 running easyesp. Again I am not familiar with the device you posted (the most important question is does it have FTDI or can you identify it by soldering corresponding pins?) and suggest to ask the same question on the easyesp forum.
-
@alexsh1 I think all the information I need to flash it is in this post that I found on Hackaday. It is a bit different than the sonoffs in that it does not have an unpopulated header port for programming, so you have to solder directly to the module to get it programmed, but what the heck, I'll give it a shot.
As far a s controlling it from Domoticz, I am assuming that you just created a dummy switch that you used URLs for the on and off commands, correct? I will look into how to do that from Vera. Before I got my Vera (a month ago) I was using Domoticz.
-
@alexsh1 I think all the information I need to flash it is in this post that I found on Hackaday. It is a bit different than the sonoffs in that it does not have an unpopulated header port for programming, so you have to solder directly to the module to get it programmed, but what the heck, I'll give it a shot.
As far a s controlling it from Domoticz, I am assuming that you just created a dummy switch that you used URLs for the on and off commands, correct? I will look into how to do that from Vera. Before I got my Vera (a month ago) I was using Domoticz.
-
@dbemowsk yes, with Domoticz it is very straight forward, but you have to setup the Sonoff as well.
Check this out- http://www.letscontrolit.com/wiki/index.php/Tutorial_Domoticz_Switch
