This tutorial explains how to use the example application blehci
included in the NimBLE stack to talk to the Mynewt NimBLE controller viathe Host Controller Interface. You may build the Mynewt image using alaptop running any OS of your choice - Mac, Linux, or Windows.
Enter the serial number from your product in the text box located in the Quick Search tab. The serial number is found on the back or bottom of your HPE product, and will be in a format such as USE646N6FJ, 2UA73310K5 or CNU6080B8C.
The host used in this specific example is the BlueZ Bluetooth stack.Since BlueZ is a Bluetooth stack for Linux kernel-based family ofoperating system, the tutorial expects a computer running Linux OS andwith BlueZ installed to talk to the board with the Mynewt image.
HP Care Pack Central allows you to quickly and easily identify Care Pack Services for your HP products. Validate the VIN / HIN number here to ensure details and documentation of the boat are valid! Phone: 865-590-9090 Fax: 928-441-0580 Email: contact@myboatpro.com.
Ensure that you meet the following prerequisites before continuing withone of the tutorials.
Have Internet connectivity to fetch remote Mynewt components.
Have a board with BLE radio that is supported by Mynewt. We will usean nRF52 Dev board in this tutorial.
Have a USB TTL Serial Cable that supports hardware flow control suchas ones found athttp://www.ftdichip.com/Products/Cables/USBTTLSerial.htm to establisha serial USB connection between the board and the laptop.
Install the newt tool and toolchains (See BasicSetup).
Install a BLE host such as BlueZ on a Linux machine to talk to thenRF52 board running Mynewt. Use
sudoapt-getinstallbluez
toinstall it on your Linux machine.
Nimble Serial Number
Use the newt tool to create a new project directory containing askeletal Mynewt framework. Change into the newly created directory.
You will create two targets - one for the bootloader, the other for theapplication. Then you will add the definitions for them. Note that youare using the example app blehci
for the application target. Set thebsp to nordic_pca10040.
NOTE: The preview version, nRF52PDK, is no longer supported. If youdo not see PCA100040 on the top of your board, you have a previewversion of the board and will need to upgrade your developer boardbefore continuing.
Check that the targets are defined correctly.
Then build the two targets.
Generate a signed application image for the myble2
target. Theversion number is arbitrary.
Make sure the USB connector is in place and the power LED on the boardis lit. Use the Power ON/OFF switch to reset the board after loading theimage.
Find Hpe Nimble Serial Number
Load the bootloader:
Load the application image:
Attach a serial port to your board by connecting the USB TTL SerialCable. This should create /dev/ttyUSB0 (or similar) on your machine.
Note Certain Linux OS versions have been observed to detect thenrf52 board as a mass storage device and the console access doesn’t workproperly. In that case try powering the nrf52 board from your monitor orsomething other than your Linux computer/laptop when you set up theserial port for HCI communication.
btmon
is a BlueZ test tool to display all HCI commands and events ina human readable format. Start the btmon tool in a terminal window.
In a different terminal, attach the blehci device to the BlueZ daemon(substitute the correct /dev filename for ttyUSB0).
The baud rate used to connect to the controller may be changed byoverriding the default value of 1000000 in thenet/nimble/transport/uart/syscfg.yml
. Settings in the serialtransport syscfg.yml
file can be overridden by a higher prioritypackage such as the application. So, for example, you may set theBLE_HCI_UART_BAUD
to a different value inapps/blehci/syscfg.yml
.
If there is no CTS/RTS lines present in the test environment, flowcontrol should be turned off. This can be done with -N option forbtattach. Note: -N option came with BlueZ ver 5.44.Also, modify the value of BLE_HCI_UART_FLOW_CTRL
in thenimble/transport/uart/syscfg.yml
to HAL_UART_FLOW_CTL_NONE
.
In a third terminal, start btmgmt. This tool allows you to send commandsto the blehci controller. Use the index number that shows up when youbtattach
in the previous step.
Set your device address (you can substitute any static random addresshere).
Initialize the controller.
Serial Number Lookup
Begin scanning.
Comments are closed.