CoronaTrackerEsp32

An alternative for the Corona-Warn-App for the ESP32.

Table of contents

Overview

Goal of the project is to create a do it yourself coronatracker and replace the CWA-App on your phone with this device. Advantages of using it is its cheapness and availability, as well as not having to use the app on your phone.

The program mimics the Exposure Notification Protocol by Apple/Google, that is used by CWA. Parts that could not be done on the microcontroller itself are done by our server (mainly Google's Protocol Buffers)

This project is still work in progress and some features are incomplete/not yet implemented.

Hardware

The software should work on most ESP32 boards. Internally we use LILYGO® TTGO ESP32 WiFi + Bluetooth 18650 Battery Protection Board, mainly because of usability of 18650 batteries. We recommend using this board as the software as well as the installation process was tested on it.

Depending on how the pins on your board are configured you may need to change them.

Building your own tracker

All you need to do is follow this tutorial as well as a suitable ESP32 board.

Flashing the ESP32

You can either flash the ESP with our precompiled binaries or use the source code from this repository. There are tutorial for both approaches below.

Using binaries

  1. Download the Flash Download Tools from Espressif.

  2. Download and unzip the latest release binaries. (These are called release_[version].zip)

  3. Unpack the Flash Download Tool and start it.

    1. Select Developer Mode

    2. Select ESP32 DownloadTool

  4. Add the binary files.

    1. First click on the shown button to open file explorer.

    2. Navigate to the downloaded binaries and open the first one. (_a_0x[...].bin)

    3. Repeat these steps until all binaries are added. Select them in alphabetical order. Afterwards it should look like this:

  5. Input the addresses to the corresponding binaries. Those are located after the second _ of the file name and before .bin. For example, the address corresponding to _a_0x1000.bin would be 0x1000.

  6. Check all checkmarks for the added binaries.

  7. If not already connected plug in your ESP32. Make sure the Flash Download Tool has recognized your device. Open the COM drop-down menu and select the available port. (There should only be one port selectable if only one device is connected)

    You can also check this image to see if your settings are correct.

  8. Hold down the Boot button on your ESP and then press the EN button to enter bootloader mode. Let go of both buttons.

  9. Flash your ESP.

    1. Click on Start. The status should now change to Sync.

    2. Now press the Boot button again. The status should change to Download.

    3. When the ESP is successfully flashed the status will show Finish.

  10. Press the EN button. The ESP should restart now and the display will turn on.

  11. You can now setup your ESP.

Using source code

  1. Download and install Visual Studio Code.

  2. Install PlatformIO for VS Code. (Instructions) There may be a prompt to restart VS Code after installing.

  3. Clone or download this project. You can use Download ZIPon the top right of this site. Alternatively the source code can be downloaded here. Unzip it in a suitable directory.

  4. Open the project with PlatformIO.

    1. Open Platform IO Home.

    2. Click on Open Folderand search for the downloaded project.

    3. Open the tracker folder. It might take awhile until the project is fully loaded.

  5. Connect your ESP32 via USB and upload the project. (If you are using our board you have to press the Boot button, when the console reads Connecting...)

    This message should appear at the bottom of the terminal if the upload was successful.

  6. You can now setup your ESP.

Setting up the ESP

  1. After a successful flash the ESP will start an access point called Coronatrackerto set up WiFi. Connect to the AP and open 192.168.4.1. (Depending on the device you might get a notification that there is no connection to the internet) Enter your WiFi credentials and click safe.

    On your phone (or desktop):

    On the device:

    If the WiFi configuration was successful the display says:

    Otherwise it says:

    If the WiFi configuration failed the device starts from the beginning. The tracker also restarts and prints "Wifi-Config: failed!" after a few minutes if the WiFi was not configured.

  2. After the WiFi configuration is done the device needs a few seconds to initialize and afterwards it starts simulating the CWA-App.

Using the tracker

You can press the "Boot" button to activate the display and press it again to deactivate the display. Most of the time the screen shows something like this.

The time is shown as marked.

The action is shown in the second line as marked.

Possible other actions are:

  • Advertise: The tracker announces that it is present.
  • Scan: The tracker searches for present devices.
  • CWA update: The tracker receives an update from the server.

In the third line you can see how many devices the tracker has seen during the last scan. Before the first scan there is a little dash instead of a number.

In the last line you can see your exposure status. The status tells you if a contact with a registered person was detected.

Possible other exposure statuses are:

While the tracker is being updated, the screen is permanently on and remains unchanged until the end of the update.

After the update, the display shows the result and switches back to the previous display after a few seconds. One of the following results are possible.

Known issues