Hi,
I'm not quite sure it is possible but I would like to "sniff" a RF-signal from a remote control (that transmits on 433Mhz) and after the signal has been recorded, retransmit this signal later. I'm not familiar with the protocol of the remote control, but I'm not looking to decode the signal, just to transmit it again later. I have connected a RF-transmitter and a RF-receiver (like these: http://winavr.scienceprog.com/example-avr-projects/running-tx433-and-rx433-rf-modules-with-avr-microcontrollers.html) to a arduino board and I've built a simple "data logger".
Then using the "read"-function I see a lot of interference but I can also see that when I press a button on the remote control, the arduino picks up the signal.
The problem is that when I try to retransmit the signal, there is no response.
So my question is:
- Is it even possible to "record" a RF-signal and repeat it later using the hardware setup in place?
- Can I use the SoftwareSerial.h or does this hide something in the signal that is needed
- Have I done some mistake in the code
Code:
#include <SoftwareSerial.h>
#define rxPin 5
#define txPin 6
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
int charInt = 0;
int val;
byte serInString[1000];
int serInIndx = 0;
int serOutIndx = 0;
void setup() {
Serial.begin(4800);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(4800);
}
void loop() {
if (Serial.available()) {
val = Serial.read();
if (val == 'r') {
readSerialString();
}
if (val == 'd') {
dumpSerialString();
}
if (val == 't') {
transmitSerialString();
}
}
}
void readSerialString () {
Serial.println("reading");
for(serInIndx=0; serInIndx < 1000; serInIndx++) {
serInString[serInIndx] = mySerial.read();
Serial.println(serInString[serInIndx]);
}
Serial.println("done");
}
void transmitSerialString () {
Serial.println("transmit");
for(serInIndx=0; serInIndx < 1000; serInIndx++) {
Serial.println(serInString[serInIndx]);
mySerial.println(serInString[serInIndx]);
}
Serial.println("done");
}
void dumpSerialString () {
Serial.println("dump");
for(serInIndx=0; serInIndx < 1000; serInIndx++) {
Serial.println(serInString[serInIndx]);
}
}