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.

Committer:
krenbluetoothsig
Date:
Wed May 16 03:38:02 2018 +0000
Revision:
7:6512e150f5f6
Parent:
2:d62a2f9a0874
Child:
8:4ed917660ce8
1. Final version before Bluetooth Asia, it supports persistent storage.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
krenbluetoothsig 2:d62a2f9a0874 1 #CONFIG_INIT_STACKS=y
krenbluetoothsig 2:d62a2f9a0874 2 CONFIG_MAIN_STACK_SIZE=512
krenbluetoothsig 2:d62a2f9a0874 3 #CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1280
krenbluetoothsig 2:d62a2f9a0874 4 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
krenbluetoothsig 2:d62a2f9a0874 5 CONFIG_SYS_CLOCK_TICKS_PER_SEC=250
krenbluetoothsig 2:d62a2f9a0874 6 CONFIG_GPIO=y
krenbluetoothsig 2:d62a2f9a0874 7 CONFIG_MICROBIT_DISPLAY=y
krenbluetoothsig 2:d62a2f9a0874 8 CONFIG_PWM=y
krenbluetoothsig 2:d62a2f9a0874 9 CONFIG_PWM_NRF5_SW=y
krenbluetoothsig 2:d62a2f9a0874 10
krenbluetoothsig 2:d62a2f9a0874 11 CONFIG_BT=y
krenbluetoothsig 2:d62a2f9a0874 12 CONFIG_BT_RX_STACK_SIZE=1280
krenbluetoothsig 2:d62a2f9a0874 13 CONFIG_BT_CTLR_DUP_FILTER_LEN=0
krenbluetoothsig 2:d62a2f9a0874 14 CONFIG_BT_OBSERVER=y
krenbluetoothsig 2:d62a2f9a0874 15 CONFIG_BT_BROADCASTER=y
krenbluetoothsig 2:d62a2f9a0874 16
krenbluetoothsig 2:d62a2f9a0874 17 CONFIG_BT_MESH=y
krenbluetoothsig 2:d62a2f9a0874 18 CONFIG_BT_MESH_RELAY=y
krenbluetoothsig 2:d62a2f9a0874 19 CONFIG_BT_MESH_RX_SDU_MAX=36
krenbluetoothsig 2:d62a2f9a0874 20 CONFIG_BT_MESH_SUBNET_COUNT=1
krenbluetoothsig 2:d62a2f9a0874 21 CONFIG_BT_MESH_APP_KEY_COUNT=2
krenbluetoothsig 2:d62a2f9a0874 22 CONFIG_BT_MESH_MODEL_GROUP_COUNT=2
krenbluetoothsig 2:d62a2f9a0874 23 CONFIG_BT_MESH_ADV_BUF_COUNT=10
krenbluetoothsig 2:d62a2f9a0874 24 CONFIG_BT_MESH_PB_ADV=n
krenbluetoothsig 2:d62a2f9a0874 25 CONFIG_BT_MESH_CFG_CLI=y
krenbluetoothsig 2:d62a2f9a0874 26
krenbluetoothsig 7:6512e150f5f6 27 CONFIG_BT_SETTINGS=y
krenbluetoothsig 7:6512e150f5f6 28 CONFIG_FLASH=y
krenbluetoothsig 7:6512e150f5f6 29 CONFIG_FLASH_PAGE_LAYOUT=y
krenbluetoothsig 7:6512e150f5f6 30 CONFIG_FLASH_MAP=y
krenbluetoothsig 7:6512e150f5f6 31 CONFIG_FCB=y
krenbluetoothsig 7:6512e150f5f6 32 CONFIG_SETTINGS=y
krenbluetoothsig 7:6512e150f5f6 33 CONFIG_SETTINGS_FCB=y
krenbluetoothsig 7:6512e150f5f6 34 CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600
krenbluetoothsig 7:6512e150f5f6 35
krenbluetoothsig 7:6512e150f5f6 36 #CONFIG_BT_DEBUG_LOG=y
krenbluetoothsig 7:6512e150f5f6 37 #CONFIG_BT_MESH_DEBUG=y
krenbluetoothsig 7:6512e150f5f6 38 #CONFIG_BT_MESH_DEBUG_SETTINGS=y
krenbluetoothsig 2:d62a2f9a0874 39 #CONFIG_BT_MESH_DEBUG_NET=y
krenbluetoothsig 7:6512e150f5f6 40 #CONFIG_BT_MESH_DEBUG_MODEL=y
krenbluetoothsig 2:d62a2f9a0874 41 #CONFIG_BT_MESH_DEBUG_TRANS=y
krenbluetoothsig 2:d62a2f9a0874 42 #CONFIG_BT_MESH_SELF_TEST=y
krenbluetoothsig 2:d62a2f9a0874 43 #CONFIG_BT_MESH_IV_UPDATE_TEST=y
krenbluetoothsig 2:d62a2f9a0874 44 #CONFIG_BT_MESH_DEBUG_PROV=y
krenbluetoothsig 2:d62a2f9a0874 45 #CONFIG_BT_MESH_DEBUG_BEACON=y
krenbluetoothsig 2:d62a2f9a0874 46 #CONFIG_BT_MESH_DEBUG_CRYPTO=y
krenbluetoothsig 2:d62a2f9a0874 47 #CONFIG_BT_MESH_DEBUG_ADV=y
krenbluetoothsig 2:d62a2f9a0874 48 #CONFIG_BT_MESH_DEBUG_ACCESS=y