Home/Support/Support Forum/use labview to set up bluetooth authentication password

use labview to set up bluetooth authentication password

0 votes
Is there a way to set up Bluetooth on a default xbee3 using Labview?
I can't find any way to enter a Bluetooth authentication password except using XCTU.
asked Feb 16 in XBee3 Cellular by Bruce Mc New to the Community (0 points)

Please log in or register to answer this question.

2 Answers

0 votes
The process of setting the BLE password is nothing more than an AT command. SO it is just a matter of writing a LabView script that accesses the COM port, Enters command mode, and issues the AT commands with the desired value.
answered Feb 16 by mvut Veteran of the Digi Community (14,063 points)
To clarify, the BLE password is not set simply via an AT command. The $S, $V, $W, $X and $Y values are generated using the SRP (Secure Remote Password) algorithm, but as a best-practice security measure there is no AT command on the XBee which takes the password and updates those settings. In this way, the XBee never holds the password itself, only the salt and verifier values.

Bruce Mc, you will need to find an SRP library for LabView, or use another tool/language to generate the values, and then feed those into the AT commands as mvut describes.

The parameters for the SRP algorithm used in the XBee 3 device are described here: https://www.digi.com/resources/documentation/digidocs/90002273/reference/r_frame_0x2c.htm
"but as a best-practice security measure there is no AT command on the XBee which takes the password and updates those settings. In this way, the XBee never holds the password itself, only the salt and verifier values."

Thank you for the quick response. We are trying to set a default Bluetooth Identifier and default authentication password on XBee3 modules in production assemblies, so it sounds like that is not possible without using XCTU. Hmmm....
It certainly is possible to set those values without using XCTU. XCTU merely provides a nice UI and hides the details of generating a salt (random value) and deriving the verifier (using the salt, password, and the constant username "apiservice") per the Secure Remote Password protocol.

Secure Remote Password is well-documented on the internet and there exist many implementations of libraries in different programming languages. For instance, if you look at the "Usage Example" for pysrp, the "salt" value is AT$S, and the "vkey" value is AT$V, $W, $X and $Y. (The verifier value is 128 bytes long, and due to space constraints, the XBee stores it across those four commands.) https://github.com/cocagne/pysrp

The Bluetooth Authentication dialog in XCTU is provided as a convenience for users. It is NOT the only way to go about configuring the parameters.

I hope this makes sense.
One solution you could do is to use the LabVIEW VI to call to the python SRP module. This could generate the salt and verifier of your desired password that would be input into the $S, $V, $W $X and $Y AT commands.

A good example of python code that calls the SRP library and then inputs the results into the AT commands can be found here (update_bluetooth_password()):

There might be some SRP module available to LabVIEW that I'm not aware of. The above method is similar to what we do in testing the device is also effectively what XCTU is doing.
0 votes
Here is a link to a Digi article with an example of how to set values over the air.

answered Feb 17 by Jay New to the Community (33 points)
Thank you mvut, tckr, cevans, and Jay for your answers. Between all of you I gained understanding and learned what needed to be done. I ended up using XCTU to generate a salt and verifier for the desired password for one XBEE3 module.
Then used AT commands to send this information to another XBEE3 and enable Bluetooth. The desired password works! This solves my problem. Again - thank you all!