So I have a home project I am working on. I will describe my project and then get to the question.
I have a network of 10 XBee’s successfully communicating and performing the same basic functions but in a position dependent sequence. Each XBee is permanently attached to a tower. So, there are 10 towers each with an XBee. These 10 towers communicate remotely with a coordinator module at the control panel. When not in use, the towers are on a rack in a closet. When they are in use a tower is randomly grabbed and push-to-connected into 1 of 10 ports. Do this with each XBee with the remaining push-to-connect ports. So here is the goal: I would like to make the network so that when a random XBee tower is connected to a random port the XBee “sees” that specific port and assumes that position’s specific functionality.
I have 2 solutions in mind:
1.) using Micropython and then tethering into Python: I2C bus of sensors running to each of the 10 ports. On an I2C bus each sensor has a unique address. So, when an XBee tower is push-to-connected, it would see the address of the I2C sensor and then run an if statement depending on the sensor’s address.
2.) power cycling… on/off power is manipulated in such a way that when one tower is ON, that tower knows the position that its in because only that tower was powered on… then that tower assumes that position’s functionality.
Any thoughts or suggestions on this problem? The primary question is below:
last but not least, is it possible to change the Node Identifier (NI) of an XBee module in python code?? Because right now I’m thinking the easiest thing to do with either of the proposed solutions is to essentially have a module push-to-connect into a port, see a position identification, and then change it’s own NI to the NI of that position’s functionality. In the code the positions are ordered by module NI order, i.e. module00, module01, module10, etc. Because originally the design was such that you had to put tower00 with module00 in port00. But I want to put towerXX with moduleXX into portXX and the system reconfigure itself accordingly. (All the XBees are doing the same basic functionality but in a different sequence based on their position)
It a cool project! thanks for any help or even just conversing about it
cheers