Go Down

Topic: Kambrook Remote Power Outlet & Arduino - working (Read 22709 times) previous topic - next topic

Hi pico, thanks for the link. That is actually the first thing I tried but other than rf_sniffer started the RF module is not decoding any signals.

Could you help me decode the signal I posted in the image? This will give  me a starting pout to decode the rest of my buttons.

pico


Hi pico, thanks for the link. That is actually the first thing I tried but other than rf_sniffer started the RF module is not decoding any signals.

Could you help me decode the signal I posted in the image? This will give  me a starting pout to decode the rest of my buttons.


Well, from memory the way the bits are coded is a time interval between a rising edge and the subsequent falling edge. So it looks like you got 44 bits there. If a long interval is 1 and a short one is 0 (have to check that though), it would be 0101010111...

There a number of different coding formats with different bit lengths, so I check in the code to see if any of the encodings were 44 bit, including any preamble etc. then you could try to match the sequence to that encoding. If you can't identify a suitable encoding, you could try to output the sequence "raw" -- just bit bang the transmitter with the appropriated timings.

Hope that helps. Let us know what you find.
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Thanks pico.

I checked that picture I posted and it was missing a few bits off the end. There are 48 bits in total. I broke them up into 6 byte lengths and did as you suggested. Now I have a stream of bits .. whats the best way to test? Someone here mentioned they have a Arduino Sketch that works?


Great Success! I managed to get my Kambrook Power Outlet Switch to constantly switch on / off with Arduino Uno and a modified RCSwitch sketch and Library.

My Kambrook Power Outlets cam with a mini RF remote that has 4 buttons. They are toggle buttons i.e. press once for ON, press again for OFF. Unfortunately there is no way of checking weather your Kambrook Power Outlet Switch is ON or OFF other than by looking at the blue led on the Switch.

Thanks pico for your help.
For any one trying to do the same I also found this to be helpful in decoding my own remote codes:
http://www.beyondlogic.org/blog/2013/10/reverse-engineering-the-rf-protocol-on-a-kambrook-power-point-controller/

I found that if I decode just one button, I can calculate what the other button codes are as their DATA bytes are sequential.

I also modified the RCSwitch library and added a 4th Protocol. Perhaps the authors would like to update the library and add these changes?

Code: [Select]
/**
* Sends a "0" Bit
*                       _   
* Waveform Protocol 1: | |___
*                       _ 
* Waveform Protocol 2: | |__
*                       _
* Waveform Protocol 4: | |_
*/
void RCSwitch::send0() {
    if (this->nProtocol == 1){
        this->transmit(1,3);
    }
    else if (this->nProtocol == 2) {
        this->transmit(1,2);
    }
    else if (this->nProtocol == 3) {
        this->transmit(4,11);
    }
    else if (this->nProtocol == 4) {
        this->transmit(1,1);
    }
}

/**
* Sends a "1" Bit
*                       ___ 
* Waveform Protocol 1: |   |_
*                       __ 
* Waveform Protocol 2: |  |_
*/
void RCSwitch::send1() {
      if (this->nProtocol == 1){
        this->transmit(3,1);
    }
    else if (this->nProtocol == 2) {
        this->transmit(2,1);
    }
    else if (this->nProtocol == 3) {
        this->transmit(9,6);
    }
    else if (this->nProtocol == 4) {
        this->transmit(2,1);
    }
}


My PulseLength was set to 310

And in the synchSend function I added:

Code: [Select]

    else if (this->nProtocol == 4) {
        this->transmit(1,100);
    }

pico


Great Success! I managed to get my Kambrook Power Outlet Switch to constantly switch on / off with Arduino Uno and a modified RCSwitch sketch and Library.


Well done. It's always gratifying when you crack it, isn't t? :-)
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)


Well done. It's always gratifying when you crack it, isn't t? :-)


Sure is :) ... now to make something useful out of it ;)

The one thing these Power Outlet Controllers are missing is feedback :(  Maybe I could build a small light sensor using a Microduino that would sit over the top of the blue LED and send an RF signal back to say weather the Power Outlet is ON or OFF.

I would not want to open these up and hack the circuits inside for safety reason already mentioned on this forum.

Hi Guys
If anyone is interested, I've just set up a repository on github which is an extension to the RCSwitch library with support for both sending and receiving using the Kambrook remote power points.
You can find it here:
https://github.com/GraemeWieden/RCSwitch

I've been using the Kambrook modules and remote with the Arduino for some time, but never bothered to use the RCSwitch library as it takes up too much precious space in the Arduino - but I thought I'd push the code back into the RCSwitch library as it seems like quite a few people could get some use out of it. I've gone down the same path as CrashTest and added a 4th protocol to the base library to support the Kambrook's short short / long short encoding scheme.

I've also updated the ReceiveDemoAdvanced and SendDemo examples to show how to use it.

Note that the Kambrook uses a 47bit (48 including sync) packet so the return data from getReceivedValue had to be increased from a 32 bit unsigned long to a 64 bit unsigned long long.

Please let me know if you have any problems.


For anyone that is interested, I have updated the original code to include MQTT message handling for receiving commands via an IP network and the ability to edit the Master Code.  The code can be downloaded from here:

https://github.com/mike-linus/M2M/tree/master/Arduino/Power%20Control

nevoz

Great work mike-linus ... thanks for re-doing the code .. much more professional compared to my noob code!!

dbanerje




I am happy to send these codes to anyone who wants them. I wasn't sure whether I should post it publicly in case it encourages the manufacturer to change the codes.



I'd appreciate the code.
Can you please email at d_banerji@yahoo.com
Thanks and regards

dbanerje

Hi guys, first of all thanks very much all for the code.
I can turn on the Kambrook power outlet without any problem using SendDemo code but I seem to have problem in turning it turn off. It works sometimes and sometimes it doesnt. I have checked the code coming from the remote multiple times.
Any idea?
Regds

Go Up