# Using XBee (X2B) security to prevent join?

**URL:** <https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083>\
**Category:** XBee & XBee Gateway\
**Tags:** security, xbee-pro\
**Created:** [July 14, 2016, 12:21pm UTC](https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083 "2016-07-14T12:21:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coralyn](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@Coralyn](https://forums.digi.com/u/Coralyn)\
**Post date:** [July 14, 2016, 12:21pm UTC](https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083/1 "2016-07-14T12:21:03Z")

</div>

Is it possible to use the XBee (X2B) security to prevent join? It doesn’t seem to allow this - data comm is blocked, but not (from the remote router’s view point) being joined to a coordinator with security enabled.

I am trying to salvage some nodes sealed inside cases. Unfortunately, things like PAN and SC are hard-coded in FW, so I have 2 sets of equipment which ‘mix’ on 2 different Digi-X2D gway.

I had thought I could use security, as the sealed nodes allow me to change EE and KY remotely, however what I am seeing:

In coordinator (in Digi-X2D), it set EE=1 and KY={some key}. Great - just like example in PDF doc.

In the routers, which have EE=0 … they STILL happily join the coordinator, merrily blinking their LED.

However, the coordinator does NOT see them; they don’t show up on the GWay’s xbee list.

If I add another test Router API node, it also gets into this happily-but-sad mode. XCTU allows me to show the network, with the Digi-X2D as coordinator and all the dumb-happy routers who think they belong to this broken network.

Is there a setting in the Xbee coordinator (all are the 0x2?A7 FW) which would prevent it from offering joining to any node with security disabled (EE=0)?

---

<div class="post-metadata">

**Author:** ![asgm](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/asgm/32/3688_2.png) [@asgm](https://forums.digi.com/u/asgm)\
**Post date:** [July 15, 2016, 5:16am UTC](https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083/2 "2016-07-15T05:16:44Z")

</div>

If Coordinator is with encryption enabled, then no module can join it without knowledge of Encryption Key.

You can also take a look at Node Join Time “NJ” parameter on Coordinator. This will limit modules to join Coordinator only for certain time after powering up.

---

<div class="post-metadata">

**Author:** ![jlovinger](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jlovinger](https://forums.digi.com/u/jlovinger)\
**Post date:** [July 15, 2016, 10:44am UTC](https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083/3 "2016-07-15T10:44:42Z")

</div>

Not entirely correct. The initial MAC association phase does not require encryption. With a configured KY and EE=1 an XBee will expect to receive a Transport Key encrypted with its unique KY value in order to stay on the network. But with EE=0 the initial association is enough to have them stay on the network but unable to communicate.

---

<div class="post-metadata">

**Author:** ![jlovinger](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jlovinger](https://forums.digi.com/u/jlovinger)\
**Post date:** [July 15, 2016, 10:52am UTC](https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083/4 "2016-07-15T10:52:37Z")

</div>

This is actually kind of a tricky problem caused by the fact that join process is split across a couple layers.

First is the initial MAC association which does not require any encryption.

Second is the Transport Key which is used to exchange key data if/when EE=1.

By having EE=0 on the joining devices they stop at the successful MAC association and never fail out due to missing/incorrect Transport Key. There is no immediate method to determine the EO setting of a remote device from the coordinator in order to know if it should be kicked off or not. Edge cases abound and not a safe operation.

If you can set EE/KY on the sealed nodes why not just set them to match one of your gateways so they join successfully then update any additional parameters via remote AT requests?

---

<div class="post-metadata">

**Author:** ![Coralyn](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@Coralyn](https://forums.digi.com/u/Coralyn)\
**Post date:** [July 15, 2016, 12:45pm UTC](https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083/5 "2016-07-15T12:45:01Z")

</div>

Thanks JL - that’s what I’m seeing; the EE=0/unaware nodes just join & sit there happy & broken.

My problem is the devices are ‘sealed’ & most settings hard-coded by FW over-writes. Really I am most concerned about a documentable procedure. So I thought I’d have 1 coordinator with EE=0, and 1 coordinator with EE=1 … and if lucky, the raw devices would connect to the EE=0 coordinator, allowing us to force in the EE=1 plus KY=??, which would cause them to move the ‘correct’ coordinator. Slick assembly line!

My problem is once the units boot & join ‘someone’, there is no easy way to move them. So if they boot (with EE=0), join the ‘wrong’ coordinator (with EE=1), then I’m hosed! I cannot talk to them & have no way to ‘move’ or network reset them … unless I turn EE=0 on that ‘wrong’ coordinator & do it that way. But that’s not such a great process paradigm for production.

True, it is a very silly product design, but I am working with the products I’ve inherited! It is a pity the ZB ‘join’ process doesn’t include a ‘want encrypt’ or ‘no encrypt’ flag - as it now has the Zb version and XBee/Digi extensions or not flags. That way the ‘wrong’ coordinator would not offer joining to a unit with mismatched encryption settings.

---

<div class="post-metadata">

**Author:** ![jlovinger](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jlovinger](https://forums.digi.com/u/jlovinger)\
**Post date:** [July 15, 2016, 1:37pm UTC](https://forums.digi.com/t/using-xbee-x2b-security-to-prevent-join/17083/6 "2016-07-15T13:37:29Z")

</div>

Just to confirm…

You have existing devices that are configured with EE=0. They need to be commissioned on the factory floor with their production configuration (EE=1 and KY=?). The device is sealed/etc such that you can’t connect direct to the enclosed XBee and need to join with a compatible gateway (EE=0) to configure via remote AT commands. However along with the EE=0 gateway you also have an EE=1 gateway in the vicinity which is capturing some of the uncommissioned units when they are turned on.

If I had to guess, the EE=1 gateway is for production test that the device commissioning is successful so you can’t just disable it completely.

Without modifying the sealed devices I think the main option you have is control NJ on the EE=1 gateway to disable joining while an uncommissioned device is attempting join to the EE=0 gateway. Set NJ=0x0 when you need a device to join with the EE=0 gateway initially, then set NJ=0xFF when you need to confirm the commissioning.

In a future revision a slightly cleaner method to resolve this would be to have the device firmware set JV=1 if EE=0. This will cause the XBee to confirm contact with the coordinator. Will fail when the EE=0 device joins the EE=1 gateway at which point will leave and retry join and hopefully hit the EE=0 gateway. When comissioned and confirmed join to the EE=1 gateway force JV=0 so you don’t have awkward field behavior.
