Pages: [1]   Go Down
Author Topic: Sniff and retransmit RF-signal  (Read 15051 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
1. Is it even possible to "record" a RF-signal and repeat it later using the hardware setup in place?
2. Can I use the SoftwareSerial.h or does this hide something in the signal that is needed
3. 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]);
  }
}

Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 186
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote:
I'm not looking to decode the signal, just to transmit it again later.

I can not see how you are going to STORE the signal (so you can re-transmit it later) unless you DECODE it first?????

If it is a digital signal (most likely, given the frequency) then it comes in as ones and zeroes in bytes  that you can store and later transmit through a digital radio transmitter, even if you haven't decoded it it and have no idea what those values mean.
« Last Edit: January 04, 2011, 11:25:09 pm by arbarnhart » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Richard is right.  While it may be technically possible with very expensive hardware.  

On something like the arduino, not only do you need to decode the signal you need to demodulate it first.
« Last Edit: January 05, 2011, 12:40:45 am by cnt » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry about the misunderstanding. What I meant was that I'm not interested in "understanding" the signal and how it is build, I'm only interested in retransmitting it later. So what I want to do is to temporary "store" the signal in a byte-array and later transmit the content of the byte-array.

Logged

Atlanta
Offline Offline
Sr. Member
****
Karma: 1
Posts: 254
Arduino still rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your entire approach using serial library presumes that the remote you want to copy is using a serial UART.  It probably is not, thus this approach is doomed.

A better approach would be to think of a "logic analyzer".  Sample the input pin in a very tight loop at a high rate and record the values as a long string of HIGH and LOW.  You should be able to plot the data and compare it with a scope trace of the input pin.  To replay you must run another tight loop that executes at the same speed to write the bits to output pin.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is some good reading, but involves a computer instead.

This allows capturing RF and IR codes and reverse engineering them thru the Line-In of a computer sound card.




http://davehouston.net/learn.htm


Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okey, I think I understand and my initial approach seems, as you put it, doomed. But thank you all for your input. I'll read up on the "logic analyzer" and try it that way instead. I think that should work for at least one of the areas where I wanted to try this.

Logged

Pages: [1]   Go Up
Jump to: