Grafner Funksteckdose
Einstellen der Systemcodes zur Benutzung mit Raspberry Pi und Co
Falls jemand die Codes benötigt, der Aufbau ist wie folgt
- 10 Bits Sytemcode - 1 wird zu 11, 0 wird zu 01, z.Bsp 11011 ergibt 11 11 01 11 11
- 10 Bits Unitcode (00 = selektiert)
- 4 Bits command on/off - 0001=on, 0100=off
111111111100010101010001 # FFC554 Aoff (Systemcode 11111, Unit A)
111111111100010101010100 # FFC554 Aon (Systemcode 11111, Unit A)
ssssssssssAABBCCDDEE0ccc # systemcodes, unitcodes, command(001=on,100=off)
Links zu dem Thema:
/home/pi/433Utils/RPi_utils/switch.cpp 19.11.2017
/*
* Usage: ./switch <unitCode> <command>
* Command is 0 for OFF and 1 for ON
*
* Code for Raspberry Pi - send codes for grafner remote switch
* compile:
* g++ -DRPI ../rc-switch/RCSwitch.cpp switch.cpp -o switch -lwiringPi
*/
#include "../rc-switch/RCSwitch.h"
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
// GPIO 17, change if you use another Pin
int PIN = 0;
if (wiringPiSetup() == -1) return 1;
RCSwitch mySwitch = RCSwitch();
mySwitch.enableTransmit(PIN);
// select here the systemcode of your remote device
// the list is not complete, feel free to add missing codes :-)
// (only the first 10 bits have to be changed)
int Basis11111= 0xFFD551;
int Basis10111= 0xDFD551;
int Basis11011= 0xF7D551;
int Basis00001= 0x55D551;
int myBasis= Basis11011;
int ABCDE= 0x4000;
//int sel= ABCDE >> (atoi(argv[1])*2);
//int korr= 0x800000 >> 2;
//printf("===%d===\n", ( ABCDE >> (atoi(argv[1])*2) ) );
if (atoi(argv[1]) >= 1) {
mySwitch.send( myBasis - ( ABCDE >> (atoi(argv[1])*2) ) + atoi(argv[2])*3 , 24 );
}
else {
mySwitch.send(0x55C554, 24); // test
}
return 0;
}