Force the end device connect to one of the router.

Is there anyway to connect the end-device not to the coordinator directly but one of the routers?

Sure, set the NJ value on the Coordinator to 0 and leave it on the router you want the end device to join with to FF.

What does “NJ=0” mean? I did it but no luck. End device connectes to coordinator. I guess with NJ=0 it refuses any connection request from time=0 ,so, nobody(routers, end devices) can not connect to the coordinator? I am confused…

Power off the End device. Then issue a Global network reset (ATNR1). Let the router Join. Then Set NJ to 0 on the Coordinator leaving NJ to FF on the router. Now power up the End device. The End device will now join the Router.

Thank you for the reply.

1)Set NJ 20 on a coordinator using xctu and power up the coordinator.
2)Power up all routers in 20 sec.
3)Power up end devices after 20 secs.
Does this work? I tried this but it didn’t work,
I guess I did some mistake…

XCTU does not power up a Coordinator.

Just put the end devices to sleep or power them off. Power on the Coordinator and routers with NJ set to FF. Issue a Global network reset (ATNR1). Let the router rejoin the coordinator. Set NJ on the Coordinator to 0. Power on the end devices and let them join the routers.

thanks for the reply!

So, how to “Set NJ on the Coordinator to 0” after router rejoining the coordinator? Do all the sequence with ARDUINO sketch?

Thanks!

That’s up to you on if you use an Arduino or not. The truth is, you don’t need an Arduino or other processor to do this. All you need is a few interface boards, a PC and a Terminal Emulator or XCTU.

If it was me, I would connect all three to interface boards and a PC. I would then using XCTU’s terminal, find the Coordinator. Enter command mode and issue the ATNR1 command.

+++
ok
ATNR1
ok

Then I would pull the end device out of the board or the USB cable from that board thus powering off the end device. The router will then associate to the Coordinator. On the Coordinators terminal tab, I would then enter command mode and disable joining.

+++
ok
ATNJ0
ok
ATWR
ok
ATCN
ok

I would then power on the end device. Since joining is disabled on the Coordinator, the end device will have to join the router.

mvut,

thanks a lot for the reply.

I should have described what I want to do at the beginning.

I plan to have 1 coordinator, 12 routers and 50-80 end devices.The coordinator is connected to host computer(PC or raspberry-pi or whatever). End devices are sometimes moved their location and should always be connected to the closest router(not connected directly to coordinator). So, recnnection to different router may take happen when the end device moves. I don’t know it is possible with ZigBee.

What info I want to gather is :: I want each router to report the coordinator it’s subordinate end devices address and AD1 analog value every 1 minute or each end device to report the coordinator it’s belonging router address and AD1.

Do you think this is possible with XBee ZigBee? I begin to think it is impossible…

Without using some sort of external processor, I don’t see how that is going to work. The problem is that you want the End device to report its parent router along with ADC data. The radio does not have the ability on its own to do that. It can send the ADC data but you would have to issue a New Source Rout packet on every transmission and that would cause too much additional traffic on your limited network. You would have to reduce the sending rate to more like 1 to 5 mins, from each end node.

Also note that by doing that, you also disable ADHOC mode. So as the network moves, you would not be able to determine a new path to take. Not without forcing a New Rout Discovery which eats up time.

mvut,
Thank you very much for the explanation and I clearly understand the problem in my plan.

Then, I want to do another experiment in which there are 100 end-devices, each has 2 digital inputs that could be turned on/off every 5 sec. ZigBee network configuration won’t change while the network is active(2 or 3 hours). I think this is no problem with ZigBee… What do you think? Is it possible to cover this with 1 coordinator - 10 routers?

Thanks in advance.
fuyacho

Depending on your sleep cycle, I am not sure you will be able to send that many commands that fast. But you will be able to cover 100 end node with one coordinator and 10 routers.

hi, I have a question. I tried to connect 1 end device + 1 router + 1 coordinator. I typed the router SH, SL in end device DH, DL. And then, i also typed the coordinator SH, SL in router DH, DL(i typed all same ID, SC). When i tried to test the connection in the XCTU software, it works well each other. But trying to whole xbee then router->coordinator connection is not working well.

That’s because the DL and DH addresses indicate who you want the data to come out the UART of. If you want to send data from Node A to Node C via Node B, then simply set node C’s SL and SH in Node A’s DL and DH. Node A will figure out how to get the data their all on its own.

Thank you for your answer.
First 3 devices are in same ID, SC. And then typed end device DH, DL the coordinator SH, SL.
Q1. And should i typed router DH, DL(coordinator SH, SL) also?

After that Power off the End device -> Connect the router and coordinator -> set NJ to 0 on the Coordinator leaving NJ to FF on the router -> power on the end device.

Q2. Should I discover the remote devices?
Q3. How can I know that the end device join the network?

Q1, no you do not need to. The DL and DH commands control where data being sent into the XBee modules UART or any enabled ADC or Digital Inputs goes to.

Q2/3, If you do not know its address, then you can do a discovery. But if you use the JN command and API mode on the Coordinator, you will get a packet telling you the Nodes 64 bit address when it joins the network.