cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

Hi all,

I am using CYBLE 0120011-00 BLE module.

I have a 3 slave devices each has I2C based sensor and RTC module.

and also Have master with a I2C based Sensor and RTC module.

project requirement is periodically mater should receive data from 3 slaves and process should go on.

which BLE profile should i implement for effective communication with slave and master.

how i should go for security and desired connection?

Thanks,

sagar.

0 Likes
1 Solution
himam_31
Employee

In BLE there is no profile exactly suitable for serial protocol. You will need to use custom profile. You can design the profile in such a way that Client perform reads periodically from the slave. Also note that simultaneous connection to multiple slaves is not possible, you will need to time multiplex.

Thanks,

Hima

View solution in original post

7 Replies
himam_31
Employee

In BLE there is no profile exactly suitable for serial protocol. You will need to use custom profile. You can design the profile in such a way that Client perform reads periodically from the slave. Also note that simultaneous connection to multiple slaves is not possible, you will need to time multiplex.

Thanks,

Hima

View solution in original post

Anonymous
Not applicable

Hi Hima,

Thanks For the answer,

I have implemented above scenario with heart rate collector and heart rate sensor and time multiplexing.

but i am facing some issue as below

1.INSUFFICIENT_ENCRYPTION_KEY_SIZE

2.sometimes peripheral device stops advertising/notification.

0 Likes
Anonymous
Not applicable

1. You need a larger encryption key size. This seems pretty self-explanatory?

2. Depending on how you write the peripheral BLESS event handler, you might run into an event where the chip does an event that causes it to stop advertising (based on code, since I haven't seen it lose advertisement without some event/notification/code telling it to).

I would suggest looking at your code flow and seeing if there are cases that could cause the advertisement to stop.

Also, just fyi, the notifications only work when the device is connected to another Bluetooth device; Notifications while unconnected shouldn't work, and this could be what you are seeing.

0 Likes
Anonymous
Not applicable

Thanks e.pratt,

Thanks for the information i will go through it.

can you please go through the logs attached here and and figure out something?

P.S-

2 different master logs(taken on separate days) and 1 slave log

Thanks.

0 Likes
Anonymous
Not applicable

Since most of the events are successes; I would assume there is something transient occurring in your code.

The insufficient encryption error has the following documentation:

/** Insufficient key size for the security requirements of this device */

Possibly, you are sometimes using the wrong value for the encryption key or encryption key size.

The following events make me think your code is behaving erratically (in Teraterm-master.txt):

Line 21: ConnectDevice API Error: 0x103 invalid state: state: scanning

Line 75: ConnectDevice API Error: 0x103 invalid state: state: connected

Line 91: ConnectDevice API Error: 0x103 invalid state: state: scanning

Line 168: CyBle_BascSetCharacteristicDescriptor API Error: 0x02 invalid operation

etc. etc.

0 Likes
Anonymous
Not applicable

Thanks For the patience..!!

Can you please look(in Teraterm-master.txt): after Line 57967.

as main problem causes after this and am unable to figure out as you can see scan progress shows the peripheral devices(00a050000aaa/bbb/ccc/ddd) but unable to connect.

device-3 is anyhow down so i am getting CYBLE_EVT_TIMEOUT: 4

Then i get start getting CYBLE_EVT_GAP_AUTH_FAILED, reason: INSUFFICIENT_ENCRYPTION_KEY_SIZE and ConnectDevice API Error: 0x103 invalid state: state: scanning

for time being as a workaround am using "CySoftwareReset();" for the 60 sec on both side and planning to do same if encryption error comes.

is there any way to inform heart rate sensor about heart rate collector has resetted?or any workaround so that all devices will be in sync.

but don't feel this is a better way.

0 Likes
Anonymous
Not applicable

It looks like one of your connection attempts fails, after which your code/state machine gets out of wack and starts trying to connect while still scanning, etc.

Try adding handlers for failure cases for: connecting, scanning, reading data, encrypting, etc.

That way, you can say retry encryption a couple times if it fails; Reset the encryption data if it fails too much, etc.

I would say the code looks to be behaving in a time-multiplexing fashion, and you just need to handle the failure cases.

0 Likes