22 posts / 0 new
Last post
Bendaa
Offline
Last seen:3 years 3 months ago
Joined:2014-01-12 15:29
DSPS connection

Hi,
My customer is using a DA14580 module from Murata.
It is connected it to their micro via uart.
They want to transfer data from their system to a tablet which contains their own application via ble.
their system is sending data over the BLE (set as device) to a tablet as the data receiver.

The problem is that the tablet can't connect to the DA14580 device with the following error: "can not connect to device"

Please note that when trying to connect to DA14580EVKIT with central mode the setup works fine.

Please explain the problem and how they can solve it.

Regards
Dan
Tritech

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi Bendaa,

Hi Bendaa,

我看不出任何明显的原因since DSPS its a fully hosted code and the external micro just sends data over the UART - if i understand correctly the implementation of the system. So i suppose that the connection is allready established by the 580 and i assume that a disconnection happens when the external micro starts sending data. So to start with, try to not to send data over the UART and check how the system behaves. Also after the disconnection happens is the 580 able to advertise again ? If yes try to check the disconnection reason in the disconnection handler.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
hello

hello
i am bendaa's customer.
we have the 580 which is connected to our micro via uart.
we want to transfer data via ble to our app in a tablet, but it can seem to connect as seen in the pic attached
please advise on what need to be done in order to connect the 580 to the tablet app
please note that with the dsps app, the 580 is abe to connect and we see our data from the micro, in the dsps app console.

Attachment:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

Thats a more accurate problem description, the custom android application seems to require to bond with the 580, so it starts a paring procedure, the DSPS application doesn't implement security, and the DSPS anroid application doesn't require any security from the 580 in order to connect. So i suppose, that the custom android application initiates a security procedure but the 580 never gives a response and the link is dropped.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
Hi

Hi
The pic attached is from our attempt to connect the 580 to the android tablet in :settings-bluetooth
Its before we activated the app
We even tried to connect it to a regular android phone, in the bluetooth devices, just like you connect your phone to a regular bl device, like an earset for example
What do we need to change in the dsps_device in order for it to connect ?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

The same applies to the android, it requires security in order to pair to your device. You can add security in the DSPS reference design by defining the CFG_APP_SECURITY in the da1458x_confg_basic.h file, you are going to be able to connect and pair with the device, but you are not going to be able to stay connected to the android. The android disconnects from the device as soon as the device gets paired, since it has no reason to stay connected. But if you try to connect to any generic android application, BLE Scanner for example you are going to be able to connect and bond and exchange data normally.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
hello

hello
you said
"but you are not going to be able to stay connected to the android. The android disconnects from the device as soon as the device gets paired, since it has no reason to stay connected."
why will it disconnect?
what do you mean " it has no reason to stay connected"?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

The android default application will stay connected with a predefined limited subset of devices like HID since it waits data from those specific devices, in the DSPS case, the android will issue a disconnection since the DSPS doesn't belong to that kind of devices. You will be able to stay connected with a DSPS on an android phone only via a custom or a generic android application.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11


i have defined CFG_APP_SEC but got 8 errors as seen in the pdf attached
i did not see anything about security in the manuals/reference guides
what should i do/where should i search?
do i need to implement security on my own ? (i saw " void app_sec_init(void);" but didnt see its implementation)
b.t.w
i am currently using the dsps_device v3.150.2 because when i try to use the v5.150.2i have some problems
1)the advertising is not stable: mostly the dsps doesnt find the device when i search for it, but sometimes if i wait a long time it does appear for a few secconds and disapears.
2)if i do able to connect somehow, when ever my micro starts sending data via uart, the device disconects from the dsps app

can i fix these problems?

Attachment:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

Since you are using the DSPS on SDK3 you will have to implement the security functions yourself since there is no security implementation on DSPS SDK3 version. You can check the Smart Tag that implements security or you can have a look at the security implementation on SDK5 DSPS. Also you can have a look at the Software and tools tab in the tutorial section, tutorial 6 explains the security feature, perhaps you will find it usefull.

Regarding the problems you see on DSPS SDK5 we dont have any reports mentioning these kind of problems, if you use the 580 connected to your pc and not on your controller the same issues appear ? Also are you using the default pins that the DSPS uses or you have changed the pins ?

Thanks MT_dialog

jitian
Offline
Last seen:4 years 10 months ago
Joined:2016-06-01 09:41
If the uuid is different,

If the uuid is different, will not be able to connect!

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi jitian,

Hi jitian,

Its not a matter of UUID but a matter of security, the android requires security in order to connect, if there isn't any response to the security request, the android central will not establish a connection with the peripheral.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
hello

hello
i followed the tutorial 6 and changed what is needed (using sdk5).
1 problem i encountered is when i build i get 1 error
" .\out_580\sps_device_580.axf: Error: L6218E: Undefined symbol app_advertise_complete (referred from app_task.o). "

