Note that there are some explanatory texts on larger screens.

plurals
  1. POXBee - XBee-API and multiple endpoints
    primarykey
    data
    text
    <p>Using Andrew Rapp's <a href="https://code.google.com/p/xbee-api/" rel="nofollow noreferrer">XBee-API</a>, how can I sample <a href="http://en.wikipedia.org/wiki/Input/output" rel="nofollow noreferrer">I/O</a> data via a coordinator from more than two endpoints?</p> <p>I have 17 Series 1 XBees. I have programmed one to be a coordinator (API mode = 2) and the rest to be endpoints. Using XBee-API I am sending a Force I/O Sample ("IS") remote AT command, unicast to each endpoint. This works perfectly well when there are up to two endpoints, but as soon as a third is added, one of the three always becomes non-responsive (times out with XBeeTimeoutException). It's not always the same physical unit that stops responding, but it is <em>always</em> the third one (for example, if I send Force I/O Sample to Device1, Device2, and Device3, Device3 will time out, and if I change the order to Device3, Device1, Device2, Device2 will time out.</p> <p>If I set up more than three XBees, about 1 out of 3 will time out - but not every third one.</p> <p>I've verified that the XBees themselves are fine. I've searched the Internet and Stack&nbsp;Overflow in particular to no avail. I've tried using a simple ZNetRemoteAtRequest. I've tried opening and closing the XBee coordinator serial connection once for all three devices, once per device, and once per program run. I've tried varying the distance between the coordinator and endpoints (never more than five feet apart). I've tried different coordinator configuration parameters (from the Digi documentation). I've tried changing out the XBee for the coordinator.</p> <p>This is the code I'm using to send the Force I/O Sample request to each endpoint and read the response:</p> <pre><code>xbee = new XBee(); // Coordinator xbee.open("/dev/ttyUSB0, 115200)); // Happens before any of the endpoints are contacted ... // Loop through known endpoint addresses XBeeRequest request = new ZBForceSampleRequest(new XBeeAddress64(endpointAddress)); ZNetRemoteAtResponse response = null; response = (ZNetRemoteAtResponse) xbee.sendSynchronous(request, remoteXBeeTimeout); if (response.isOk()) { // Process response payload } ... // End loop and finally close coordinator connection </code></pre> <p>What might help polling I/O samples from more than two endpoints?</p> <p><strong>EDIT</strong>: I found that Andrew Rapp's XBee-API library fakes multithreaded behavior, which causes the synchronization issues described in this question. I wrote a replacement library that <strong>is</strong> actually multithreaded and correctly maps responses from multiple XBee endpoints: <a href="https://github.com/steveperkins/xbee-api-for-java-1-4" rel="nofollow noreferrer">https://github.com/steveperkins/xbee-api-for-java-1-4</a>. When I wrote it Java 1.4 was necessary for use on the BeagleBone, Plug, and Zotac single-board PCs but it's an easy conversion to 1.7+.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload