Hi, Trying out the BT121. Get gibberish when connecting teraterm at 115000 or any other baud. Thought I'd try BGTool GUI i read about but can't find where to download.
Anyone know where to download BGTool GUI for Windows?
Thanks / Bryan
The BGTool GUI application is part of the standard BT121 SDK installation. If you have downloaded and installed this from the Software Releases section of the BT121 product page, currently on the Bluegiga website:
...then the application should be found in the /bin subfolder wherever you have installed the SDK.
Note that the BT121 with the factory default configuration uses the binary BGAPI protocol. This would look like gibberish in a standard serial terminal application. 115200 is the correct default baud rate, but in order to see the data in its correct form, the terminal would need to display incoming data in hex format. The free Realterm app can do this, for example, by modifying an option on the Display tab.
The BT121 does not use AT-style commands, like classic WTxx modules running iWRAP do. While it is possible to manually parse incoming packets by hand and generate binary command packets, it is easier to control the modules with a BGAPI-capable application like BGTool or another custom host application (PC, MCU, or otherwise) which has compiled in BGAPI/BGLib support to handle the protocol parsing and generation for you.
For an example of a host-side BGAPI/BGLib-based implementation of an SPP server built specifically for the BT121, see the /host_example/spp_server/main.c file that comes with the SDK.
Clicked on BGTool.exe and Win XP 32bit says "Is not a valid Win32 application".
Is there a 32 bit version?
Unfortunately the BGTool application currently does not support Windows XP. I don't believe it is a CPU architecture issue (the .exe is actually 32-bit, not 64-bit), but rather a more fundamental operating system incompatibility.
If possible, can you update to a newer version of Windows? Even Microsoft has completely stopped supporting XP in any way as of 16 months ago.
At some point. Meanwhile what string to send BT121 to make it switch to classic SPP slave waiting to be discovered by Windows BT, with 9600 baud, no flow control with passkey 1234
I could send to BT121 in raw binary, ascii hex, or convert a hex string to raw binary, etc.
All I need for testing right now is switch BT121 as above, and test. Can you provide the bytes to send the BT121 for the above? And the last element would be the one that changes the baud.
The complete sequence of every byte for all commands, responses, and events concerning SPP setup would be prohibitively complex to describe. The best material here is in the API Reference Guide, which you can download from the same documentation page that I previously referenced. Every API method is documented in detail there, including the packet structures in each case.
The commands that you have to use are the same as what is found in the "main.c" file mentioned earlier. Starting on line 158 of that file, you can see that the "system_hello" command is sent first, and then response detected in the main while() loop and switch() statement. Further actions are triggered based on the additional responses and events that come in and are caught in the switch cases. The RFCOMM server is started when the system_initialized event occurs, and the module is put into connectable mode when the rfcomm_start_server response comes in.
This is largely the same functionality that is implemented using BGScript in the "bgdemo" example project that comes with the SDK, although that also includes BLE advertisements and functions. You could start with that project on the module instead.
Note that you cannot defined a fixed passkey such as "1234" to be used during the pairing process. The fixed PIN method of pairing is only allowed in one specific case, when you pair with a device which supports only the v2.0 or earlier Bluetooth specification. Everything using v2.1 or newer must use Secure Simple Pairing and a random passkey, or no passkey at all (the "just works" method without man-in-the-middle protection). Basically every device you could connect to under any circumstances today supports at least the v2.1 spec, adopted in 2007. This means the SSP and a random passkey will always be used.
Thanks Jeff. The reason I wanted to set a passkey is Windows stack wont create an SPP connection unless it is given a passkey when pairing. In the BLUEGIGA BLUETOOTH SMART READY STACK
API REFERENCE I don't see any method to change the baud of the module.
If you configure "Just works" mode (MITM disabled, I/O capabilities = 3, then you should be able to pair in Windows without entering a passkey. This is the way the BGScript "bgdemo" example is written:
# Set Bluetooth classic mode to visible and connectable call bt_gap_set_mode(1,1,0) ... # Configure Bluetooth Security Manager # No MITM required, no input/output -> Just Works pairing mode call sm_configure(0,3) # Enable bonding mode call sm_set_bondable_mode(1)
And it is also the way the BGAPI/BGLib based "spp_server" example is written, although it main.c doesn't specifically set the I/O capability with the sm_configure(0, 3) call.
If you enable MITM and the correct I/O capability (display only or something with a keyboard/numpad) so that a passkey is used, then it is true that Windows requires passkey.
The baud rate of the module cannot be changed at runtime via an API command. This instead requires modifying the XML hardware configuration in the project source files, then recompiling and reflashing (debug or DFU) so that the new firmware is on the module. See the hardware configuration guide document (UG119) for details on how this setting is changed in the source files.