Hi,
(My apologies in advance if this post turns out to be a duplicate)
It has bugged me for some time that the button header on the Sonoff Dual does not behave as expected.
Button 0 toggles Relay 0. All fine and dandy so far.
Button 1, however, toggles relay 1, delay a bit, then toggles relay 1 and relay 0.
For my application I need the inputs to toggle the corresponding outputs.
So, i ordered a USB-to-JTAG/C2 adapter from ebay and got it delivered yesterday. I have extracted the firmware from the 8051 and I am currently in the process of documenting the disassembly of the firmware to revese engineer the relevant pieces of code. The image contains ~2kB of code and data so there should be around 6kB of space available for other use.
So far I have discovered that the firmware contains code for 4 buttons and 4 relays, so there is a lot of unused code in the Sonoff Dual, which leads me to believe that the 2kB can be further trimmed down to allow for more custom code.
Since I needed to solder headers to C2K and C2D, I seem to have a spare pin for other use. I was thinking of the possibility of connecting C2D/P2.0 to a 1-wire net for temperature readings.
For building a custom firmware to change the behavior of the buttons, no changes needs to be made to the Tasmota firmware. I can duplicate the (simple) communication protocol already in place over the uart.
But, if I include 1-wire code in the 8051, some changes needs to be made in Tasmota. Would there be any interest in haleping me out on the tasmote-side of things so I can concentrate on one code base? By defining an api over uart which does not break existing implementation, we could work in parallell to implement the needed functionality.
So, my question really is if anyone is interested in adopting the code on the Tasmota-side to make this a reality. It would greatly reduce my workload, not having to dive into yet-another-codebase just to implement something that should be relatively easy for someone already familiar with the Tasmota codebase.
The code for the new firmware for the 8051, along with instructions on how to flash it on the 8051 will of course be released to the open source community.
/Thomas Hellström