Show Posts
Pages: [1] 2
1  Topics / Home Automation and Networked Objects / Re: rf433 code for ELRO Flamingo home devices (FA500) on: July 08, 2014, 01:59:46 pm
...or so I tought.

In the end I was able to switch them on but not off. I decided to return my Flamingos to the shop because I don't like the fact that there are not physical switches to encode the addresses. It feels like I can never be sure which codes they react to, and the whole addressing thing feels a bit fragile to me.

Still, I would be interested in reading your full Flamingo journey with the help of Google translate.

Thanks,
probono
2  Topics / Home Automation and Networked Objects / Re: rf433 code for ELRO Flamingo home devices (FA500) on: July 01, 2014, 11:31:23 am
Hi Johan,

you are absolutely right -- I was (wrongly) assuming that pressing "A on" on my physical remote control would send the same code as your sketch (which did not work). After programming the Flamingos to listen to the sketch, it is now working wonderfully.

Out of curiosity, is it possible to translate the codes I have sniffed into the notation your sketch is using?

Thanks,
probono
3  Topics / Home Automation and Networked Objects / Re: rf433 code for ELRO Flamingo home devices (FA500) on: June 30, 2014, 04:20:25 pm
Hi Johan,

thanks for your reply. You are a great example of why I love the Arduino community smiley Maybe I will keep the Flamingo set after your encouraging post (was thinking of returning it to the shop).

Unfortunately, your code is not compiling for me, I get

Quote
Flamingo_send.ino: In function 'void Flamingo_Send(int, int, int)':
Flamingo_send:59: error: 'sendcmd_error' was not declared in this scope
Flamingo_send:71: error: 'sendcmd_error' was not declared in this scope
Flamingo_send:87: error: 'sendcmd_error' was not declared in this scope
Flamingo_send:112: error: 'rfPin' was not declared in this scope

Like this, I get it to compile:

Code:
/******************************************************************************
** Flamingo_send                                                             **
**                                                                           **
**       Flamingo device commands (on/off)hard coded (not deciphered yet)    **
**       code is 28 byte long. To transfer it in 32 bit code 4 *0            **
**       is added to the left. For programming reason hex code representation**
**       of device code is used. E.g. Remote 0,C,On:                         **
**         code 28 bits: 0001100110111111110100100110                        **
**         code 32 bits: 00011001101111111101001001100000                    **
**         Hex:          19BFD260                                            **
**                                                                           **
**        "Sync" 1 pulse High, 15 pulse low                                  **
**        "1"    1 pulse High, 3 pulse low                                   **
**        "0"    3 pulse High, 1 pulse low                                   **
**        "end"  N/A                                                         **
**                                                                           **
**       For internal ref: Unit 0 = white remote , unit 1 = black remote     **
**                                                                           **
******************************************************************************/
// Compiler only coding
#define FREMOTE 2                                  /*amount supported remotes */
#define FUNITS  4                                  /* Amount of units supported per remote */
#define FCMDN   2                                  /* Amount of CMD 0 = On, 1 = Off */

int rfPin = 10;

// define device codes:

uint32_t fdev[FREMOTE][FUNITS][FCMDN] = {0xD9762A10,                                           /* Remote 0, Unit A, On  */
                                         0xDAA47850,                                           /* Remote 0, Unit A, Off */
                                         0xDBDA22E0,                                           /* Remote 0, Unit B, On  */
                                         0xDBA27220,                                           /* Remote 0, Unit B, Off */
                                         0x19BFD260,                                           /* Remote 0, Unit C, On  */
                                         0x195EEAA0,                                           /* Remote 0, Unit C, Off */
                                         0x984CC650,                                           /* Remote 0, Unit D, On  */
                                         0x9A8C1050,                                           /* Remote 0, Unit D, Off */
                                         0xDBFFFE90,                                           /* Remote 1, Unit A, On  */
                                         0xD91CEF10,                                           /* Remote 1, Unit A, Off */
                                         0xDBC52FA0,                                           /* Remote 1, Unit B, Aan */
                                         0xD9E35160,                                           /* Remote 1, Unit B, Off */
                                         0x19B0FE60,                                           /* Remote 1, Unit C, On  */
                                         0x19682B20,                                           /* Remote 1, Unit C, Uit */
                                         0x9924E7D0,                                           /* Remote 1, Unit D, On  */
                                         0x9BA928D0                                            /* Remote 1, Unit D, Uit */
                                        };                                          


