-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about link quality #122
Comments
Hi @aminrd, The class # Callback for discovered devices.
def callback_device_discovered(remote):
print("Device discovered: %s" % remote)
# Callback for discovery finished.
def callback_discovery_finished(status):
if status == NetworkDiscoveryStatus.SUCCESS:
print("Discovery process finished successfully.")
else:
print("There was an error discovering devices: %s" % status.description)
[...]
xbee = ZigBeeDevice(PORT, BAUD_RATE)
xbee.open()
xb_net = device.get_network()
xb_net.add_device_discovered_callback(callback_device_discovered)
xb_net.add_discovery_process_finished_callback(callback_discovery_finished)
xb_net.start_discovery_process(deep=True)
[...]
if xb_net.has_devices():
print("%s" % '\n '.join(map(str, xb_net.get_connections())))
[...] Best Regards. |
Hi @tatianaleon , Did you find how to determine the link quality between two devices?
I get |
Hi @shubham9436 As Tatiana said, you cannot directly instantiate or create a "Connection" object. The link quality between two nodes is only calculated/determined when performing a "deep" scan of the network. You can see an example on how to do a deep scan in the previous answer. Once the deep scan is complete, the network stores "Connection" objects with link quality information between nodes. You can extract the connection list from the network invoking the "get_connections()" method. That is the only way to determine the link quality of nodes using the API. |
test2.zip Discovery process finished successfully. Do you know what I'm doing wrong for this? I can see my two nodes, but don't get link quality. |
Hi @seanhodgson, If you follow the example above, you must use protocol classes ( Try to change: device = XBeeDevice(PORT,BAUD_RATE) To use:
device = ZigBeeDevice(PORT,BAUD_RATE)
device = DigiMeshDevice(PORT,BAUD_RATE) Best Regards. |
Thanks for the clarification. I have replaced the XBeeDevice with DigiMeshDevice. It opens the device, but at about the point it should discover one of the other DIGI xbee RF Modems I'm working with it throws the following exceptions: Is there a better example I should be using for a starting point? |
I'm able to get the link quality through the XCTU tool, so I would expect it should be possible with the Python. |
Hi @seanhodgson, As you pointed out, there was an issue in the code. It is fixed in master (commit b7a9b5e). and will be included in the next release. In the meantime, you can download the source code from the master branch and install the library from there (see instructions at https://github.com/digidotcom/python-xbee/blob/master/README.rst#install-from-source). Sorry for the inconvenience. Best regards. |
Understood |
Just out of curiosity, do you have any idea when you might be doing a new release of the xbee-python? |
as an FYI: pulling from the master branch and installing locally has resolved my issue. Thank you. |
Hi there,
I have two Xbee modules in an Xbee mesh netwwork that are communicating with each other. I want to show the link quality on my web application over time. I have installed the Betta version, in which, LinkQuality and Connection classes are added to
device.py
.Currently, when I call
digi.xbee.devices.Connection(device1, device2).lq_a2b
it always returnsUNKNOWN_VALUE = -9999
.However, in XCTU application, I can see the link quality between two xbee modules using Range test. How can I somehow show connection quality (in dbm or % or ...) using python packages.
Thank you in advance.
The text was updated successfully, but these errors were encountered: