Author Topic: wifly module (RN-XV) to connect to AXON II  (Read 2481 times)

0 Members and 1 Guest are viewing this topic.

Offline ArmanTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
wifly module (RN-XV) to connect to AXON II
« on: February 19, 2012, 11:41:05 AM »
Hello,
I am working on two wheeled robot with IR and smelling sensors.
I am using differential steering method to move the wheels.
Now, I need to connect wifly(RN-XV www.rovingnetworks.com) with my AXON II and get tracking data from robot movement.
As, I am new on this so I need some examples or tutorial for this.

Please help me on this matter.
Thanks in advanced
Arman
« Last Edit: February 19, 2012, 12:37:12 PM by Arman »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: wifly module (RN-XV) to connect to AXON II
« Reply #1 on: February 21, 2012, 11:00:00 PM »
The first thing you should do is read through the datasheets. All of it.
http://rovingnetworks.com/resources/show/product:1

As a beginner it'll all sound overwhelming and mumbo-jumbo-ish, but it'll start to make sense over time.

First, you'll see it says:
Quote
Accepts 3.3VDC regulated power supply
38mA active
Which means you can power it using the 3.3V Axon output pin. And ground to ground, of course. The Axon 3.3V output can handle up to ~73mA - but no more!!!

Then look at the pinout in the datasheet and find Tx and Rx. Connect that to your Axon Rx and Tx.

Tx goes to Rx, and Rx goes to Tx.

In WebbotLib Project Designer, set up a project that uses the UART you want to connect to the wifly module.

Then re-read through the user manual again to learn the commands you must send by UART:
http://rovingnetworks.com/resources/download/93/WiFly_User_Manual

Also, you can use Hyperterminal to test out your wifly commands without the Axon.

When you get stuck again, let us know :)

Offline ArmanTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: wifly module (RN-XV) to connect to AXON II
« Reply #2 on: February 24, 2012, 05:31:53 PM »
Dear Admin,
Thank you for your helpful response.
I have connected the module( hardware part) with my AXON.But, I checked the commands and I created the Adhoc network using TeraTerm (PC).I can connect my pc to that network.

Now in the programming part:
Can I have sample programs in AXON II for the data acquisition using wifly?

Thanks
Arman


Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: wifly module (RN-XV) to connect to AXON II
« Reply #3 on: February 24, 2012, 08:37:01 PM »
Can I have sample programs in AXON II for the data acquisition using wifly?
If it works fine with TeraTerm and you know all the commands, then you are already 90% done.

Set up a project using WebbotLib Project Designer, and add in a UART. Have it generate the code for you.

To issue a command, just use rprintf("command ") with that new UART.

Receiving a command is a little bit harder. Look at my ERP source code for an example on how to receive a command and then act upon it. For my ERP it was using Bluetooth, but this is no different really from using the wifly.

Offline ArmanTopic starter

  • Beginner
  • *
  • Posts: 3
  • Helpful? 0
Re: wifly module (RN-XV) to connect to AXON II
« Reply #4 on: March 08, 2012, 10:17:10 AM »
Dear Admin,
To send data via wifly is difficult. But, I can send data. The problem is to detect the specific data using string comparison.In webbotlib there are not so much stuff as I can see.I can use "strncmp" C function but sometimes it doesn't give the accurate response.

As I am not so much expert, in that case how to deal with the data and manipulate them is problem.what are the good ways to deal with this ,I need the guideline.

The ERP code could be helpful if I cloud understand them all.


Thanks
Arman

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: wifly module (RN-XV) to connect to AXON II
« Reply #5 on: March 08, 2012, 07:29:53 PM »
Look in manual_control.h of my ERP code, and you'll see something like this:

Code: [Select]
cByte=uartGetByte(wireless_UART);

if(cByte!=-1)//has new data
{
//DANCE MOVES
if (cByte == '1')//fold arms
{
arm_fold();
}
if (cByte == '2')//reach for the sky
{
arm_reach_sky();
}
if (cByte == '3')//do a zig-zag worm motion with arms
{
arm_worm_one();
arm_worm_two();
}
}

This is basically the same thing you need to do. I'm not sending entire strings, just individual letters/numbers.