Lack of Knowledge for Wireless transmission

Hi forum, this is my 1st project related to using arduino + xbee to transmit commands to a robot.

One xbee is connected to the robot while another is connected to the arduino board.

I have read and done all the tutorials posted in the main arduino website but the problem is, those tutorials are related to serial connections.
The project im doing is wireless.
I can't seem to get it working and im wondering if im missing out critical C information.

Just for information:
Both xbee are of the same channel.
Baud rate is 115200

What i do not know:
The sequence/method of writing the program for wireless transmission.

Im a beginner here and i hope that i have been clear enough :slight_smile:
Please guide me forums :slight_smile:

The project im doing is wireless.

That would explain the XBees.

I can't seem to get it working and im wondering if im missing out critical C information.

Maybe. Maybe not.

Im a beginner here and i hope that i have been clear enough

Not nearly.

One xbee is connected to the robot

How? With duct tape? Staples? Hot-melt glue? Or, some practical means?

I have read and done all the tutorials posted in the main arduino website but the problem is, those tutorials are related to serial connections.
The project im doing is wireless.

You seem to be confused over how XBees work with the Arduino.

The XBee transmits over-the-air data that is written to the serial port, and writes data that it receives over-the-air to the serial port.

So, to send data from one XBee to the other, use Serial.print(), Serial.println(), or Serial.write().

To see if the XBee has received any data, use Serial.available(). To read any data that it received, use Serial.read().

Hi PaulS , thanks for the reply :slight_smile:

The Xbee have been 'properly' connected to the robot :slight_smile:
Its been done together with our lecturer.

The only thing left to be done is the software. I have read regarding the operation of Xbee. I was wondering if i had to include libraries in order for wireless transmission to be successful such as #include <XBee.h> , etc.

Ill keep on reading more as this is basically my 1st time handling wireless transmission.
Thanks for your input still :slight_smile:

The Xbee have been 'properly' connected to the robot
Its been done together with our lecturer.

How? Is there an Arduino or other microprocessor controlling the robot?

I was wondering if i had to include libraries in order for wireless transmission to be successful

No libraries are needed.

to transmit in chars

From what i understand, i have to set the baud rate to suit the receiver which is 115200
According to my lecturer i have to transmit the ID first followed by the command in char.

Transmit the ID first which is 243 or 0xF3
Transmit the commands which is 140

Current objective is to just transmit a signal and see if the robot receives it.
LED connected to robot will light up if signal is received.

So basically, from what i have learnt, this is what i would write at the transmitter.
PS. Im a total beginner at arduino.

void setup()
{
Serial.begin(115200);
}

void loop()
{
Serial.write(243);
Serial.write(140);
}

EDIT : Im transmitting to another platform which is MPLAB , i.e. from Arduino to MPLAB

On the sender, loop is called over and over again. That is going to flood the receiver with data.

EDIT : Im transmitting to another platform which is MPLAB , i.e. from Arduino to MPLAB

The robot has an MPLAB, whatever that is, on it? What is an MPLAB?

EDIT : Sorry about the MPLAB , ignore that :slight_smile:
Its a software/platform like arduino/microsoft visual studio.

I have figured out the sequence of transmission, that is i have to transmit a series of bytes in hexadecimal.
Therefore the command packets would look like

MSG_ID|COMMAND|Lower header byte|Higher header byte|ROBOT ID|Corresponding data|etc.

Part of my code currently looks like this:

  • i have declared the variables
  • i am supposed to transmit using Serial.write()

e.g.
unsigned char MSG_ID = 0xF3
Serial.write(MSG_ID)

Problem is, i get no response from the robot. So the question is, if i transmit as MSG_ID , will it be transmitted as 0xF3 ?
Or do i have to transmit in terms of "CHAR" on the ASCII table
Im bad at rephrasing my sentence.

EDIT : My program tends to hang when i open Serial Monitor.

unsigned char MSG_ID = 0xF3;
Serial.write(MSG_ID);

Will send 0xF3 to the serial port.

Problem is, i get no response from the robot.

Do you know that the XBees are talking to each other? What, exactly, is on the robot that the XBee on the Arduino is talking to?

I sounds like you have too many unknowns in the picture right now. It isn't clear that the XBee on the Arduino is really sending data. It isn't clear that the XBee on the robot is receiving anything. It isn't clear that the robot is getting data from the XBee. It isn't clear that the robot is designed to provide a response. It isn't clear that the response, if any, is getting to the robot's XBee. That response may not be being sent back to the Arduino's XBee. That response may not be being read by the Arduino.

Post all of your Arduino code, and as much detail as you can about the XBees (type, how they are configured, etc.) and as much detail as you can about the robot, and whatever you can tell about the lights on the XBees blinking when they send and receive data.

Hi PaulS, thanks for the continous help.
I have "given up" and showed my lecturer of the current progress and problems, explaining everything. He mentioned that the reason the robot wasnt responding was due to lost of packets during transmission. The way i was transmitting was correct.
He explained a way of solving this was to use a "Manchester Encoding"

Currently the C platform on the robot has the "Manchester Encoding".
But not on the Arduino.
So anyone here knows any basics of Manchester Encoding ? :slight_smile:
Good tutorials on such.. ? :slight_smile:

Anyway thanks alot PaulS for your continous help even though i wasnt clear enough on my questions :slight_smile:
Appreciate it alot