Module: xBee-API1 V1.0A

Posted on
  • Hi All,

    I just finished my first Espruino module. With this module, you are able to communicate with xBee radios. Use xBee AT firmeware. Connect V3.3, GND and Serial RX/TX to the xBee board.

    Sacha

  • Module for communicate with xBee radios

    • KEYWORDS: Module,xBee,API Firmeware, API Mode 1

    Summary

    Serial1.setup(38400,{rx:B7,tx:B6,bytesiz­e:8,parity:none,stopbits:1});
    myxbee=requere('XBee-API1'.connect(Seria­l1);
    
    functions:
    
      XBee-API1.AT(command,value,function(re,d­ata) {} )
      XBee-API1.strtobytes(String)
      XBee-API1.TX(addr64,addr16,options,data,­function(re,data) {} )
      XBee-API1.RX(function(data) {} )
    

    xBee Frame Types implemented

    • 08 => AT Command
    • 88 => AT Command respond
    • 10 => Transmit request
    • 8B => Transmit Status
    • 90 => RX Packet
  • The module code: Comitted on git-hub

  • Hmm. Have some formatting problems.

    Gordon:
    My second answer (Readme) should be formated as text only.
    The modulecode should be completly fromated as code.

    Is there another way to submit a module ? EMail ?
    Sacha

  • Favored way to submit module is via github pull request. http://www.espruino.com/Writing+Modules

    At least, I assume it is - that's how I submit modules I write.

  • Oh, did'nt know that. Thanks. Will try it.

    Sacha

  • Module is committed.

  • Great - thanks! I'll try and update the website with it today/tomorrow

  • Hi Sacha, Gordon,
    I can't find your pull request on Git or any link to your module, could you put a link on here somewhere? Thanks!
    ~Alex

  • Hi, there is a little typo on the espruino page.

    "myxbee=requere('XBee-API1'.connect(Seri­al1);"

    should be:
    myxbee=require('XBee-API1'.connect(Seria­l1);

    dirk

  • Thank you dirk.

  • Hi Sacha,

    I'm sorry in advance for this probably stupid question but I've searched high and low but can't find a straight answer. As I understand it the Xbees create a mesh network that requires (at least? or ONLY?) one coordinator. The rest can be either routers or endnodes. My question is, can the coordinator just run normal code like the other nodes or does it have to be dedicated to only being a coordinator?

    A few other questions I have are:

    • what RSSI values can you get? Is it only from end to router or also from any node to any node?
    • is it required to program the xbees on the PC using the usb cable interface or can you do it while connected to the espruino (or arduino) in init code?

    Thanks so much for the module :)

  • Hi Alex,

    You need some basic understanding about xBee. The following book may help:
    http://shop.oreilly.com/product/97805968­07740.do

    I try to answer your questions.

    You need ONE coordinator, but only ONE!
    The rest can be routers or enddevices. Routers as the name says can route to others.
    The special of enddevices is, that they can't route but they are able to sleep.

    With my module you will be able to communicate with all types (Coordinator/Router/Enddevices)

    I think RSSI values or link signal quality can be read out by AT commands. Should be possible with all types of devices.

    You need a PC to flash the right firmeware to the xbee's first.
    Use the latest xBee firmeware in the API variant.
    All the other settings can be done on the PC too or by AT commands from the espruino.

    Sacha

  • Hi Sacha, thank you for the explaination. I'll order the book you mentioned. Just to check, the coordinator can run normal code like the rest of the nodes or does it have to be dedicated to coordinating? From the espruino's point of view, would it matter which is the coordinator and which is a normal node?
    ~Alex

  • Hi Alex,

    Yes you can connect a espruino to the coordinator or a router/enddevice und communicate using the module without a difference.

    Sacha

  • Hi all,

    I just want to let you know that the XBee module is rewritten, it uses now in most cases Uint8Array instead of simply arrays. Saves a lot of memory.

    Consult the actual API documentation:

    http://www.espruino.com/XBee-API1

    Sacha

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Module: xBee-API1 V1.0A

Posted by Avatar for Sacha @Sacha

Actions