Xbee end nodes need a router to communicate with coordinator - xbee

I have a network of Series 2 Xbees: one coordinator, one router and two end nodes (one end node receives data, the other sends). If the device with the router is turned off, the communication between the coordinator and the end nodes doesn't happen. The router and the coordinator are in the same room, so I don't think it's a signal strength issue. I reset the coordinator and the end nodes and they still don't communicate. They are all on the same PAN ID.
Any suggestions/tips?
Thanks

Check the SC parameter on the coordinator (command ATSC).
Make sure all modules are programmed with the same mask.
You can try to send the command ATNR0 to all modules too, so that all of them leave their current networks and restart the association process.

Related

XBee3 Coordinator cannot find End_Device during Network Discovery

Currently, I am running XBee3 International Mesh Kit and tried following the given example in the documentation.
https://www.digi.com/resources/documentation/Digidocs/90001942-13/?utm_source=packaging&utm_medium=insert&utm_campaign=xbee3&utm_content=XBeeZigbeeMeshKit#tasks/t_configure_zigbee_modules.htm%3FTocPath%3DGetting%2520started%2520with%2520XBee%2520Zigbee%7CExample%253A%2520basic%2520communication%7C_____4
I tried implementing the Network Discovery for the three devices using Micropython REPL.
The following is the configuration I have for my 3 XBee devices.
Parameters for the 3 XBee Devices
I am running the following code on the Coordinator and End-Device for network discovery
https://www.digi.com/resources/documentation/digidocs/90001539/#reference/r_node_discovery_micropython.htm%3FTocPath%3DGet%2520started%2520with%2520MicroPython%7CMicroPython%
Now when I try to run the python code for Network discovery on the Coordinator (XBee_A), it does not find any End-Device in the node list. The only Router comes up in the search.
But when I run it on the End-Device, it does find the Coordinator and Router.
My idea was to get the details of the End-Device using network discovery, gets it network ID (NI) and then send a command to the device.
Do you know what I am doing wrong?
Have you tried going into command mode and executing an ATND? What are your sleep parameters? If the end device is sleeping longer than the node discovery time limit, it won't be awake to respond to the discovery broadcast.
Try reducing the sleep duration on the end device, or increasing the node discovery timeout (ATNT) on the Coordinator.
I ran into the same issue where the coordinator just couldn't discover any node in the same network. Spending hours digging through other documentations and just to sadly realize the updated XCTU has both DH and DL defaulted to 0 so the default dash for DL in Digi's Mesh Kit User Guide should manually be set to FFFF instead for the coordinator to work. Not the best documentation and there are quite a few errors and information missing out then leave you guessing or pay them for support.

How to update internal state of nginx' module runtime?

Lets suppose I wish to write a nginx module that blocks clients by IP.
In order to do so, on initialization stage i read a file with IP addresses
that I have to block (black list) and store it in module's context.
Now I wish to update the black list without restarting nginx.
One of the possible solutions, is to add a handler on specific location.
e.g. if uri "/block/1.2.3.4" requested, my handler adds ip address 1.2.3.4 to the black list.
However, nginx runs several workers as separated processes, so only one particular worker will updated.
What is a common pattern to cope such problems?
But nginx does not require a restart (nor any downtime) in order to change the configuration!
See:
http://nginx.org/en/docs/control.html#reconfiguration
In order for nginx to re-read the configuration file, a HUP signal should be sent to the master process. The master process first checks the syntax validity, then tries to apply new configuration, that is, to open log files and new listen sockets. If this fails, it rolls back changes and continues to work with old configuration. If this succeeds, it starts new worker processes, and sends messages to old worker processes requesting them to shut down gracefully. Old worker processes close listen sockets and continue to service old clients. After all clients are serviced, old worker processes are shut down.
As an administrator, it would be my expectation that all modules would, in fact, be controlled in this way, too.
(Of course, if you require a lot of changes to the configuration very often, a different solution might be more appropriate.)
You give an explicit example of blocking access by IP. Are you sure you require a new module in order to accomplish the task? It would seem that a combination of the following standard directives might suffice already:
http://nginx.org/r/deny && http://nginx.org/r/allow
http://nginx.org/r/geo
http://nginx.org/r/map
http://nginx.org/r/if && http://nginx.org/r/return
If you're able to move the black list outside of the module's context, perhaps to a system file, a KV store, or SHM, that would allow each process to talk to a central source blacklist. I believe shmat() and futex will do the job and the overhead will be negligible.

