笔记本电脑未连接DA14681

9个职位/0个新职位
Last post
sjdorsay
Offline
最后一次见到:3 years 11 months ago
加入:2016-09-21 15:50
笔记本电脑未连接DA14681

Hi

So I have built and programmed my DA14681 dev. kit with the ble_central example project but nothing shows up on my terminal and when I go to scan devices nothing shows up. Also, when I turn my DA14583 IoT dongles on still nothing shows up on the terminal. My settings are: Serial, 115200, No handshake, 8 bits, 1 stop bit, no parity control, and the lower COM port (in this case COM3). Am I doing something wrong? I want to be able to log the data that the IoT dongle is sending into a file.

Device:
MT\u对话框
Offline
最后一次见到:1 month 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi sjdorsay,

Hi sjdorsay,

The ble_central example has a default bd address that is instructed to connect to, you can change this default bd address in defaultBLE_STATIC_ADDRESS in the ble_config.h file the existing value of the address is 0x80 0xEA 0xCA 0x00 0x00 0x01. If the central doesn't find this address it will not connect to it. Regarding the fact that you would like to log data from the IoT just be aware that you need to implement a proper discovery from the central side and then you will have to set the configurations that the IoT android application sets in order for the IoT to start send data and also you need additional implementation for the central to start logging that data.

谢谢你的对话

sjdorsay
Offline
最后一次见到:3 years 11 months ago
加入:2016-09-21 15:50
I have changed the default

我改变了默认的地址to the BT address of my laptop and still no connection. I'm starting to think that it may not support Bluetooth Smart. Would I just have to set the default address in the central to that of the IoT dongle? I'm a bit new to the whole using an API and Bluetooth so I may ask some seemingly obvious questions. Is it possible to remove the requirement for a connection; is it possible to put the IoT in broadcasting and the da14681 in observing mode so I don't have to deal with the authentication?

MT\u对话框
Offline
最后一次见到:1 month 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi sjdorsay,

Hi sjdorsay,

我还不太明白你想做什么(在乞讨我,虽然你已经通过串行端口将68x连接到笔记本电脑),或者你从68x在中央模式下执行什么。我想你提到的笔记本电脑只是扫描(仅起到中心作用)而不是广告,ble炣central fw的功能完全相同,因此这些设备没有机会相互看到,因为它们都在扫描,即使笔记本电脑不仅扫描,而且通过改变地址进行广告,也不意味着笔记本电脑将用其公共地址进行广告,目前为止,大多数设备都使用随机地址,而不是公共地址。通过使用IoT和Change是默认地址,您应该能够连接68x central,但由于中心是,您只能连接,而不能再连接。是的,可以删除连接要求,而不是调用ble\u central_u任务中的ble gap_connect(),您应该调用ble gap\u scan_ustart(),以便开始扫描,而不是扫描特定地址以连接。连接仅由主设备指示,而不是由外围设备指示,因此您不必更改物联网上的任何内容,只要没有人连接到物联网,设备将继续进行广告。

谢谢你的对话

sjdorsay
Offline
最后一次见到:3 years 11 months ago
加入:2016-09-21 15:50
Oh, I needed a way to see if

哦,我需要一种方法来看看蓝牙模块是否正在传输,所以我尝试通过串行端口连接到笔记本电脑时,它是无线连接的,但我想我的理论是错误的。

So I have changed

b\u gap连接(&addr,&cp);

ble_gap_scan_start(GAP_SCAN_PASSIVE, GAP_SCAN_GEN_DISC_MODE, BLE_SCAN_INTERVAL_FROM_MS(0.625), BLE_SCAN_WINDOW_FROM_MS(20), false, false);

in the ble_central_task file but still none of the printf statements from the event handlers are showing on my terminal. What might be the problem? Currently I have the terminal set to Serial, 115200 Baud, 8 data bits, 1 stop bit, no handshaking and the lower COM port as displayed in the device manager (i.e. COM6 of COM6 and COM7). It appears to be connecting because when I open the SmartBond app the dongle is no longer seen until I reset it.

MT\u对话框
Offline
最后一次见到:1 month 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi sjdorsay,

Hi sjdorsay,

The functionality of the ble_central is not to track advertising messages, and print it on the terminal, the default function is to connect to a peripheral device with a specific bd address and print some information regarding the connected peripheral. If you just change the ble_gap_connect() to ble_gap_scan_start() yes its will start scanning but it doesn't mean that will start printing out all the available devices that can scan over the air. In order to do that you will have to set a printing function when your device finds an advertising string, that means that you will have to catch an BLE_EVT_GAP_ADV_REPORT message (the message that the BLE sends when an advertising string has been captured during the scan procedure) and then print the informations that you would like.

谢谢你的对话

sjdorsay
Offline
最后一次见到:3 years 11 months ago
加入:2016-09-21 15:50
Okay, I just saw printf

Okay, I just saw printf statements in each of the handlers so I thought it would print some sort of information that I don't directly care about. It sounds like I will have to do more than just type printf("whatever I want");. When the report message is caught what procedure should I follow to print the message on the terminal?

Thank you!

史蒂芬

sjdorsay
Offline
最后一次见到:3 years 11 months ago
加入:2016-09-21 15:50
Could I email you instead?

我可以改电子邮件给你吗?那会更快吗?

MT\u对话框
Offline
最后一次见到:1 month 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi sjdorsay,

Hi sjdorsay,

I would suggest to have a closer look at the examples since they are quite a few projects that implement printing functionalities, take your time exploring the code. When a message is caught in the main_task of your application (at the case of the central the ble_central_task) the switch function will handle it and invoke the custom function that you should create, also there is the hdr parameter that hold the information of the message just arrived, and every invoked function is casting this parameter in their corresponding struct. In the case of a scan you will have to cast the hdr in a ble_evt_gap_adv_report_t struct and in there you will have the reported device. Also i am sorry but mailing is out of the question.

谢谢你的对话