Go to file
Patrick Rathje a0e6ab4540 WIP 2020-09-13 15:55:41 +02:00
.github/workflows Adapt workflow names to correct urls 2020-08-18 23:32:23 +02:00
boot Upload bootloader and bootloader aware zephyr application together 2020-08-20 20:20:43 +02:00
include/tls_config Init entropy for desktop tests 2020-08-18 22:47:28 +02:00
lib Add platformIO files and adapt file structure 2020-08-18 22:46:49 +02:00
src Add platformIO files and adapt file structure 2020-08-18 22:46:49 +02:00
test Add platformIO files and adapt file structure 2020-08-18 22:46:49 +02:00
zephyr Upload bootloader and bootloader aware zephyr application together 2020-08-20 20:20:43 +02:00
.gitignore Add platformIO files and adapt file structure 2020-08-18 22:46:49 +02:00
.gitmodules WIP 2020-09-13 15:55:41 +02:00
LICENSE Initial commit 2020-06-07 21:45:48 +02:00
README.md WIP 2020-09-13 15:55:41 +02:00
basestation.py initial code release 2020-06-08 11:15:05 +02:00
extra_script.py WIP 2020-09-13 15:55:41 +02:00
platformio.ini Upload bootloader and bootloader aware zephyr application together 2020-08-20 20:20:43 +02:00

README.md

Covid Bracelet, compatibile with Covid Apps on iOS and Android Actions Status: test Actions Status: build

Contributions Welcome!

Features

  • Sends and receives exposure beacons as specified by Google and Apple for Covid Contact Tracing
  • Rolling, encrypted, anonymous beacons
  • Compatible with Apple iOS and Android phones
  • With rolling proximity identifiers and encrypted metadata
  • Proximity identifiers and BLE addresses change every 10 minutes
  • Stores own keys for 14 days
  • Stores contacts of more than 5 minute duration
  • Upon infection upload keys to a public database
  • Retrieve keys of infections from database
    • computes rolling proximity identifiers
    • compares to stored contacts to check for exposure

Builds on on Zephyr OS and NRF52 BLE SOCs. Note: as we for now do not use the flash for key storage, this currently only works on nrf52480 or you can just store a very small number of keys. Moving the keys to flash is on the TODO list and will fix this.

Get Started:

This project is based on platformIO, see: https://platformio.org/platformio-ide

Testing

To run the tests for the desktop environment select the test task for desktop or run:

platformio test -e desktop

Note: this is a proof of concept and not ready for production

Demo Video

Video Demo

Open / Possible next steps

  • firmware of the air updates (signed): done in testing
  • fix entropy: keys are always the same on boot up
  • time sync
  • set device name, user id or so in Flash
  • set scanning interval to the correct value, for now we just use the default
  • set advertisement interval, correct value, for now we just use the default: should be 200-270 milliseconds
  • store long-term contacts in flash
  • set transmit power and store this in the corona beacons
  • get infections from DB, check their signatures
  • extensive logging: crash, reboot, battery level, charging state, contacts, memory useage, flash usage,
  • extensive compatibility testing with Apple iOS and Android devices
  • contininous integration testing
  • Energy efficiency
  • BLE advertisements sets
  • Secure GATT services and authentication of base statation in general
  • More platforms: with display etc.

TODOs Wristband

Possible platforms for real-world deployment many, as many of the cheap fitness trackers base on NRF52 or chips with similar capabilities. However, many would need the firmware to be shipped to manufactures.

  • Watch UI
  • Pine Time could be good for testing

TODOs App and Basestation

  • extend this beyond the simple basestation
  • read keys form national databases

Updates Over the Air

Compiling the Bootloader

The bootloader is responsible to manage the application images.

Make sure that you have installed the correct toolchain

export GNUARMEMB_TOOLCHAIN_PATH="~/Applications/ARM" export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
You might need to install missing python modules

  1. Install west "python3 -m pip install west"
  2. Create temporary directory "mkdir boot && cd boot"
  3. Init west "west init --mr v2.3.0"
  4. Update west "west update"
  5. Update ./bootloader/mcuboot/boot/zephyr/keys.c and update it with custom keys (required for production usage)
  6. Build the bootloader "west build -d build -b nrf52840dk_nrf52840 -s ./bootloader/mcuboot/boot/zephyr" (if you encounter errors, remove the build directory before retrying)

Install packages for signing

~/.platformio/penv/bin/python3 -m pip install cryptography cbor intelhex

TODO:

Check arguments for imgtool signing

  • slot size
  • alignment
  • header size