sui77 / rc-switch

Arduino lib to operate 433/315Mhz devices like power outlet sockets.
1.89k stars 651 forks source link

SURNICE: receiver and transmitter #493

Open MHz000 opened 1 year ago

MHz000 commented 1 year ago

First of all, I would like to thank everyone who has contributed to this valuable library. After I was able to successfully clone two older RC sockets, I have a problem with a newer variant from the company SURNICE. I can receive and decode the data sent. However, when I send them back with my self-made transmitter, the socket does not respond. My receiver and my transmitter work perfectly as I could check with the older models. Does anyone out there have experience with the SURNICE model and can give me a tip? I am happy to publish my source code and also the results of the received data. But maybe the SURNICE models have already cracked. Thank you in advance for your assistance IMG_2134 IMG_2135

jradinger commented 7 months ago

Today, I've worked with another SURNICE outdoor RC socket and managed to switch it on/off with the rc-switch library, though it was a bit tricky. Actually I used the protocollessreceiver for of the rc-library (https://github.com/Martin-Laclaustra/rc-switch/tree/protocollessreceiver) and its ""ProtocolAnalyzeDemo"""ProtocolAnalyzeDemo""ProtocolAnalyzeDemo" to get the protocol https://github.com/sui77/rc-switch/issues/103.

The output for my model is as follows:

Output:
Received 10089520 / 24bit Protocol: 4
data bits of pulse train duration: 35536
proposed protocol: { 370, { 1, 6 }, { 1, 3 }, { 3, 1 }, false }
====
first level down
2260 
1080 400 336 1144 336 1144 1072 412 1068 412 332 1148 332 1144 1072 412 
1068 412 1068 412 1068 412 1068 416 328 1152 1064 416 328 1152 328 1152 
328 1152 328 1152 1064 420 1060 420 324 1156 324 1156 324 1156 324 1160 
324
====

Based on that I added the proposed protocol to rc-switch/RCSwitch.cpp and was able receive the codes the get sent when pushing the remote buttons. At this stage I realized that my SURNICE remote sends four different codes for switching on and switching off - however the order of the codes remain always the same. So basically sending out all four codes for ON makes sure that the socket is turn on, using the other four codes turns it off. So it bassically works. I also included the protocol { 370, { 1, 6 }, { 1, 3 }, { 3, 1 }, false } in the newest version of rc-switch (2.6.4) I've installed and was able to successfully send the codes to my RC socket (Not sure if receiving also works just by adding the protocol to version 2.6.4).

SURNICE

Hope that helps...if the protocol is common for other SURNICE sockets, this might be added to RCSwitch.cpp.