Hello together.
Last night I flashed tasmota on a really cheap ( EUR 8,50 each) 4 channel china relais card I bought form chinese ebay diystore.
It looks like there are similiar widgets flooding in from the far east, 1 and 2 channel, too.
Basically, It works, i.e I can switch the relais on and off by issuing serial command strings, but it does not well integrate into the rest of tasmota framework.
So I had to keep track of relais state in some mqtt client, maybe FHEM (in some distant future end...)
So preferably, we could expand the sonoff 4CH backend stuff to use those thingies with the sonoff 4CH frontend (web buttons, dedicated relais commands, status message...)
It has a (presumably) ESP-01-s (1MB) plugged on its board, talking serially to some other µcontroller for the relais.
Similiar to the sonoff 4CH, but obviously not identical.
"API" of the thingie in a nutshell, as delivered on the sellers ebay page:
Relay control instructions (hex hexadecimal):
Open the first relay: A0 01 01 A2
Turn off the first relay: A0 01 00 A1
Open the second relay: A0 02 01 A3
Close the second relay: A0 02 00 A2
Open the third relay: A0 03 01 A4
Turn off the third relay: A0 03 00 A3
Open the fourth relay: A0 04 01 A5
Turn off the fourth relay: A0 04 00 A4
what I did:
- flash a stock sonoff-sensors.bin (v6.4.1) on the ESP
- configure it as "Generic" with all GPIO left unassigned
- (kept an Arduiono console for debugging on the line to find out what's going on)
- plug the ESP to the board again
- issue a
- $ mosquitto_pub -h 192.168.XXX.YYY -t 'cmnd/sonoff/serialsend5' -m '0xa00101a2'
voila - that's it :-)
No soldering or board tweaking required :-)
(well, actually I crafted a programming plug for the ESP01, because I think I will buy some more of those...)
I Tried to assign the RX/TX GPIO 1&3 to "SerBR", but this broke communication on the serial line, as I could watch on the arduino console.
The same happens when I switch the module type to some sonoff 4ch variant.
Anybody there having experience with such thingies?
btw: long term reliablity still to be tested, of course.
Maybe already code to share?
Or will it be my great occasion to dive into tasmota development;-O
I'd like to beg for assistance, then.
Is there a best point to start with module development?
Where is the code in the sonoff 4CH relais interface where I might step in?
How could any modification properly be integrated into the tasmota configuration framework?
How is the best way to organize github workflow?
==============
last but not least:
Great stuff, your tasmota!
Looks like it might solve 70 % of my problems I got stuck when I started with ESP-IoT two years ago.
The other 30 % I'm just trying to catch up with :-)
cu
Wolfgang Rosner