// Define Flamingo_send variables / constants

int fpulse = 300;                              /* Pulse witdh in microseconds */
int fretrans = 5;                              /* Code retransmission         */
uint32_t fsendbuff;
uint32_t fdatabit;
uint32_t fdatamask = 0x80000000;

void Flamingo_Send(int fhousec, int funitc, int fcmd)
{

  // Test if used codes are valid

  if ((funitc < 1) || (funitc >  2)) {                  // check if unit code between 1-2 (Remote 0 of 1)
    Serial.print("Unit error: ");
    Serial.println(funitc);
    return;
  }
  else  {
    funitc = funitc - 1;                               // To address right code in array
  }

  if ((fhousec < 0) || (fhousec >  3)) {               // check if house code between 1-4 (A-D)
    Serial.print("House error: ");
    Serial.println(fhousec);
    return;
  }

  if ((fcmd < 0) || (fcmd > 1)) {                       // check if command = 0 (off) or 1 (on)
    Serial.print("Command error: ");
    Serial.println(fcmd);
    return;
  }
  
  //End test used codes

  Serial.println("Send Flamingo command ");
  Serial.print("Flamingo House/Device code = :");
  Serial.println(fhousec);
  Serial.print("Flamingo Unit/remote code = :");
  Serial.println(funitc);
  Serial.print("command = :");
  Serial.println(fcmd);
  Serial.println();


  // Send Command

  for (int nRepeat = 0; nRepeat <= fretrans; nRepeat++) {

    fsendbuff = fdev[funitc][fhousec][fcmd];

    // send SYNC 1P High, 15P low
    Serial.println("Send sync");

    digitalWrite(rfPin, HIGH);
    delayMicroseconds(fpulse * 1);
    digitalWrite(rfPin, LOW);
    delayMicroseconds(fpulse * 15);

    // end send SYNC

    // Send command

    for (int i = 0; i < 28; i++)                                 // Flamingo command is only 28 bits */
    {
      // read data bit
      fdatabit = fsendbuff & fdatamask;                         // Get most left bit
      fsendbuff = (fsendbuff << 1);                             // Shift left

      if (fdatabit != fdatamask)
      { // Write 0
        digitalWrite(rfPin, HIGH);
        delayMicroseconds(fpulse * 3);
        digitalWrite(rfPin, LOW);
        delayMicroseconds(fpulse * 1);
      }
      else
      { // Write 1
        digitalWrite(rfPin, HIGH);
        delayMicroseconds(fpulse * 1);
        digitalWrite(rfPin, LOW);
        delayMicroseconds(fpulse * 3);
      }
    }
  }
}

void setup() {
  Serial.begin(9600);
}

void loop() {
  Flamingo_Send(0, 1, 1);
  delay(1000);
  Flamingo_Send(0, 1, 0);
  delay(3000);
}

Unfortunately, my Flamingos do not react. Do you have any way to determine, based on my information on https://gist.github.com/probonopd/331674026839b96cd8d7 what I need to change?

Thanks!
probono
4  Topics / Home Automation and Networked Objects / Re: rf433 code for ELRO Flamingo home devices (FA500) on: June 29, 2014, 04:43:36 am
Possibly the FA500 remote control is sending more required data than just the 24 bit code.

Using the Arduino sketch from the RCSwitch library, I get:

Code:
# A on
 
Decimal: 4260117 (24Bit) Binary: 010000010000000100010101 Tri-State: F00F000F0FFF PulseLength: 329 microseconds Protocol: 1
Raw data: 10232,392,928,988,332,388,924,388,932,388,928,384,940,380,928,988,336,380,928,384,940,380,928,384,940,384,928,380,940,384,932,980,340,380,932,376,948,376,932,984,340,376,940,976,348,372,936,980,344,

