Pages: 1 2 [3]   Go Down
Author Topic: Kambrook Remote Power Outlet & Arduino - working  (Read 13823 times)
0 Members and 1 Guest are viewing this topic.
OZ
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 21
Posts: 650
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
 
Logged

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.)

OZ
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

OZ
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
/**
 * 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:
    else if (this->nProtocol == 4) {
        this->transmit(1,100);
    }
Logged

Offline Offline
God Member
*****
Karma: 21
Posts: 650
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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? :-)
Logged

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.)

OZ
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Sure is smiley ... now to make something useful out of it smiley-wink

The one thing these Power Outlet Controllers are missing is feedback smiley-sad  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.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

OZ
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you  smiley
Logged

Pages: 1 2 [3]   Go Up
Jump to: