Laptop not connecting with DA14681

9新职位/ 0
Last post
sjdorsay
Offline
Last seen:3 years 11 months ago
加入:2016-09-21 15:50
Laptop not connecting with 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 months 1 hour 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.

由于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 months 1 hour ago
工作人员
加入:2015-06-08 11:34
Hi sjdorsay,

Hi sjdorsay,

I haven't quite understood what you are trying to do (at the beggining i though that you have connected the 68x to the laptop via serial port), or what is that you epxect from the 68x in central mode to do. The laptop that you mention i suppose that is scanning only (acts as central only) and not advertising, the ble_central fw does exactly the same, so there is no chance for those devices to see each other since they are both scanning, even if the laptop is not only scanning but its advertising as well by changing its address doesn't mean that the laptop will advertising with its public addresses, most devices as far as i now they are using random addresses and not their public address. By using the IoT and changing is default address you should be able to connect with the 68x central but as the central is you can only connect and nothing more. Yes its possible to remove the connection requirement, instead of invoking the ble_gap_connect() in the ble_central_task you should invoke the ble_gap_scan_start() in order to start scan and not scanning for a particular address in order to connect. The connection is indicated only by the master and not by the peripheral so you dont have to change anything on the IoT, as long as no one is connected to the IoT the device will keep on advertising.

由于MT_dialog

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

Oh, I needed a way to see if the bluetooth module was transmitting so I tried connecting to my laptop wirelessly while it was connected via serial port but I guess I had the theory wrong.

So I have changed

ble_gap_connect(&addr, &cp);

to

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 months 1 hour 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.

由于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!

Stephen

sjdorsay
Offline
Last seen:3 years 11 months ago
加入:2016-09-21 15:50
Could I email you instead?

Could I email you instead? Would that be faster?

MT_dialog
Offline
Last seen:2 months 1 hour 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.

由于MT_dialog