Publishing for Bluetooth Asia 2018 developer session: mesh session. This repo is for GenericOnOff server side firmware.

EULA

PLEASE READ MESH_DEMO_TUTORIAL_EULA.TXT BEFORE START DEVELOPMENT.

Overview

This sample demonstrates Bluetooth Mesh functionality on micro:bit, www.microbit.org. 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 server:

  • Pressing Button B on micro:bit will subscribe to 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: 60b01f3f5489975098657caa514133c89a472d19 , the detail is here, https://github.com/zephyrproject-rtos/zephyr/commit/60b01f3f5489975098657caa514133c89a472d19

2. copy zip file into ./zephyr/samples/ 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 server.

Files at this revision

API Documentation at this revision

Comitter:
krenbluetoothsig
Date:
Wed May 16 03:43:25 2018 +0000
Parent:
3:9259d5a8a3f2
Commit message:
1. final version before Bluetooth Asia 2018.

Changed in this revision

README.txt Show annotated file Show diff for this revision Revisions of this file
prj_bbc_microbit.txt Show annotated file Show diff for this revision Revisions of this file
src/main.c Show annotated file Show diff for this revision Revisions of this file
diff -r 9259d5a8a3f2 -r a52949a1cf72 README.txt
--- a/README.txt	Mon May 07 23:58:09 2018 +0000
+++ b/README.txt	Wed May 16 03:43:25 2018 +0000
@@ -1,60 +1,42 @@
-
-**
 EULA
-**
-
-PLEASE READ EULA.TXT BEFORE START DEVELOPMENT. 
-
-**
-Overview
-**
+PLEASE READ MESH_DEMO_TUTORIAL_EULA.TXT BEFORE START DEVELOPMENT.
 
-This sample demonstrates Bluetooth Mesh functionality on micro:bit, www.microbit.org. 
-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 server:
-* Pressing Button B on micro:bit will subscribe to the group address from 0xC000 to 0xC003 and back to 
-  0xC000 again like round robin; 
+Overview
+This sample demonstrates Bluetooth Mesh functionality on micro:bit, www.microbit.org. 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 server:
 
-**
+Pressing Button B on micro:bit will subscribe to 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 
+1. Following below link to set the development environment up on your Windows computer. http://docs.zephyrproject.org/getting_started/installation_win.html
 
-2. copy zip file into './zephyr/sample/' in the Zephyr tree. 
+2. copy zip file into ./zephyr/samples/ in the Zephyr tree.
 
-3. unzip the file by "Extract Here". 
+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:
+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
 
-     mkdir build & cd build
-     cmake -GNinja -DBOARD=bbc_microbit ..
-     ninja
+cmake -GNinja -DBOARD=bbc_microbit ..
 
+ninja
 
-   if adopting MSYS2, use it to access into the unzip folder and type following commands
-   on the console:
+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
+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;
+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 server. 
+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 server.
\ No newline at end of file
diff -r 9259d5a8a3f2 -r a52949a1cf72 prj_bbc_microbit.txt
--- a/prj_bbc_microbit.txt	Mon May 07 23:58:09 2018 +0000
+++ b/prj_bbc_microbit.txt	Wed May 16 03:43:25 2018 +0000
@@ -17,6 +17,8 @@
 CONFIG_BT_BROADCASTER=y
 CONFIG_BT_PRIVACY=n
 
+CONFIG_BT_MESH_DEBUG_USE_ID_ADDR=y
+
 CONFIG_BT_MESH=y
 CONFIG_BT_MESH_RELAY=y
 CONFIG_BT_MESH_RX_SDU_MAX=36
diff -r 9259d5a8a3f2 -r a52949a1cf72 src/main.c
--- a/src/main.c	Mon May 07 23:58:09 2018 +0000
+++ b/src/main.c	Wed May 16 03:43:25 2018 +0000
@@ -421,13 +421,14 @@
 }
 
 static struct bt_mesh_cfg_srv cfg_srv = {
-#if defined(CONFIG_BOARD_BBC_MICROBIT)
-    .relay = BT_MESH_RELAY_ENABLED,
+//#if defined(CONFIG_BOARD_BBC_MICROBIT)
+//  .relay = BT_MESH_RELAY_ENABLED,
+//  //.relay = BT_MESH_RELAY_DISABLED,
+//  .beacon = BT_MESH_BEACON_DISABLED,
+//#else
+    .relay = BT_MESH_RELAY_DISABLED,
     .beacon = BT_MESH_BEACON_DISABLED,
-#else
-    .relay = BT_MESH_RELAY_ENABLED,
-    .beacon = BT_MESH_BEACON_ENABLED,
-#endif
+//#endif
     .frnd = BT_MESH_FRIEND_NOT_SUPPORTED,
     .default_ttl = 7,