RF links from Sparkfun...

Hi there,
I've been trying to use these rf links:

Unfortunately, I haven't been able to get anything out of them. Not even a blip of data. I've been trying a simple loopback test with a single Arduino, but I only get feedback if I run a physical jumper from rx to tx.

Take a look at my code and let me know what you think. Perhaps I have a defective transmitter or receiver?

Screenshot of running code:

Picture of my setup:

Thanks!
Eric

Is NewSoftSerial full duplex? I don't think so.

This would mean you can't send and receive at the same time, which is exactly what you are trying to do.

-j

But it works just fine when a jumper is connected between pin0 and pin3...

You can see "TestTest" in the terminal screenshot. That's from me physically connecting the rx/tx pins.

NewSoftSerial aside, I also used SoftwareSerial.h, and I get the same result. But, I'm not sure if that's full duplex either.

But it works just fine when a jumper is connected between pin0 and pin3..

Right, because the hardware UART is full duplex, and asynchronous to boot (that's the A in UART), so it can receive just fine while you are busy transmitting with NSS.

I suspect all software serial implementations will have the same problem.

-j

Yeah I'm going to have to agree with KG4 on this one, you could always try a send-receive setup though.. only sends when it receives, and vice versa.

Have you looked into the VirtualWire library? Very nice library with a HUGE write-up on the library.

Here's the PDF, then second file is the zip, take a look at the PDF and see if it's something you'd like using.

http://www.open.com.au/mikem/arduino/VirtualWire-1.3.zip

Thanks to MikeM for this library! A fellow Arduino user :smiley:

So, a loopback test is basically impossible in this situation (I'll need another Arduino)??

The reason I've been trying the loopback test, is because I haven't been able to get them to work with my Roomba. I just wanted to make sure the components are at least functioning correctly before I keep bashing my head.

Also, I've been avoiding the VirtualWire library since, in the long run, I won't be able to modify the receiving end.

Arrgg...
Eric

BTW
You do have it hooked up wrong, if you're using that code.

The Transmitter (smaller of the two), should be connected to pin 3

Your Receiver (obviously, bigger), should be connected to pin 2.

Was just looking at your picture. Try that. Because right now, with your code you're trying to open 2 physical serial connections... one with the computer, and one with the receiver.

Try the new-pins I provided and let us know.

Using the same code, I just tried it, and I get nothing.

Yes, I was trying to open two serial connections - pin0 & pin1 with standard serial, pin2 & pin3 with NSS.

NSS used to transmit, and standard serial used to receive.

I see, interesting.. I kind of figured that would've done it, but shows what I know!

I'll experiment some with my pair in a few minutes here, and see if I can shed any light. I've only used two arduinos as far as the RF set goes, been able to send and receive without too many problems.

That would be awesome!!!!!!! I'll wait in angst....

FYI, if you try it with code like mine, but you don't have NewSoftSerial, SoftwareSerial works the same. Just don't forget that with SoftwareSerial you have to set the pinModes.

Here's the code so you can just copy and paste if you'd like:

#include <NewSoftSerial.h>

int rxPin = 2;
int txPin = 3;
NewSoftSerial rfSerial(rxPin,txPin);

void setup(){
  Serial.begin(2400);
  rfSerial.begin(2400);
  Serial.println("Loopback test ready.");
}

void loop(){
  rfSerial.print("Test");
  while(Serial.available()){
    char temp = Serial.read();
    Serial.print(temp);
  }
  delay(500);
}

Yeah I did a search and found the newsoftserial.. but, one question

When receiving, and serial monitor on (receiver hooked up to 2), did you receive anything at all?
Because as of right now, with your code and setup (minus receiver on rX pin), I'm reading a bunch of... random crap, don't receive anything printable.

Do keep in mind, my experience with these modules is limited, let alone the code.. so I'm sure there's something I'm missing. But it IS receiving something, just not what we need! I know there's a way to filter out the surrounding RF and reading only what you want, but not nearly that experienced just yet! Still trying to find a library I'm comfortable with myself, do like the looks of this newsoftserial, in hopes that we can get it running right!

Best of luck, keep us updated! I'm still messing around with the setup, so I'll let you know if I get anything new :smiley:

No, I get absolutely NOTHING from the receiver. I only got results (the correct results) when I place a physical jumper from pin0 to pin3.

Well I tried both with temp = Serial.read(); with your setup, then changed the code for mysetup, temp = rfSerial.read();

With Serial.read() setup, I receive 1 single Test, then all garbage from there.

With rfSerial.read() setup, I receive... just garbage... but noticeably different garbage.

I'm a bit confused on this one. :confused: I tried reading up on the code from some other libraries to see if I can use the noise-filteration.. haha yeah, a bit over my head. A single test.. then all garbage after that, I'm not really sure.

Also, don't overlook the possibility that putting the transmitter and receiver that close together is overloading the receiver, and garbling the signal.

Ran

Well, NewSoftSerial is definitely not full duplex. You cannot transmit and receive at the same time - I just tried it. So, I don't think using pin2 will work.

Did you try my exact code and configuration (pin0 and pin3)? If so, what were your results?

Yes, I tried your setup and exact code.. and what I get is
very first information received is the Test that it should be receiving, the rest is.. well unfiltered RF crap, and I don't get a Test again. (I let it run for about 10 seconds, then read through the crap, didn't see the Test again. :confused:

So it received for me.. once. lol

Also, I'm using the Seeedstudio pair, I heard they're interchangeable as far as code goes.. but I heard with the Sparkfun pair, you need to ground the other Data pin that isn't being used on the receiver. I've also heard of somebody just using a jumper between the two datas.

Yeah, I also read about connecting the two data pins. The walkthrough tutorials also show all the power and ground pins being connected to a source.

The strange part is that all of these pins (power, ground, data) are already bridged together (seperately, of course) on the pcb. I can only presume that the extra pins are there simply for ease of connectivity and greater physical support. So grounding the one data pin will essentially ground both.

Also, did you try placing a jumper between pin0 and pin3?? I'm curious if we get the same results.

It seems like yours might be working, but it's just falling out of sync after the first transmission.

Yup, I get the TestTestTest I should be getting when I hooked up the jumper.

I had a few problems my first few times hooking up the pair, but after that (was 100% user error), no problems yet. So I'm confused on what's going on over on your side.
I understand most of the garbage I'm receiving is due to no-filtering in the code.. but to NOT get ANYthing is...

Sounding like a receiver error.
I'm guessing you only got a single pair? Was going to say try a second pair if you have. I've got two of the same exact pairs, both 434mhz.. with same results.

Murphy's Law... I only have one set of the 315MHz/4800bps.

Now, if only I can get Sparkfun to believe me when I say I have a defective unit, but I'm not sure which one! Perhaps I can tell them CaptainObvious said so...