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?
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.
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.
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.
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.
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:
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
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. 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.
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.
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...