笔记本电脑不与DA14681连接

9 posts / 0 new
Last post
sjdorsay
Offline
Last seen: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_dialog.
Offline
Last seen:2个月5天前
工作人员
加入: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.

谢谢mt_dialog.

sjdorsay
Offline
Last seen: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_dialog.
Offline
Last seen:2个月5天前
工作人员
加入:2015-06-08 11:34
Hi sjdorsay,

Hi sjdorsay,

我还不太清楚你想要做什么(在Begring I,虽然你通过串行端口将68x连接到笔记本电脑),或者你在中央模式中的68倍epxect是什么。你提到的笔记本电脑认为这只是扫描(仅作为中央的行为)而不是广告,BLE_Central FW完全相同,因此这些设备没有机会彼此看到,因为它们都扫描,即使是扫描笔记本电脑不仅扫描,而且还通过改变其地址的广告并不意味着笔记本电脑将与其公共地址,大多数设备宣传,据我现在正在使用随机地址而不是他们的公共地址。通过使用物联网和更改是默认的地址,您应该能够与68x中心连接,但作为中央的中心,您只能连接,也不是更多。是的,可以删除连接要求,而不是调用BLE_Central_Task中的BLE_GAP_CONNECT(),而您应该调用BLE_GAP_SCAN_START()以启动扫描,而不是扫描特定地址以便连接。连接仅由主站表示,而不是由外围设备表示,因此您不必在IOT上更改任何内容,只要没有人连接到设备即可继续广告。

谢谢mt_dialog.

sjdorsay
Offline
Last seen:3 years 11 months ago
加入:2016-09-21 15:50
Oh, I needed a way to see if

哦,我需要一种方法来看看蓝牙模块是否正在传输,因此我试图通过串口连接的无线连接我的笔记本电脑,但我想我有错误。

So I have changed

ble_gap_connect(&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_dialog.
Offline
Last seen:2个月5天前
工作人员
加入: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.

谢谢mt_dialog.

sjdorsay
Offline
Last seen: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
Last seen:3 years 11 months ago
加入:2016-09-21 15:50
我可以给你发电子邮件吗?

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

mt_dialog.
Offline
Last seen:2个月5天前
工作人员
加入: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.

谢谢mt_dialog.