2

I have a mesh network running with Xbees. I have to total possible nodes (i.e 20) in the network along with their addresses. I want to create a script that would tell me which of the nodes are on (in case some turn off for what ever reason).

How can I do this.

I am using the following library: https://pypi.python.org/pypi/XBee

Any help would be appreciated.

Thanks!

39fredy
  • 1,923
  • 2
  • 21
  • 40
  • What have you tried? Did it work? If not, what output did you get and what did you expect? – DisappointedByUnaccountableMod Sep 08 '15 at 18:40
  • Im currently working on a script. I have a home Xbee. In which I receive packages from a wearable. The mesh network works to deliver that package regardless of how close the wearable is to the home Xbee. The issue is that I am constantly receiving messages. What I was thinking of doing is to send a package to every node and see if there is some sort of acknowledgment. In theory I have that idea but I don't know if it would work or if there is a better way to approach this (maybe a built in function) – 39fredy Sep 08 '15 at 18:45
  • The issues is that you are constantly receiving messages? Shouldn't you be? – DisappointedByUnaccountableMod Sep 08 '15 at 18:49
  • The issue is that there is no microcontroller attached to every individual Xbee( just their on board one) So if I would create a script that sends a specific message to each xbee and require it to send one back as an acknowledgment it would not know to send d one because it doesn't have an external microcontroller. The wearable has a micro controller and so does the home xbee. – 39fredy Sep 08 '15 at 18:57
  • I remember there is a command in the XBee API that can list all the connected nodes, but I do not remember which, and if it is available in mesh mode. The API is rather complex and it's been a long tome I've read it. But my suggestion is that you look at this specification on the Digi site. You can still use the XBee module to easily access the API mode. – Cilyan Sep 08 '15 at 19:51
  • 1
    I don't think we have got to the real problem yet - you are focussed on wanting to understand which nodes are contactable, but you say the issue is that you are constantly receiving messages, and that sounds like the nodes aren't uncontactable. For the moment, ignore the question you have asked - What is the actual problem you have? – DisappointedByUnaccountableMod Sep 08 '15 at 23:02
  • Is the command get_node_list() ? I can't seem to get it to work. Is there more insight you can add? Thanks? – 39fredy Sep 10 '15 at 17:56
  • Which mesh protocol are you using? DigiMesh? ZigBee mesh? – sawdust Oct 12 '15 at 01:17

1 Answers1

1

I assume that if you don't have a microprocessor attached to remote nodes, you're making use of their remote I/O functionality. You could send a remote AT command (like ATD0 to read digital input 0) to each node on a periodic basis. Or set up input sampling to have nodes send you a periodic report of their I/O lines along with notification of changes.

What's wrong with constantly receiving messages from the remote nodes? You must be using API mode if you have that many devices, and you can just keep a table of devices along with the last timestamp that you heard from them. If a device hasn't reported back within a certain time, you can mark it as offline.

tomlogic
  • 11,489
  • 3
  • 33
  • 59
  • Yes, the documentation you linked to in the question show a `remote_at()` method on the `XBee` object. For input sampling, read that portion of the XBee module documentation. I believe you set `ATDH` and `ATDL` to be the target for the periodic samples, and there are other parameters to configure the frequency of reports, along with which I/O line changes will trigger immediate reports. – tomlogic Sep 11 '15 at 20:01
  • Thanks, I've read the documentation but I'm having trouble knowing exactly what to do. I know the maximum number of xbees I'm going to use. I know that some might be either on or off and I want to know which ones are on and therefore which ones are off. I have a list of all address and I want to know which ones are on. Is there a way send a package to every none and see if i get a response? But the issue with that is that how would the xbees know when they have to send a response considering that have no micro controller attached? – 39fredy Sep 13 '15 at 16:10
  • The XBee module responds to the remote AT command itself -- it isn't passed through the serial port to the attached host. You should be able to keep a list/table of all of the modules, with their addresses, and a timestamp of when you last sent and last received a message. Maybe even a count of messages sent without a response. From that information, you can tell which ones have gone off-line. – tomlogic Sep 15 '15 at 00:20