element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Xbee configuration
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 11 replies
  • Answers 3 answers
  • Subscribers 403 subscribers
  • Views 1105 views
  • Users 0 members are here
Related

Xbee configuration

Former Member
Former Member over 13 years ago

Hello,

 

I'm new to Arduino World. My project is using an Arduino as datalogger for gaz, water and electricity consumption.

In most cases the different counters are not located in the same room. So I have to transmit data from several Arduino's to a an Arduino Master which transmits data over internet.

 

I try to configure the 2 Xbees S2 like explained in the Jeremy’s tutorial : http://www.jeremyblum.com/2011/02/27/arduino-tutorial-9-wireless-communication/

I follow exactly the procedure : 2 jumpers placed correctly, Atmega chip removed. The arduino board is well recognized on COM6 – I use Putty.

 

I enter +++ to communicate with Xbee. I receive OK. Up to there non problem.

AT OK

ATMY : receive FFFE

ATMY1000 : receive ERROR

ATDL1001 : OK

ATID1111, : OK

 

I have understood that the procedure could be different on XBEE S2 models. But I do not understand what parameters I must enter on each device. Xbee 1 must send data to Xbee 2

 

With Xbee 1 :

ATSH returns 13A200

ATSL returns 40612FEC

 

With Xbee 2 :

ATSH returns 13A200

ATSL returns 4061318A

 

Do you have a suggestion ?

Thanks for your help

  • Sign in to reply
  • Cancel
Parents
  • cookieglitch
    0 cookieglitch over 13 years ago

    This method may work on most XBees, not sure about S2 models however.

     

    The commands follow this order

    Enter Configuration Mode

    Set PAN ID

    Set Local address

    Set Destination Address

    Write to non-volatile memory

    Exit Configuration Mode

     

    Assuming you have a PAN ID of 1111, and two modules called 0x01 and 0x02, you would have a configuartion like this,

     

    Xbee1:

    +++

    ATID1111

    ATMY01

    ATDL02

    ATWR

    ATCN

     

    XBee2

    +++

    ATID1111

    ATMY02

    ATDL01

    ATWR

    ATCN

     

    This setup is known as unicast mode as it is a one to one connection and not a mesh network as you may be aiming for. Have a read of the manuals for the XBee modules you are using, it should include a description of the different modes and the different things you need to set to use them. If you are still curious, have a look for Building Wireless Sensor Networks: with Zigbee, XBee, Arduino and Processing by Robert Faludi (O'Reilly, ISBN-10: 0596807732).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to cookieglitch

    Hello John,

     

    Thanks for your reply.

     

    I'm using Xbee S2.

    If I send the command ATID1111, OK

    but if I send the command ATMY01 or ATMY02 I receive ERROR.

    It seems there is another way to proceed with this type of Xbee.

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • cookieglitch
    0 cookieglitch over 13 years ago in reply to Former Member

    Quick look through the manual and I think I've worked it out.

    Earlier you got the SL and SH values from both devices, these make up the addresses for the network. XBees have two adressing modes, 64bit and 16bit. In some versions of the modules, MY sets the 16bit address. In the version you are using, you need to use the 64bit address. With this in mind, you need to adjust the configuration method so it is:

     

    XBee 1

    +++

    ATDH13A200

    ATDL4061318A

    ATWR

    ATCN

     

    XBee2

    +++

    ATDH13A200

    ATDL40612FEC

    ATWR

    ATCN

     

    Have a flick through the manual for it, chapter 10 is the reference for all the commands and explains the kinds of values you can give to each.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to cookieglitch

    Hello John

     

    It works fine. Exactly as you described.

     

    I will now try to transmit data from Xbee1 to Xbee2

     

    Thanks a lot for your time.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dirtdiver
    0 dirtdiver over 13 years ago in reply to cookieglitch

    While we are at it I was always wondering if its possible to make a  two way connection - both xbees sending and receiving

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • cookieglitch
    0 cookieglitch over 13 years ago in reply to dirtdiver

    All XBee modules are capable of two way communication (A to B and B to A). With newer modules, mesh networking is possible, this means you can set up the XBees in a specific way to act as any other network. For example, one XBee can be the base station, a group of modules can be routers and the rest are the end points (In a simplified way). This lets you have a huge number of XBees in a network, covering a much greater area and able to communicate with each other as normal. The manual I linked to before explains it in chapter 3.

    Basically as long as the devices are connected to the same network and there is a path between the two (Basically like a computer network) they can communicate. The main requirement is for the destination addresses to be correct like they are in the examples above. Things like the destinations can be changed from the software itself using the API rather than through a XBee Explorer/PuTTY etc

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • dirtdiver
    0 dirtdiver over 13 years ago in reply to cookieglitch

    ok but i will need to set it up differently, not like in Jeremys tut. couse that is a one way com-one sender and one receiver only?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • cookieglitch
    0 cookieglitch over 13 years ago in reply to dirtdiver

    No you shouldn't. XBees are transceivers so they are capable of sending and receiving. As long as you have the Rx and Tx pins connected properly you can send and receive.

    In terms of programming the arduino you would have something like this (Assuming you are using an LCD as an output)

     

    Arduino 1/XBee 1

     

    int count = 0;
    
    setup()
    {
         ...
    }
    
    loop()
    {
         Serial.write(count);
         //optional delay
         if(Serial.available() > 0)
         {
              count = Serial.read();
         }
         lcd.write(count);
    }

     

    Arduino 2/XBee 2

    int count = 0;
    
    setup()
    {
         ...
    }
    
    loop()
    {
         if(Serial.available() > 0)
         {
              count = Serial.read();
              count++;
              Serial.write(count);
         }
    }

     

    These two programs (Most likely with the odd mistake) basically use Arduino 1 to control the display and Arduino 2 to increment a value. By using the Serial read and write functions you can achieve two way communication. A more real world example would be to implement a remote control for a sensor. Arduino 1 issues the different commands, Arduino 2 takes these commands, performs an action and returns the result.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • cookieglitch
    0 cookieglitch over 13 years ago in reply to dirtdiver

    No you shouldn't. XBees are transceivers so they are capable of sending and receiving. As long as you have the Rx and Tx pins connected properly you can send and receive.

    In terms of programming the arduino you would have something like this (Assuming you are using an LCD as an output)

     

    Arduino 1/XBee 1

     

    int count = 0;
    
    setup()
    {
         ...
    }
    
    loop()
    {
         Serial.write(count);
         //optional delay
         if(Serial.available() > 0)
         {
              count = Serial.read();
         }
         lcd.write(count);
    }

     

    Arduino 2/XBee 2

    int count = 0;
    
    setup()
    {
         ...
    }
    
    loop()
    {
         if(Serial.available() > 0)
         {
              count = Serial.read();
              count++;
              Serial.write(count);
         }
    }

     

    These two programs (Most likely with the odd mistake) basically use Arduino 1 to control the display and Arduino 2 to increment a value. By using the Serial read and write functions you can achieve two way communication. A more real world example would be to implement a remote control for a sensor. Arduino 1 issues the different commands, Arduino 2 takes these commands, performs an action and returns the result.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube