笔记本电脑未连接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\u对话框
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.

谢谢你的对话

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

Hi sjdorsay,

我还不太明白你想做什么(虽然你已经通过串口把68x连接到笔记本电脑上),或者你在中央模式下从68x执行什么操作。你提到的笔记本电脑我想是只扫描(只作为中央)而不是广告,bleèu central fw做的完全一样,所以这些设备没有机会看到对方,因为它们都在扫描,即使笔记本电脑不仅是扫描,而且它的广告以及改变其地址并不意味着笔记本电脑将广告与它的公共地址,大多数设备,因为我现在他们使用的是随机地址,而不是他们的公共地址。通过使用IoT并更改默认地址,您应该能够连接68x central,但由于central是,因此您只能连接,仅此而已。是的,可以删除连接要求,而不是在ble\u central\u任务中调用ble\u gap\u connect(),您应该调用ble\u gap\u scan\u start()以启动扫描,而不是扫描特定地址以进行连接。连接仅由主设备指示,不由外围设备指示,因此您不必更改物联网上的任何内容,只要没有人连接到物联网,设备将继续进行广告宣传。

谢谢你的对话

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\ U gap\ U connect(地址和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
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.

谢谢你的对话

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
Could I email you instead?

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

MT\u对话框
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.

谢谢你的对话