However, when I analyze the same signal using the rtl_433 tool from https://github.com/merbanan/rtl_433, I get:

Code:
# A on
 
*** signal_start = 38594077, signal_end = 38825145
signal_len = 231068, pulses = 614
Iteration 1. t: 161 min: 73 (528) max: 249 (86) delta 245
Iteration 2. t: 161 min: 73 (528) max: 249 (86) delta 0
Pulse coding: Short pulse length 73 - Long pulse length 249
 
Short distance: 197, long distance: 1237, packet distance: 2528
 
p_limit: 161
 
[00] {182} 13 72 39 b0 9b 91 cd 84 dc 8e 6c 26 e4 73 60 00 00 00 00 00 00 00 00 : 00010011 01110010 00111001 10110000 10011011 10010001 11001101 10000100 11011100 10001110 01101100 00100110 11100100 01110011 01100000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[01] {66} 00 00 00 00 00 00 00 00 00 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[02] {66} 00 00 00 00 00 00 00 00 00 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[03] {1} 00 : 00000000
[04] {58} 00 00 00 00 00 00 00 00 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[05] {58} 00 00 00 00 00 00 00 00 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[06] {58} 00 00 00 00 00 00 00 00 : 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[07] {25} 41 01 15 00 : 01000001 00000001 00010101 00000000
[08] {25} 41 01 15 00 : 01000001 00000001 00010101 00000000
[09] {25} 41 01 15 00 : 01000001 00000001 00010101 00000000
[10] {25} 41 01 15 00 : 01000001 00000001 00010101 00000000
[11] {25} 41 01 15 00 : 01000001 00000001 00010101 00000000
 

What seems suspicious is that the Arduino code apparently is only concerned with lines [07] to [11] above, totally ignoring lines [01] to [11]. Possibly this is why we cannot get sending to work using the the RCSwitch library.

Does anyone know that lines [01] to [11] could be? Interestingly, some bits in these lines change every time while others do not. Could it be some sort of collission protection scheme?

I have put more log output and an Arduino sending sketch on https://gist.github.com/probonopd/331674026839b96cd8d7.
5  Using Arduino / Networking, Protocols, and Devices / Re: Using TPlink WR703N router for Arduino on: April 19, 2014, 07:26:44 am
See https://gist.github.com/probonopd/9594775 for running the Arduino Yun (Linino) software on the WR703N. So far, I succeeded with the Arduino Uno and the Arduino Mega, and can use them like a Yun when connected to the WR703N. Right now it is a bit hackish but with some fiddling I got it to work.
6  Products / Arduino Yún / Re: Need help to run the Bridge on (USB CDC) Serial rather than Serial1 on: March 30, 2014, 01:23:08 pm
Thanks sonnyyu, but I still would like to make this run with the Arduino Leonardo as well.
7  Products / Arduino Yún / Need help to run the Bridge on (USB CDC) Serial rather than Serial1 on: March 30, 2014, 07:31:01 am
I have an Arduino Leonardo connected to my OpenWrt-based router via USB. On the OpenWrt router, I have installed the Arduino-related components of Linino as documented on https://gist.github.com/probonopd/9594775 - this setup works for other Arduinos but not for the Leonardo so far, since the Bridge library is using Serial1 rather than Serial (which I would want) on the Leonardo.

I would like to use the Arduino Yun's Bridge library and run it on an Arduino Leonardo, but rather than using the hardware serial RX/TX pins I would like to communicate over the USB CDC serial connection.

At the end of Bridge.cpp I find:

Code:
// Bridge instance
#ifdef __AVR_ATmega32U4__
// Leonardo variants (where HardwareSerial is Serial1)
SerialBridgeClass Bridge(Serial1);
#else
SerialBridgeClass Bridge(Serial);
#endif

I change this to:

