Pages: [1]   Go Down
Author Topic: Virtual Wire - Noobie problem  (Read 1910 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

First time putting a message up so I hope this is all in the right place.  Yes I'm a complete noobie.

Ok, so I picked up a cheap 433.92MHz transmitter and receiver pair
Rx = ZABR1-01
http://www.alibaba.com/product-gs/283516522/Super_regenerative_RF_Wireless_Receiver_Module.html

Tx = NT-T02B
http://www.alibaba.com/product-gs/298268955/NT_T02B_RF_transmitter.html

The way I have set them up is similar to the attached image (I wasn't sure how to put it in the message).  In reality I am using two boards with the Tx on a battery and the Rx connected to my computer.  Also I tried the Rx data wire in 11 as per the Virtual Wire pdf.

I have tried the Virtual Wire approach and scanned the forums here for examples and similar problems.

This is the Transmitter code I tried:
Code:
#include <VirtualWire.h>
#undef round

void setup()
{
    vw_setup(2000); // Bits per sec
}
void loop()
{
    const char *msg = "Hello my friends, this is earth calling.  We hope you are all well :)";
    vw_send((uint8_t *)msg, strlen(msg));
    delay(400);
}

And this is the Receiver code:
Code:
#include <VirtualWire.h>
#undef round

void setup()
{
    Serial.begin(9600);
    Serial.println("setup");
    vw_setup(2000); // Bits per sec
    vw_rx_start();    // Start the receiver PLL running
}
void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
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.println("");
   }
}

I get the 'setup' line appear in the serial monitor but that is all that seems to be happening.

Is my wiring up wrong?
Is the code I am using wrong?
Are the components simply not working?
Is it a mixture of the above?
Or something else altogether?

Help and pointers appreciated.


* TX-RX_bb.jpg (60.54 KB, 875x689 - viewed 59 times.)
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Check the VirtualWire documentation.

"Messages of up to VW_MAX_PAYLOAD (27) bytes can be sent"

4.12 vw_send
extern uint8_t vw_send(uint8_t* buf, uint8_t len);
Send a message with the given length. Returns almost immediately, and the message
will be sent at the right timing by interrupts. Returns true if the message was accepted
for transmission. Returns false if the message is too long (>VW_MAX_PAYLOAD).

VW is refusing to send the too-long message.
Logged


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

Oh my!!!

Thank you so very much maniacbug.

I somehow missed a big chunk of section 6 in the documentation when I was looking through it.

Thank you again.

Now to look at ways of enabling longer messages with the constraint in place smiley
Logged

UK
Offline Offline
Sr. Member
****
Karma: 4
Posts: 320
Arduino - very interesting !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

did you manage to get this to work ?

i have a zabr1-01 wired as in the image and using this code to read the rx

Code:


#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round
void setup()
{
    Serial.begin(9600); // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000); // Bits per sec

    vw_rx_start();       // Start the receiver PLL running
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
int i;

        digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");

for (i = 0; i < buflen; i++)
{
    Serial.print(buf[i], HEX);
    Serial.print(" ");
}
Serial.println("");
        digitalWrite(13, false);
    }
}


i want to use it to read the output of some oregon scientific weather transmitters that are 433 mhz

can't seem to get it to work
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25809
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you need PTT code in a receiver?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

UK
Offline Offline
Sr. Member
****
Karma: 4
Posts: 320
Arduino - very interesting !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this is where i got the idea from

http://www.practicalarduino.com/projects/weather-station-receiver
Logged

UK
Offline Offline
Sr. Member
****
Karma: 4
Posts: 320
Arduino - very interesting !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you need PTT code in a receiver?

i have no idea - it is the sample code you get when you download virtualwire - i will rem it out and see what happens

ty
Logged

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

@gadget99 - Thats a pretty cool project! I'm working on a temp/light/humidty sensor using 433 links. Great little things!
One thing that comes to mind is that the weather station may only be transmitting small packets every 1/2 hour or so? Possibly try leaving your arduino hooked up for a few hours?
Are you using the default v_w pins?
Not sure why you have those #undef statements, I've never used them and everything seems fine.
Possibly a loop to try all baud rates the units support?

This sounds like a great project - gots to find me a weather station now!  :-)

« Last Edit: July 24, 2011, 08:12:16 pm by inboxjason » Logged

UK
Offline Offline
Sr. Member
****
Karma: 4
Posts: 320
Arduino - very interesting !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the weatherstation transmitter flashes an led when it transmits so i can see when a packet of data is being sent

the oregon rx displays the data correctly so i know the tranmission is happening

i am using pin 11 to collect the data as in the drawing above

i think later today i will set up another arduino to do a tx and then see if i can find the problem

Arduino is soooooo much fun - i should have got into this years ago !

best of luck with your own project
Logged

UK
Offline Offline
Sr. Member
****
Karma: 4
Posts: 320
Arduino - very interesting !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i go the TX module wired up and with 2 arduino's have had the system sending and recieving messages

however have been unable to get it to read the messages that the weatherstaions transmit - i guess they must be in some other form of data transmission format

i will do a some research and see if i can find out how the data is formatted
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all, i'm a real noob in using arduino and electronics but i want to try hard to build my personal oregon scientific receiver with an arduino to log and plot my weather data on pc. Since now i have an arduino UNO and a ASK recevier shield @ 433 MHz (from freetronics). Now i would like to get data from my temperature sensor but... i can't found any nice tutorial to start with, maybe a sketch. I really don't know how to start.

Any advice?

Thank you in advance,
Andrea
Logged

Pages: [1]   Go Up
Jump to: