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
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. In this case, 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:
Create a Python virtual environment:
python3 -m venv ~/hubblenetwork-workspace/.venvActivate the virtual environment:
source ~/hubblenetwork-workspace/.venv/bin/activateOnce activated your shell will be prefixed with
(.venv). Deactivate at any time by runningdeactivate. Re-activation is necessary whenever returning to work in this environment.Install west:
pip install westObtain 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 updateExport a Zephyr:
west zephyr-exportExports a Zephyr CMake package, allowing CMake to automatically load the boilerplate code needed for building Zephyr applications.
Install Python dependencies:
west packages pip --install pip install -r ~/hubblenetwork-workspace/zephyr/scripts/requirements.txt
Building and running your first application
Building and Running the First Application Once the steps in the previous section are complete, 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