is the syntax correct? -> ( .app_on_adv_undirect_complete = app_advertise_complete,)

how come i get "Undefined symbol" for "app_advertise_complete," ?

roi

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

Is there a declaration on an included .h file for the callback that you ve assigned to the app_on_adv_undirect_complete pointer ? Also the callback assigned has to return void and have a uint8_t parameter.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
there is a declaration on the

there is a declaration on the same user_callback_config.h where the ".app_on_adv_undirect_complete = app_advertise_complete, " exists
this is it:

void app_advertise_complete(const uint8_t);

/**
****************************************************************************************
* @brief SPOTAR session start or stop event handler.
* @param[in] spotar_event SPOTAR_START/SPOTAR_STOP
* @return void
****************************************************************************************
*/

however i didnt find any other refference to this function in the project.
its strange because its the sps_device project supplied by dialog.
and in the tutorial on how to add security, it says ti change the callback
from
.app_on_adv_undirect_complete = default_app_on_adv_undirect_complete,

to
.app_on_adv_undirect_complete = app_advertise_complete,

which i did
how come there is no implementation of the "void app_advertise_complete(const uint8_t);" ?
where can i dind it?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

我明白你的意思,我可以告诉isn't any implementation of the app_advertise complete. The DSPS project uses the default_app_on_adv_undirect_complete() function to be executed when the advertising operation finishes. I suppose that the app_advertising_complete is just a placeholder for any alternative user specified function to be executed after finishing the advertising.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
so basicly, i can leave the "

so basicly, i can leave the ".app_on_adv_undirect_complete = default_app_on_adv_undirect_complete," when i implement security according to the Tutorial 6 : Pairing , Bonding & Security
btw what does the dsps default_app_on_adv_undirect_complete do?

tnx
roi

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

Yes you can leave the default callback. In the DSPS example the default_app_on_adv_undirect_complete() doesn't do anything, is just an empty function since the only reason for the DSPS to stop advertising is when he accepts a connection from a central. Other applications, for example an application that changes the advertising string in that callback would restart advertising.

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
ok

ok
i left it like " .app_on_adv_undirect_complete = default_app_on_adv_undirect_complete," and flashed it to the da14580.
now i can see the da advertising but i cant connect to it, i have tried connecting it to my computer and to the lightblue app but on both i am getting a connection error
on the computer i am getting an authentication error (it doesnt pop up a pincode screen) and in the lightblue app it just timesout.
what can be the problem?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

Since you applied security (are you sending from your peripheral a security request to the central ?, i suppose that you do ) if the central does respond to the request the peripheral will time out and drop the connection. If a security response is send from the central perhaps the central doesn't meet the requirements that peripheral sets. If the central sends a pairing request and you dont hava a sniffer to check the whole security procedure, you can check if the security handlers occur, for example, when the pairing request is send from the central the default_app_on_pairing_request() will occur, so try to check that function and if a reponse message is sent from the peripheral. Also you can have a look at the SDK 5.0.4 for a security example (ble_app_security).

Thanks MT_dialog

roinovi
Offline
Last seen:3 years 9 months ago
Joined:2015-11-04 18:11
all i did is opening the dsps

all i did is opening the dsps_device project, and implement security as instructed on Tutorial 6 : Pairing , Bonding & Security.
does it sends a security request to the central?

i implemented security because i am trying to connect my device to an android app using the phones pairing mechanism (the regular procedure that can be found on the settings->bluetooth, just like connecting an earphone)
however it couldnt connect, so i asked in this forum and i was replied that the android cant connect to the device because the android expects a security procedure (unlike the dsps app)
thats why i implemented security

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi roinovi,

Hi roinovi,

是的,如果你跟随本教程设备发送a security request to the central device, in order to indicate that the pairing procedure should be started. But the DSPS can't send this kind of request just by having this kind of definition. The DSPS uses a custom function on the .app_on_connection callback so when connected it doesn't send a security instruction to the central. The default_app_on_connection() does that by using the app_easy_security_request() function. So if you dont have this function you dont send a security indication to the central.

In the DSPS at SDK5 as is, if you just define the CFG_APP_SECURITY in the da1458x_config_basic.h you will be able to pair with the android application since as mentioned above, if you try to connect to your android application (the application that android has) it demands for the other device to have security in order to bond, but will not stay connected, it will just connect for a short period of time in order to pair and disconnect, the android will issue a disconnect command (check my #6 comment).

If you try to connect to a BLE android application like BLE scanner (a generic BLE application) etc, they dont demand security, so your device will have either to explictly say upon connection that it demands security or set a security level to the characteristics and when the central tries to access them it will see that they are protected and start the pairing procedure.

Thanks MT_dialog