Skip to content

Open Badge V3.0

Oren Lederman edited this page Nov 28, 2018 · 36 revisions

Intro

This is the second release of the Open Badge as an Open Source project. In this version, we used an nRF51 module and wrote the code in C using SoftDevice stack (instead of RFduino and Arduino). This allows us better flexibility and gives us access to more features, such as scanning for other devices within range.

Directories

  • eagle/nRF_badge - PCB schematics and layout files in CadSoft EAGLE format
  • firmware/nRF_badge - Firmware. Arduino code
  • src/nRF_server - server/base station code

Compiling the firmware

First, you will need to setup the tool-chain for nRF51:

  • Install the following packages:
    • nRF51 SDK for linux, version 8.X (others versions might not work). Can be found here. Install under /opt/nrf51sdk
    • JLink Software and documentation pack. Can be found here
    • GCC-arm-embedded. Can be found here. Place under /opt/gcc-arm-none-
  • Set NRF_SDK_PATH in you .cshrc, .bashrc or .zshrc. by adding: export NRF_SDK_PATH=/opt/nrf51sdk
  • Set GNU_INSTALL_ROOT in /opt/nrf51sdk/components/toolchain/gcc/Makefile.posix to point to the location GCC-arm (e.g. /opt/gcc-arm-none-<version>/)
  • Add JLinkExe to your shell path. For example ln -s /opt/JLink/JLinkExe /usr/bin/JLinkExe
  • Some more information can be found in this tutorial - http://www.funwithelectronics.com/?id=168

Next, go to the firmware folder (e.g. firmware/nRF_badge/data_collector). Here, you can find a Makefile that can be used for compiling the code and running various badge-related actions. Each command receives a board/option and an action (or actions): make <board> <action(s)> .

Available board definitions:

  • badge_03v4 - compiles the code for the latest layout
  • badge_03v4_noDebug - same as above, with debugging features turned off (no UART message). Useful for production
  • badge_03v4_tester - compiles a tester code for the badge. Useful for testing new badges

Actions:

  • flashUnlock - set flags required to enable erasing/programming of flash (only required for brand new NRF51 chips)
  • flashErase - erase all flash (including softdevice)
  • flashS130 - flash S130 (BLE simultaneous central/peripheral) softdevice"
  • flashAPP - flash the badge firmware (after the softdevice)

For example, make badge_03v4_noDebug flashUnlock flashErase flashS130 flashAPP will compile production code, unlock the badge, erase existing code, and then load SoftDevice 130 and the badge code.

Note - there are additional make commands, most of them are relevant only for earlier revisions of this badge.

Building a programmer

In order to load the code to the badge, you will need a programmer.

See info here - https://github.com/mitmedialab/rhythm-badge-programmer

Badge Hub

Once you finish programming all of your badges, you can use the badge hub to initialize the badges and periodically pull data. For more information: openbadge-hub-py.

Communication protocol

See the Communication-protocol page