these things seemed cheap;
http://www.seeedstudio.com/wiki/index.php?title=433Mhz_RF_link_kit
but they've been expensive in trying to get them to work !
i've seen this thread on Virtual Wire Help;
http://forum.arduino.cc/index.php?topic=119170.0
so i'm aware of the library glitches in the switch from Arduino 022 to 1.0
i don't think i have that problem, compiling is fine - i just don't get anything received by the receiver Arduino.
any ideas on what else i could do to troubleshoot where the problem is ?
these are the "standard" codes used;
TRANSMITTER:
//Grove - 315(433) RF link kit Demo v1.0
//by :http://www.seeedstudio.com/
//connect the sent module to D2 to use
#include <VirtualWire.h>
int RF_TX_PIN = 2;
void setup()
{
vw_set_tx_pin(RF_TX_PIN); // Setup transmit pin
vw_setup(2000); // Transmission speed in bits per second.
}
void loop()
{
const char *msg = "hello";
vw_send((uint8_t *)msg, strlen(msg)); // Send 'hello' every 400ms.
delay(400);
}
and
RECEIVER:
//Grove - 315(433) RF link kit Demo v1.0
//by :http://www.seeedstudio.com/
//connect the receive module to D2 to use ..
#include <VirtualWire.h>
int RF_RX_PIN = 2;
void setup()
{
Serial.begin(9600);
Serial.println("setup");
vw_set_rx_pin(RF_RX_PIN); // Setup receive pin.
vw_setup(2000); // Transmission speed in bits per second.
vw_rx_start(); // Start the PLL receiver.
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if(vw_get_message(buf, &buflen)) // non-blocking I/O
{
int i;
// Message with a good checksum received, dump HEX
Serial.print("Got: ");
for(i = 0; i < buflen; ++i)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
//Serial.print(buf[i]);
}
Serial.println("");
}
}
RESULT: i just get the Serial.println
-ed "setup" and then nothing else happens.
i even tried the RC-switch library;
SEND:
/*
Example for different sending methods
http://code.google.com/p/rc-switch/
Need help? http://forum.ardumote.com
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
// Transmitter is connected to Arduino Pin #10
mySwitch.enableTransmit(10);
// Optional set pulse length.
// mySwitch.setPulseLength(320);
// Optional set protocol (default is 1, will work for most outlets)
// mySwitch.setProtocol(2);
// Optional set number of transmission repetitions.
// mySwitch.setRepeatTransmit(15);
}
void loop() {
/* See Example: TypeA_WithDIPSwitches */
mySwitch.switchOn("11111", "00010");
delay(1000);
mySwitch.switchOn("11111", "00010");
delay(1000);
/*
// Same switch as above, but using decimal code
mySwitch.send(5393, 24);
delay(1000);
mySwitch.send(5396, 24);
delay(1000);
// Same switch as above, but using binary code
mySwitch.send("000000000001010100010001");
delay(1000);
mySwitch.send("000000000001010100010100");
delay(1000);
// Same switch as above, but tri-state code
mySwitch.sendTriState("00000FFF0F0F");
delay(1000);
mySwitch.sendTriState("00000FFF0FF0");
delay(1000);
*/
// delay(20000);
delay(2000);
}
and
RECV
/*
Simple example for receiving
http://code.google.com/p/rc-switch/
Need help? http://forum.ardumote.com
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2
}
void loop() {
if (mySwitch.available()) {
int value = mySwitch.getReceivedValue();
if (value == 0) {
Serial.print("Unknown encoding");
} else {
Serial.print("Received ");
Serial.print( mySwitch.getReceivedValue() );
Serial.print(" / ");
Serial.print( mySwitch.getReceivedBitlength() );
Serial.print("bit ");
Serial.print("Protocol: ");
Serial.println( mySwitch.getReceivedProtocol() );
}
mySwitch.resetAvailable();
}
}
again - NOTHING...
EVEN using the plain TX/RX pins but probably not going to tell me anything since this RF pair uses "ASK modulation" (??)
PLAIN Serial.print
using TX
/*
* Simple Transmitter Code
* This code simply counts up to 255
* over and over
* (TX out of Arduino is Digital Pin 1)
*/
byte counter;
void setup(){
//2400 baud for the 434 model
Serial.begin(2400);
counter = 0;
}
void loop(){
//send out to transmitter
Serial.print(counter);
counter++;
delay(10);
}
and
using RX
/*
* Simple Receiver Code
* (TX out of Arduino is Digital Pin 1)
* (RX into Arduino is Digital Pin 0)
*/
int incomingByte = 0;
void setup(){
//2400 baud for the 434 model
Serial.begin(2400);
}
void loop(){
// read in values, debug to computer
if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.println(incomingByte, DEC);
}
incomingByte = 0;
}
even debug-ged that last code to;
/*
* Simple Receiver Code
* (TX out of Arduino is Digital Pin 1)
* (RX into Arduino is Digital Pin 0) ***DISconnectWHILEuploading
*/
int incomingByte = 0;
void setup(){
//2400 baud for the 434 model
Serial.begin(9600);
}
void loop(){
// read in values, debug to computer
if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.println(incomingByte);
Serial.println("got SOMEthing");
}
incomingByte = 0;
Serial.println("got NOTHING");
}
but this is probably registering just random noise because it gives pretty much the same result with the transmitter OFF.
would manual tuning be in order ?
what could i do just to see what parts actually are working ?