BluetoothWorld hero image

Bring Your Own Laptop: Bluetooth mesh for developers

Loading

Bring Your Own Laptop: Bluetooth mesh for developers

18-Sep-2018
Developer Session Room 1

This class will start by exploring the concepts, technicalities and uses of Bluetooth mesh networking. Attendees will then be led through a series of practical coding exercises which will provide hands-on experience of implementing the firmware for Bluetooth mesh products.
 
In this session, you will learn:

  • Concepts and terminology a developer needs to know when working with Bluetooth mesh technology
  • How to use the Zephyr SDK to develop firmware for Bluetooth mesh devices
  • About the generic onoff client and server models and their implementation in code
  • About the generic level client and server models and their implementation in code

 

PLEASE READ THE PRE-REQUISITES! YOU WILL NOT BE ABLE TO PARTICIPATE IN THE WORKSHOP WITHOUT THE PRE-REQUISITES!
   

Audience pre-requisites:

This session is best for developers with some experience in network development who plan to or want to start Bluetooth mesh application development


Hardware requirements

1. A laptop running Windows or Linux or a Macbook.

2. A micro:USB cable which can be used with your laptop. i.e. it should have a micro USB plug at one end, for connecting to a BBC micro:bit and whatever USB plug your laptop accepts at the other.

Perhaps like this:

Micro USB

Or with USB type C for your laptop, like this:

USB type C

Development environment

Software

Your laptop needs the following installed on it:

1. The Zephyr SDK. See www.zephyrproject.org/

2. A text editor

  
Setting up the Zephyr SDK

Zephyr can be used in a Windows, Mac OS or Linux environment. Follow the relevant instructions at the Zephyr web site to set up the Zephyr SDK on your machine.

See http://docs.zephyrproject.org/getting_started/getting_started.html

IMPORTANT: you must use version 1.12.0 of the Zephyr SDK. This may not be the latest release but it's what this course is based on. As part of your set up procedure therefore, the full zephyr repository must be cloned and then version 1.12.0 checked out like this:

git clone https://github.com/zephyrproject-rtos/zephyr.git
cd zephyr
git checkout tags/v1.12.0

 

There are choices in how you set up your Zephyr environment and we leave this to you to decide.

  
Checking the Zephyr SDK

cd to the samples\hello_world\ folder inside the folder which contains your zephyr SDK and execute the following commands:

mkdir build
cd build
cmake -GNinja -DBOARD=bbc_microbit ..
ninja

 

If your SDK is installed properly, you should get results very similar to these:

C:\workspaces\zephyr\samples\hello_world>mkdir build
         C:\workspaces\zephyr\samples\hello_world>cd build
         C:\workspaces\zephyr\samples\hello_world\build>cmake -GNinja -DBOARD=bbc_microbit ..
         CMake Deprecation Warning at C:/workspaces/zephyr/cmake/app/boilerplate.cmake:38 (cmake_policy):
The OLD behavior for policy CMP0000 will be removed from a future version
          of CMake.

             The cmake-policies(7) manual explains that the OLD behaviors of all
             policies are deprecated and that a policy should be set to OLD only under
            specific short-term circumstances.  Projects should be ported to the NEW
            behavior and not rely on setting a policy to OLD.

        Call Stack (most recent call first):
           CMakeLists.txt:2 (include)

  

        -- Found PythonInterp: C:/Users/Martin/AppData/Local/Programs/Python/Python35/python.exe (found suitable version "3.5.1", minimum required is 3.4")
        -- Selected BOARD bbc_microbit
        Zephyr version: 1.12.0
        Parsing Kconfig tree in c:/workspaces/zephyr/Kconfig
        Using C:/workspaces/zephyr/boards/arm/bbc_microbit/bbc_microbit_defconfig as base
        Merging C:/workspaces/zephyr/samples/hello_world/prj.conf
       CMake Warning at C:/workspaces/zephyr/cmake/toolchain.cmake:14 (message):
          ZEPHYR_GCC_VARIANT is deprecated, please use ZEPHYR_TOOLCHAIN_VARIANT
          instead
        Call Stack (most recent call first):
          C:/workspaces/zephyr/cmake/app/boilerplate.cmake:242 (include)
          CMakeLists.txt:2 (include)

       

        -- Generating zephyr/include/generated/generated_dts_board.h
        -- Cache files will be written to: C:\Users\Martin\AppData\Local/.cache/zephyr
        -- The C compiler identification is GNU 7.2.1
        -- The CXX compiler identification is GNU 7.2.1
        -- The ASM compiler identification is GNU
        -- Found assembler: C:/gccarmemb/bin/arm-none-eabi-gcc.exe
        -- Performing Test toolchain_is_ok
        -- Performing Test toolchain_is_ok - Success
        -- Configuring done
        -- Generating done
        -- Build files have been written to: C:/workspaces/zephyr/samples/hello_world/build

        C:\workspaces\zephyr\samples\hello_world\build>ninja
        [1/127] Generating always_rebuild
        Building for board bbc_microbit
        [122/127] Linking C executable zephyr\zephyr_prebuilt.elf
        Memory region         Used Size  Region Size  %age Used
                   FLASH:       44476 B       256 KB     16.97%
                    SRAM:        9116 B        16 KB     55.64%
                IDT_LIST:         132 B         2 KB      6.45%
        [127/127] Linking C executable zephyr\zephyr.elf

 


Seating is limited; developer kits are provided on a first-come-first-served basis, and to only those that have installed the necessary applications (see equipment requirements above).
 
Please arrive 5-10 minutes prior to the start of the session to secure your seat.

Speakers
Martin Woolley, Developer Relations Manager, EMEA - Bluetooth SIG