XBee End device stops responding after network join

I have two XBee S2 modules.
First module has freshly uploaded ZigBee Coordinator API version 21A7. PAN ID = 1000; AP=2; the rest has default values.
Second has freshly loaded ZigBee End Device API version 29A7. PAN ID=1000; AP=2; the rest has default values.
While end device is not joined to coordinator, it responds to all AT commands. For example AT NI command (7E 00 04 08 01 4E 49 5F) returns correct AT Command Response.
After turning on coordinator, end device correctly joins coordinator's network, but stops responding to local (and transmitting remote) AT commands.
Despite this non-functionality end device is correctly responding to remote AT commands from coordinator.
Do you have some idea please?
It sounds like the end device might be sleeping once it's joined to the coordinator. You can't send serial data to it while it's sleeping, and may need to monitor the CTS signal coming from the XBee. Or, make use of the "sleep request" pin on the end device for the host to signal the XBee module to wake up.
If you don't have low power requirements on your project, I'd recommend using a "router" device configuration instead of a sleepy end device. Routers on the network form a mesh for transferring information, and you don't have to worry about multiple issues related to sleeping (host can't send serial data to sleeping end device, remote devices can only have one outstanding frame pending for a sleeping device, etc.)

Best way to enter a distributed network at the socket level

In a distributed node network what's the best way for a node to enter the network? We're trying to make a distributed file system that's resilient to censorship.
The two ways I could think of were
1>caching ip addresses of other nodes in the network and hoping one could bootstrap our node back into the network
2> having a broadcast IP address that all of the nodes listen too. However, this could be blocked by a firewall.
Are there any other other ways?
May be gossip protocol could work for you:
The core of the protocol involves periodic, pairwise, inter-process interactions.
The information exchanged during these interactions is of bounded size.
When agents interact, the state of at least one agent changes to reflect the state of the other.
Reliable communication is not assumed.
The frequency of the interactions is low compared to typical message latencies so that the protocol costs are negligible.
There is some form of randomness in the peer selection. Peers might be selected from the full set of nodes or from a smaller set of neighbors.
This is a classic bootstrapping problem: who do you connect to? Who do you connect to determine who to connect to? (This applies to using a Gossip protocol as well: how do you initially know who to gossip to?)
Down at the very bottom you eventually get to a seed-node list: a hard-coded list of servers that tell you who to connect to or to whom you initially connect. (Note: DNS is one way of implementing a seed-node list.)
On top of that, it depends on the nature of your distributed system. In my distributed system, I've piggybacked on top of the protocols used within the system itself. For the core, I use seed-nodes & gossip; for the next level I use seed-nodes & reliable broadcast; above that I use seed-nodes + distributed state-machine.

How to block an erlang process until a network connection becomes available

I am setting up a sort of syncing mechanism between two different erlang nodes (on 2 different machines or devices). One of these devices will be disconnected from the network to accomplish another task.
When the device is reconnected to the network, it needs to contact the other erlang node to initiate data syncing.
Is there a way in erlang to receive a message when the network connection is available? Or would I have to do some sort of polling.
Thanks,
Brad
You can subscribe to node connection changes through net_kernel:monitor_nodes/1. This will send you {nodeup, Node} and {nodedown, Node} messages you can use to drive your own sync logic.
You would probably want a process that regularly runs net_adm:ping(TargetNode) to try to connect to the other node so that would would then get the {nodeup, TargetNode} messages. This would avoid needing to explicitly check OS network availability via polling (the undocumented) inet:getiflist/0 for changes.

Resources