Need Wireless Help
Christian
Posts: 10
I need some wireless help. I have been working on this for a month and I'm stumped. Please help! What am I doing wrong? Here is the setup and code.
BASIC Stamp side:
I have a BS2 BOE Kit with a 433MHz RF transmiter (data on PIN 8) and a 433MHZ RF receiver (data on pin 7). The BS2 is connected to the PC using the serial port COM1 for debugging. Here is my BS2 Code:
'{$STAMP BS2}
'{$PBASIC 2.5}
'{$PORT COM1}
x VAR Byte(8)
Main:
DO
· PULSOUT 7, 1200
· SERIN 7/8, 396, [noparse][[/noparse]WAIT("!"), STR x\8]
· DEBUG STR x
· SEROUT 8/7, 396, [noparse][[/noparse]"Received",x]
LOOP
PC Side:
I then have a USB2SER with TX connected to another 433MHz RF transmiter, RX connected to a 433MHz RF reciever, and VSS connected to GND on both transmitter and receiver. RES is not connected. I am powering the 5V on all transmitters from the BS2 VDD pin with GND connected to the BS2 VSS pin.
I am using the USB2SER to connect a PC to the wireless transmitters and send information. Here is the PC code in C#, where I am using COM6 for the USB2SER:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace USB2SER_Comm
{
public partial class Form1 : Form
{
string port = "";
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
port=comboBox1.Text;
if (!serialPort1.IsOpen)
{
serialPort1.PortName = port;
serialPort1.BaudRate = 2400;
serialPort1.DataBits = 8;
serialPort1.Parity = 0;
serialPort1.Open();
}
}
private void Form1_Load(object sender, EventArgs e)
{
string[noparse]/noparse pts = System.IO.Ports.SerialPort.GetPortNames();
foreach (string pt in pts)
{
comboBox1.Items.Add(pt.ToString());
}
}
private void button4_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Write(textBox1.Text);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
textBox2.Text = serialPort1.ReadExisting().ToString();
}
}
}
}
·
BASIC Stamp side:
I have a BS2 BOE Kit with a 433MHz RF transmiter (data on PIN 8) and a 433MHZ RF receiver (data on pin 7). The BS2 is connected to the PC using the serial port COM1 for debugging. Here is my BS2 Code:
'{$STAMP BS2}
'{$PBASIC 2.5}
'{$PORT COM1}
x VAR Byte(8)
Main:
DO
· PULSOUT 7, 1200
· SERIN 7/8, 396, [noparse][[/noparse]WAIT("!"), STR x\8]
· DEBUG STR x
· SEROUT 8/7, 396, [noparse][[/noparse]"Received",x]
LOOP
PC Side:
I then have a USB2SER with TX connected to another 433MHz RF transmiter, RX connected to a 433MHz RF reciever, and VSS connected to GND on both transmitter and receiver. RES is not connected. I am powering the 5V on all transmitters from the BS2 VDD pin with GND connected to the BS2 VSS pin.
I am using the USB2SER to connect a PC to the wireless transmitters and send information. Here is the PC code in C#, where I am using COM6 for the USB2SER:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace USB2SER_Comm
{
public partial class Form1 : Form
{
string port = "";
public Form1()
{
InitializeComponent();
}
private void button3_Click(object sender, EventArgs e)
{
port=comboBox1.Text;
if (!serialPort1.IsOpen)
{
serialPort1.PortName = port;
serialPort1.BaudRate = 2400;
serialPort1.DataBits = 8;
serialPort1.Parity = 0;
serialPort1.Open();
}
}
private void Form1_Load(object sender, EventArgs e)
{
string[noparse]/noparse pts = System.IO.Ports.SerialPort.GetPortNames();
foreach (string pt in pts)
{
comboBox1.Items.Add(pt.ToString());
}
}
private void button4_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Write(textBox1.Text);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
textBox2.Text = serialPort1.ReadExisting().ToString();
}
}
}
}
·
Comments
Also, what is the purpose of the PULSOUT the transmitter?
With these devices, you generally want to use inverted data also. Idling high (non-inverted) will cause one to be transmitting continually interfering with other transmitters. I believe the value you are using is non-inverted.
Well, there's a few things that come to mind..
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
One thing I also need clarified is does the transmitter/receiver output in the same format as the USB2SER or do they have to be setup somehow? In other words, I am only setting COM1 and COM6 input/output methods and assuming that these settings are flowed down to the 433MHz units automatically. Is that assumption correct?
Also, is the USB2SER suppoed to be connected in the manner I have shown?
So, if you have 2 transmitters both pumping out 433Mhz, neither will get the data across. This is why it is important to use inverted, so the transmitter is silent when idle. An additional problem may be with the USB2SER since it cannot be inverted directly, it may be transmitting all the time. The physical connects seem correct, though again, it may be transmitting continually interfering with data from your other transmitter.
I would simplify testing by using only 1 transmitter, 1 receiver and try to get data flowing both directions. If you are worried your program may be causing additional problems, simply use hyperterminal to send/receive simple data.
Once you have data going both ways, try both at once.
If you want to check out more advanced units that can be used to send and receive data transparently at once (or appears to be at once to the user), and directly to a PC, you can check out the docs on my website: http://www.selmaware.com/appbee
Not to push those over Parallax's 433Mhz units, but they make life much simplier for multiple/duplex RF comms.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
http://www.dpactech.com/wireless_products/embedded-802.11-wireless-module.asp
http://www.aerocomm.com/rf_transceiver_modules/ac4790_mesh-ready_transceiver.htm·· i really looking at this 1 could somebody tell me if it,ll work ???
http://www.vinculum.com/prd_vnc1l.html·this 1,s got a lot going for it·too like being able to carry a web cam and other usb devices,,, range???
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Problems are the "roads" of life,
solutions are only "onramps" to the next problem
············································· "Brad Smith"
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Problems are the "roads" of life,
solutions are only "onramps" to the next problem
············································· "Brad Smith"
Post Edited (Warrlok) : 2/8/2007 3:51:46 PM GMT