Skip to content

FlapKap/Terra

 
 

Repository files navigation

License

NebulaStream End Device Runtime

An implementation of NebulaStream End Device Runtime in C

How to Build

The project is written as a RIOT OS application and uses the RIOT build system. Building requires a copy of the RIOT codebase either locally (linux only), in a docker container or on a virtual machine/WSL.

The rest assumes you compile locally.

To build the binary you must set the following variables in the Makefile

  • RIOTBASE The path to you RIOT code base
  • BOARD The specific board that riot should build for. List of boards supported by RIOT. By default this is set to native which will build the executable for linux.

Depending on the functionality you want there are also several other variables to set.

  • EXECUTION_INTERVAL_S: the timeperiod between queries executing

  • DISABLE_LORA: Set to 1 to disable LoRa. This changes the network logic, see "Run without LoRa"

  • LORA_REGION: The region in which the device is run. can be AS923, AU915, CN470, CN779, EU433, KR920, IN865, US915, RU864,US915_HYBRID and EU866(default)

  • DEVEUI, APPEUI and APPKEY: Settings for your specific LoRaWAN connection

    Note: When compiling with native as the target board LoRaWAN is disabled

  • MAIN_STACKSIZE: Size of the stack for the main thread. Increase this if you experience issues with segmentation faults

  • APPLICATION_BUILD_OPTIMIZED: set to 1 to build a release version

  • APPLICATION_RUN_TEST: set to 1 to run tests instead of normal program execution

To build the application, flash to a device, and open a terminal to the flashed device, run:

$ make flash term

If you wish to flash using an alternative programming tool than the default for your board, this can be done by setting the PROGRAMMER macro. For instance, to flash to the Nucleo-WL55JC using the cpy2remed (copy to removable media) script, use:

$ make BOARD=nucleo-wl55jc PROGRAMMER=cpy2remed flash

For more information see documentation on The riot build system.

LoRaWAN

The application can connect to The Things Network (TTN) over LoRaWAN. The following steps are required to set this up:

  • Login to TTN and open console.
  • Create a new application.
  • Register an end device.
  • Note the DEVEUI, JOINEUI (APPEUI) and APPKEY.
  • Enter those values in the corresponding makefile macros

Run without LoRa

For tests or experiments it might be useful to disable the LoRaWAN code. This enables the program to run on devices without LoRa support such as native. Instead of normal LoRaWAN network communication, the program executes using a compile-time defined protobuf query. As such the program can be run completely headlessly. The query is defined as a C initilialiser list of bytes/uint8's. By default it's set to {0xa,0x12,0xa,0x10,0xa,0xe,0xa,0x2,0x8,0x0,0xa,0x2,0x10,0x8,0xa,0x2,0x8,0xa,0x10,0x1,} which corresponds to the message:

{
    "queries": [
        {
            "operations": [
                {
                    "map": {
                        "function": [{"instruction","CONST"}, {"_uint8": 8}, {"instruction": "MUL"}],
                        "attribute": 1,
                    }
                }
            ]
        }
    ]
}

The C array can be generated by the prototest.py code in the proto/ folder

Contributors

Laurits Bonde & Markus Johansen for their Bachelor Thesis @ ITU. This project is a fork of and continuation of their initial port

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 82.8%
  • Python 10.8%
  • Makefile 3.6%
  • C++ 2.7%
  • Shell 0.1%