Code:
// Bridge instance
// Port which normally prints to the Arduino Serial Monitor according to pins_arduino.h
SerialBridgeClass Bridge(SERIAL_PORT_MONITOR);

But now I get:

Code:
libraries/Bridge/src/Bridge.cpp:244: error: no matching function for call to 'SerialBridgeClass::SerialBridgeClass(Serial_&)'
libraries/Bridge/src/Bridge.h:94: note: candidates are: SerialBridgeClass::SerialBridgeClass(HardwareSerial&)
libraries/Bridge/src/Bridge.h:92: note:                 SerialBridgeClass::SerialBridgeClass(const SerialBridgeClass&)

In Bridge.h I find:

Code:
// This subclass uses a serial port Stream
class SerialBridgeClass : public BridgeClass {
  public:
    SerialBridgeClass(HardwareSerial &_serial)
      : BridgeClass(_serial), serial(_serial) {
      // Empty
    }

    void begin(unsigned long baudrate = 115200) {
      serial.begin(baudrate);
      BridgeClass::begin();
    }

  private:
    HardwareSerial &serial;
};

extern SerialBridgeClass Bridge;

Can you help me to make the Bridge work over (USB CDC) Serial rather than Serial1?
8  Topics / Home Automation and Networked Objects / Re: RF outlet library on: October 14, 2013, 05:45:57 pm
Can't read the text on the small chip, but have you tried this?
https://code.google.com/p/rc-switch/

Using a "1pcs RF transmitter and receiver kit for Arduino project 433Mhz" from eBay you can try to listen to what the remote sends, and re-send that from the transmitter...
9  International / Deutsch / Re: Lowcost Funksender mit Arduino kompatibel? on: October 14, 2013, 05:32:44 pm
Mit welcher Frequenz funkt er denn?
Ich habe hiermit gute Erfahrungen gemacht:
https://code.google.com/p/rc-switch/

Ein "RF transmitter and receiver kit for Arduino 433Mhz" bekommt man auf eBay.com schon für unter 1 USD...
10  Using Arduino / Programming Questions / Re: ir proto hex code almost done need a little help though on: July 06, 2013, 07:13:35 pm
If you would like to send Pronto Hex with an Arduino sketch:
https://github.com/probonopd/arduino-infrared-pronto
11  Using Arduino / Programming Questions / Re: Convert string sent over serial to array of hex numbers on: June 17, 2013, 04:36:11 am
Awesome!

This kind of stuff is really hard to spot for someone coming from the Python world... Too bad compilers can't give an error in these cases... Again, thanks for your spot-on help!
12  Using Arduino / Programming Questions / Re: Convert string sent over serial to array of hex numbers on: June 17, 2013, 03:40:57 am
In the meantime, I have added some code to actually send Pronto Hex IR codes.
https://gist.github.com/probonopd/5793692

I think with really long strings like

Code:
SEND 0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0679 015B 0057 0016 0E6C

it crashes, even if I set the inputLength to something like 512. Using freeRam() I suspect I am running out of RAM. Idea: Can the routine be modified so that instead of reading the entire line into a string and processing the string, each chunk (up to the next space) is processed until everyting is in the array?
13  Using Arduino / Programming Questions / Re: Convert string sent over serial to array of hex numbers on: June 16, 2013, 05:53:14 pm
Awesome!

That was it indeed. I had "both"...

Also I notice that when the last character is a blank (" "), then it doesn't work. But that's not a problem if you know it :-) Thank you so much for your help.
14  Using Arduino / Programming Questions / Re: Convert string sent over serial to array of hex numbers on: June 16, 2013, 05:33:15 pm
This works, but only exactly once. If I send the same string a second time over the serial line, it doesn't work anymore.

I must be missing something obvious...
https://gist.github.com/probonopd/5793692
15  Using Arduino / Programming Questions / Re: Convert string sent over serial to array of hex numbers on: June 16, 2013, 12:24:52 pm
Well spotted, thanks. But it still doesn't work  smiley-mad

http://codepad.org/jylhWIuX
Pages: [1] 2