Publishing for Bluetooth Asia 2018 developer session: mesh session. This repo is for GenericOnOff client side firmware.
EULA
PLEASE READ MESH_DEMO_TUTORIAL_EULA.TXT BEFORE START DEVELOPMENT.
Overview
This sample demonstrates Bluetooth Mesh functionality on micro:bit. It doesn't need provisioning because all the credential material (DevKey, NetKey, AppKey, Key Index, IVI and Unicast address) is pre-configured. This sample work as a GenericOnOff client:
- Pressing Button A on micro:bit will send GenericOnOffSet access message with on or off state alternatively and specific group address;
- Pressing Button B on micro:bit will switch the group address from 0xC000 to 0xC003 and back to 0xC000 again like round robin;
Requirements
micro:bit board
Building and Running
0. Download source code, it's zip file, the link is on this page, Download repository
.
1. Following below link to set the development environment up on your Windows computer. http://docs.zephyrproject.org/getting_started/installation_win.html . Please make sure git checkout this commit, commit: 88dfd399f480b1593a8e13f5a68d512921a55502 , the detail is here, https://github.com/zephyrproject-rtos/zephyr/commit/88dfd399f480b1593a8e13f5a68d512921a55502
2. copy zip file into ./zephyr/sample/
in the Zephyr tree.
3. unzip the file by "Extract Here".
3. access into the extracted folder and rename prj_bbc_microbit.txt
to prj_bbc_microbit.conf
4. if adopting Windows Command Prompt, use it to access into the unzip folder and type following commands on the console:
mkdir build & cd build
cmake -GNinja -DBOARD=bbc_microbit ..
ninja
if adopting MSYS2, use it to access into the unzip folder and type following commands on the console:
mkdir build & cd build
cmake -GNinja -DBOARD=bbc_microbit ..
ninja
5. connect micro:bit with your computer by USB cable, the board will be enumerated as a massive storage device;
6. drag the hex file (which is in ./zephyr/sample/[unzip folder]/build/zephyr/zephyr.hex
) into
Microbit massive storage device to flash the firmware;
7. micro:bit is ready to work as a GenericOnOff client.
README.txt@3:608b3e14dd31, 2018-05-02 (annotated)
- Committer:
- krenbluetoothsig
- Date:
- Wed May 02 10:46:46 2018 +0000
- Revision:
- 3:608b3e14dd31
- Parent:
- 1:fb4893064dd4
- Child:
- 4:72457391f1b9
add something in README
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
krenbluetoothsig | 3:608b3e14dd31 | 1 | ############### |
krenbluetoothsig | 3:608b3e14dd31 | 2 | |
krenbluetoothsig | 3:608b3e14dd31 | 3 | EULA |
krenbluetoothsig | 3:608b3e14dd31 | 4 | ******** |
krenbluetoothsig | 3:608b3e14dd31 | 5 | PLEASE READ EULA.TXT BEFORE START DEVELOPMENT. |
krenbluetoothsig | 3:608b3e14dd31 | 6 | |
krenbluetoothsig | 3:608b3e14dd31 | 7 | |
krenbluetoothsig | 3:608b3e14dd31 | 8 | Overview |
krenbluetoothsig | 3:608b3e14dd31 | 9 | ******** |
krenbluetoothsig | 3:608b3e14dd31 | 10 | This sample demonstrates Bluetooth Mesh functionality on micro:bit. It doesn't need provisioning |
krenbluetoothsig | 3:608b3e14dd31 | 11 | because all the credential material (DevKey, NetKey, AppKey, Key Index, IVI |
krenbluetoothsig | 3:608b3e14dd31 | 12 | and Unicast address) is pre-configured. |
krenbluetoothsig | 3:608b3e14dd31 | 13 | This sample work as a GenericOnOff client: |
krenbluetoothsig | 3:608b3e14dd31 | 14 | * Pressing Button A on micro:bit will send GenericOnOffSet access message with on or off state alternatively and |
krenbluetoothsig | 3:608b3e14dd31 | 15 | specific group address; |
krenbluetoothsig | 3:608b3e14dd31 | 16 | * Pressing Button B on micro:bit will switch the group address from 0xC000 to 0xC003 and back to |
krenbluetoothsig | 3:608b3e14dd31 | 17 | 0xC000 again like round robin; |
krenbluetoothsig | 3:608b3e14dd31 | 18 | |
krenbluetoothsig | 3:608b3e14dd31 | 19 | Requirements |
krenbluetoothsig | 3:608b3e14dd31 | 20 | ************ |
krenbluetoothsig | 3:608b3e14dd31 | 21 | micro:bit board |
krenbluetoothsig | 0:876e59f87d50 | 22 | |
krenbluetoothsig | 3:608b3e14dd31 | 23 | Building and Running |
krenbluetoothsig | 3:608b3e14dd31 | 24 | ******************** |
krenbluetoothsig | 3:608b3e14dd31 | 25 | 1. Following below link to set the development environment up on your Windows computer. |
krenbluetoothsig | 3:608b3e14dd31 | 26 | http://docs.zephyrproject.org/getting_started/installation_win.html |
krenbluetoothsig | 3:608b3e14dd31 | 27 | |
krenbluetoothsig | 3:608b3e14dd31 | 28 | 2. copy zip file into './zephyr/sample/' in the Zephyr tree. |
krenbluetoothsig | 3:608b3e14dd31 | 29 | |
krenbluetoothsig | 3:608b3e14dd31 | 30 | 3. unzip the file and perform "exact here" |
krenbluetoothsig | 3:608b3e14dd31 | 31 | |
krenbluetoothsig | 3:608b3e14dd31 | 32 | 3. type following commands on your Zephyr console if using Windows Command Prompt |
krenbluetoothsig | 3:608b3e14dd31 | 33 | " |
krenbluetoothsig | 3:608b3e14dd31 | 34 | cd %ZEPHYR_BASE%\samples\ |
krenbluetoothsig | 3:608b3e14dd31 | 35 | mkdir build & cd build |
krenbluetoothsig | 3:608b3e14dd31 | 36 | cmake -GNinja -DBOARD=bbc_microbit .. |
krenbluetoothsig | 3:608b3e14dd31 | 37 | ninja |
krenbluetoothsig | 3:608b3e14dd31 | 38 | " |
krenbluetoothsig | 3:608b3e14dd31 | 39 | |
krenbluetoothsig | 3:608b3e14dd31 | 40 | or type following commands on your Zephyr console if using MSYS2 |
krenbluetoothsig | 3:608b3e14dd31 | 41 | cd %ZEPHYR_BASE%\samples\hello_world |
krenbluetoothsig | 3:608b3e14dd31 | 42 | mkdir build & cd build |
krenbluetoothsig | 3:608b3e14dd31 | 43 | |
krenbluetoothsig | 3:608b3e14dd31 | 44 | # Use cmake to configure a Ninja-based build system: |
krenbluetoothsig | 3:608b3e14dd31 | 45 | cmake -GNinja -DBOARD=nrf52_pca10040 .. |
krenbluetoothsig | 3:608b3e14dd31 | 46 | |
krenbluetoothsig | 3:608b3e14dd31 | 47 | # Now run ninja on the generated build system: |
krenbluetoothsig | 3:608b3e14dd31 | 48 | ninja |
krenbluetoothsig | 1:fb4893064dd4 | 49 | |
krenbluetoothsig | 0:876e59f87d50 | 50 | .. _ble_mesh: |
krenbluetoothsig | 0:876e59f87d50 | 51 | |
krenbluetoothsig | 0:876e59f87d50 | 52 | Bluetooth: Mesh |
krenbluetoothsig | 0:876e59f87d50 | 53 | |
krenbluetoothsig | 0:876e59f87d50 | 54 | |
krenbluetoothsig | 0:876e59f87d50 | 55 | |
krenbluetoothsig | 0:876e59f87d50 | 56 | |
krenbluetoothsig | 0:876e59f87d50 | 57 | * A board with Bluetooth LE support, or |
krenbluetoothsig | 0:876e59f87d50 | 58 | * QEMU with BlueZ running on the host |
krenbluetoothsig | 0:876e59f87d50 | 59 | |
krenbluetoothsig | 0:876e59f87d50 | 60 | |
krenbluetoothsig | 0:876e59f87d50 | 61 | |
krenbluetoothsig | 0:876e59f87d50 | 62 | See :ref:`bluetooth setup section <bluetooth_setup>` for details on how |
krenbluetoothsig | 0:876e59f87d50 | 63 | to run the sample inside QEMU. |
krenbluetoothsig | 0:876e59f87d50 | 64 | |
krenbluetoothsig | 0:876e59f87d50 | 65 | For other boards, build and flash the application as follows: |
krenbluetoothsig | 0:876e59f87d50 | 66 | |
krenbluetoothsig | 0:876e59f87d50 | 67 | .. zephyr-app-commands:: |
krenbluetoothsig | 0:876e59f87d50 | 68 | :zephyr-app: samples/bluetooth/mesh |
krenbluetoothsig | 0:876e59f87d50 | 69 | :board: <board> |
krenbluetoothsig | 0:876e59f87d50 | 70 | :goals: flash |
krenbluetoothsig | 0:876e59f87d50 | 71 | :compact: |
krenbluetoothsig | 0:876e59f87d50 | 72 | |
krenbluetoothsig | 0:876e59f87d50 | 73 | Refer to your :ref:`board's documentation <boards>` for alternative |
krenbluetoothsig | 0:876e59f87d50 | 74 | flash instructions if your board doesn't support the ``flash`` target. |