Zephyr Quick Start

Hubble Network can be added to the manifest of an existing Zephyr project or function as the manifest repository. The following sections describe each approach.

Adding Hubble Network to Zephyr

This procedure explains how to add Hubble Network to an existing Zephyr project or to start a new project with Zephyr as the manifest repository. For new projects, refer to the Zephyr Getting Started Guide to set up the environment.

After creating or selecting a Zephyr project, integrate Hubble Network by pulling the SDK into the Zephyr workspace. Adjust a West sub-manifest (or create a new one) by including the snippet below:

manifest:
  remotes:
    - name: hubble
      url-base: https://github.com/HubbleNetwork
  projects:
    - name: hubblenetwork-sdk
      repo-path: hubble-device-sdk
      revision: main
      path: modules/lib/hubblenetwork-sdk
      remote: hubble
      groups:
        - optional

Then run:

west update hubblenetwork-sdk

If you are building a Satellite Network application for a Nordic board, fetch the prebuilt radio support libraries declared as Zephyr module blobs:

west blobs fetch hubblenetwork-sdk

Run this command from a Zephyr west workspace that includes the Hubble Network SDK module. The downloaded blobs are placed under the module’s zephyr/blobs directory and are linked automatically when CONFIG_HUBBLE_SAT_NETWORK is enabled for supported Nordic boards.

To enable the required modules, add the corresponding lines to the project’s prj.conf file:

CONFIG_HUBBLE_BLE_NETWORK=y
CONFIG_HUBBLE_SAT_NETWORK=y

Use CONFIG_HUBBLE_BLE_NETWORK=y to enable the Bluetooth® Low Energy (BLE) Network module or CONFIG_HUBBLE_SAT_NETWORK=y for the Satellite Network module.

Using Hubble Network as the manifest repository

Hubble Network can also serve as the manifest repository, pulling its own workspace. Choose the setup that matches your target.

Upstream Zephyr

Install West and all required Zephyr dependencies as described in the Zephyr documentation. The following steps outline the process of creating a Zephyr workspace that uses the Hubble Network SDK as the manifest repository:

  1. Create a Python virtual environment:

    python3 -m venv ~/hubblenetwork-workspace/.venv
    
  2. Activate the virtual environment:

    source ~/hubblenetwork-workspace/.venv/bin/activate
    

    Once activated your shell will be prefixed with (.venv). Deactivate at any time by running deactivate. Re-activation is necessary whenever returning to work in this environment.

  3. Install west:

    pip install west
    
  4. Obtain the Zephyr source code:

    west init -m git@github.com:HubbleNetwork/hubble-device-sdk.git ~/hubblenetwork-workspace
    cd ~/hubblenetwork-workspace/modules/lib/hubblenetwork-sdk
    west update
    
  5. Export a Zephyr:

    west zephyr-export
    

    Exports a Zephyr CMake package, allowing CMake to automatically load the boilerplate code needed for building Zephyr applications.

  6. Install Python dependencies:

    west packages pip --install
    pip install -r ~/hubblenetwork-workspace/zephyr/scripts/requirements.txt
    

nRF Connect SDK (NCS)

The nRF Connect SDK (NCS) is Nordic Semiconductor’s Zephyr-based distribution. The setup mirrors the upstream Zephyr steps above, with the differences below.

Note

Adding Hubble Network as a module to an existing NCS application is identical to the Adding Hubble Network to Zephyr step, only the manifest and toolchain differ.

  1. Install the nRF Connect SDK toolchain

  2. Initialize the workspace with the bundled west-ncs.yml manifest, which imports sdk-nrf instead of upstream Zephyr:

    west init -m git@github.com:HubbleNetwork/hubble-device-sdk.git \
        --mf west-ncs.yml ~/hubblenetwork-workspace
    cd ~/hubblenetwork-workspace
    west update
    

The Python virtual environment, west zephyr-export, Python dependencies, and blob fetching are otherwise identical to the upstream Zephyr steps.

Building and running your first application

Once the workspace is set up using either approach above, the system is ready to use Hubble Network. The following commands demonstrate how to build and flash a BLE Network application.

Build the application

cd ~/hubblenetwork-workspace/
west build -p -b nrf52840dk/nrf52840 modules/lib/hubblenetwork-sdk/samples/zephyr/ble-network

Flash the application

west flash