cancel
Showing results for 
Search instead for 
Did you mean: 

Client mode for X-NUCLEO-IDB05A1

Dilbert K
Senior
Posted on November 23, 2017 at 01:16

I just started with the 

X-NUCLEO-IDB05A1 board which has the 

SPBTLE-RF BlueNRG-MS RF module.

I would like to focus on the 'Client mode' for this project.  Have downloaded the 'STM32CubeExpansion_BLE1_V3.2.0\Projects\Multi\Applications\SampleAppThT' and able to load and run the project in Client mode.

However, I need to get deeper, is there more example project ST has available for Client specific ?

like getting BLE device list and getting Advertise data of connected device...

What document would be best for BLE Client Stack study ?

Thanks so much.

10 REPLIES 10
Antonio Vilei
Senior III
Posted on November 23, 2017 at 11:59

Hi Dilbert K,

if you need more information about the Central role, like scanning, connecting to peripherals,performing services and characteristics discovery, I suggest to use the

/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fst_com%2Fen%2Fproducts%2Fembedded-software%2Fwireless-connectivity-software%2Fstsw-bnrgui.html

tool.

In the 'ACI Utilities' tab, ithas someinteractive features related to the Central Role that will let you get deeper. After you use those features,you can review the individual commands and events being generated.

In order to use the GUI, please make sure that your STM32 board isrunning the Virtual_COM_Port project of the X-CUBE-BLE1 package.

The BlueNRG GUI alsoincludes a set of scripts that you can run by usingits built-in interpreter. Starting from the rootof the tool installation folder, you can find them in the 'Application\scripts'. You'll find examples for many use cases, involving multiple connections, security, whitelist and so on.

These scripts are written in Python, but you can easilyget inspiration from them for your own C code.

Best regards,

Antonio

Dilbert K
Senior
Posted on November 23, 2017 at 17:02

Thanks for the info...however, I am trying to do a BLE hub using 

SPBTLE-RF, this is why I want some sample from ST in term of API of the stack.

I had been using the SensorTile platform for some time but all the code is on Server side.

Posted on November 23, 2017 at 17:56

Hi Dilbert K,

what do you exactly mean by BLE hub?

The SampleAppThT application that you have already used shows how to implement a GATT Client with SPBTLE-RF configured as Central.

The

http://www.st.com/content/ccc/resource/technical/document/programming_manual/1c/7e/d3/a6/d0/52/4a/35/DM00141271.pdf/files/DM00141271.pdf/jcr:content/translations/en.DM00141271.pdf

 programming manual 'BlueNRG, BlueNRG-MS stacks programming guidelines' provides details about how to program BlueNRG-MS (the chip that is used in your SPBTLE-RF module), including information about the client side.

If you want a more advanced example about how to use a single SPBTLE-RF client that can connect to multiple servers and get information from them, please refer to the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-ode-function-pack-sw/fp-net-blestar1.html

software package.

This package shows how to create a star-topology network of BLE devices. Before trying this example, however, I recommend going through the BlueNRG GUI as I suggested in my previous post, as this will help you learn the basics, first. The BlueNRG GUI works fine with SPBTLE-RF.

Best regards,

Antonio

Posted on November 23, 2017 at 23:38

Yes, I am.  BLE hub connecting to multiple BLE devices and send data out to WiFi.

The FP-NET_BLESTART1 is what I want.

I had scan through the PM0237 and locate the section for setup multiple connections...but doc is out dated compare to recent release code.

I tried following the doc and add following to set the stack mode

uint8_t stackmode[1]={0x03}; // mode 3 or 4

ret = aci_hal_write_config_data(CONFIG_DATA_MODE_OFFSET, CONFIG_DATA_MODE_LEN, stackmode);

ret = aci_gap_init_IDB05A1(GAP_CENTRAL_ROLE_IDB05A1 | GAP_PERIPHERAL_ROLE_IDB05A1, 0, 0x07, &service_handle, &dev_name_char_handle, &appearance_char_handle);

But the 2nd connection of following call still come back with Error = 0x41.

  ret = aci_gap_create_connection(0x0010,0x0010, PUBLIC_ADDR, bdaddr, PUBLIC_ADDR, 0x6c, 0x6c, 0,

0xc80, 0x000c ,0x000c);

 

I will go over the 

BLESTART1 and see I could find the code accordingly.

Antonio Vilei
Senior III
Posted on November 24, 2017 at 11:53

What is the current firmware version of your BlueNRG-MS devices?

Please make sure that you are using the latest version (7.2c as of now) of the BlueNRG-MS firmware on all of your SPBTLE-RF modules.

The tool and the readme with instructions for updating the BlueNRG-MS firmware can be found in

the Utilities/PC_Software/FlashUpdaterTool folder of the X-CUBE-BLE1 package.

Best regards,

Antonio

Posted on November 24, 2017 at 22:29

I had just updated

SPBTLE-RF(

BlueNRG-MS) to V7.2c yesterday using the tools.

But result the same.. got error on 2nd connection...

I search through the '

FP-NET_BLESTART1

' it is using the same code for both 

aci_hal_write_config_data & 

aci_gap_init_IDB05A1

Is there extra API need to call after 1st device connected ? before calling 

aci_gap_create_connection 2nd time ?

Posted on November 25, 2017 at 01:42

After some modification in '

FP-NET_BLESTART1

', I could 'connect' to 2 BLE devices of my current project.

Thanks so much for giving this project...

Posted on November 27, 2017 at 11:57

For curiosity sake, what modification was necessary in your case?

Best regards,

Antonio

Posted on November 28, 2017 at 22:32

Since the BLESTAR1 connect to ST device only (as expected), but I am connecting to BLE device which has it own Service UUID defined and different Services/Characteristics.

So, need to change those places to see device connect and Read data value.

Thanks so much for this package...it helps a lot...

Will order the WiFi module to get this completed