Skip to content

Unable to Build dbus-ble-sensors Due to Missing velib Headers #10

@cgoudie

Description

@cgoudie

Issue: Unable to Build dbus-ble-sensors Due to Missing velib Headers

Summary

Community developers cannot build dbus-ble-sensors from source because the required velib library headers are not available through the Venus OS package manager, and the velib git repository is private.

Environment

  • Device: Cerbo GX
  • Venus OS Version: v3.52 (scarthgap)
  • Installed dbus-ble-sensors Version: 0.24-r0
  • Source Code Version: 0.25 (from GitHub)

Problem Description

1. Private velib Repository

The dbus-ble-sensors project depends on the velib library as a git submodule:

[submodule "ext/velib"]
    path = ext/velib
    url = git@github.com:victronenergy/velib.git

This repository is private and returns "Repository not found" when attempting to clone:

$ git submodule update --init --recursive
fatal: Authentication failed for 'https://github.com/victronenergy/velib.git/'

2. Empty Development Packages

The Venus OS package manager provides velib-tools-dev and velib-canhw-socketcan-dev packages, but they contain no files:

root@einstein:~# opkg install velib-tools-dev velib-canhw-socketcan-dev
Installing velib-tools-dev (0.12) on root
Installing velib-canhw-socketcan-dev (1.02) on root
Configuring velib-tools-dev.
Configuring velib-canhw-socketcan-dev.

root@einstein:~# opkg files velib-tools-dev
Package velib-tools-dev (0.12-r0) is installed on root and has the following files:
[empty]

root@einstein:~# opkg files velib-canhw-socketcan-dev
Package velib-canhw-socketcan-dev (1.02-r0) is installed on root and has the following files:
[empty]

3. Missing Header Files

The dbus-ble-sensors source code requires the following velib headers:

From src/ble-dbus.h and src/ble-dbus.c:

  • <velib/types/types.h>
  • <velib/types/variant.h>
  • <velib/types/ve_item.h>
  • <velib/types/ve_dbus_item.h>
  • <velib/utils/ve_item_utils.h>
  • <velib/vecan/products.h>
  • <velib/platform/plt.h>

From src/task.c and src/task.h:

  • <velib/platform/console.h>
  • <velib/platform/task.h>
  • <velib/types/ve_values.h>

From sensor implementations (mopeka.c, ruuvi.c, safiery.c, solarsense.c, seelevel.c):

  • <velib/utils/ve_item_utils.h>
  • <velib/vecan/products.h>

These headers are not found anywhere on the Cerbo GX filesystem:

root@einstein:~# find /usr -name 've_item.h' -o -name 'plt.h' 2>/dev/null
[no results]

4. Build Process Failure

The build process fails immediately because the configure script expects velib to be present:

root@einstein:/data/dbus-ble-sensors# ./configure
./configure: line 3: ./ext/velib/mk/init_build.sh: No such file or directory

Impact

This prevents community developers from:

  1. Adding support for new BLE sensors (e.g., SeeLevel tank sensors)
  2. Fixing bugs in the existing code
  3. Testing modifications before submitting pull requests
  4. Contributing to the project in general

Use Case: Adding SeeLevel Sensor Support

We have developed a complete implementation for SeeLevel 709-BT tank sensors (see src/seelevel.c and src/seelevel.h), including:

  • BLE packet parsing for Cypress Semiconductor manufacturer data (ID 0x0131)
  • Support for tank sensors (fresh, black, gray, LPG, galley, chemical)
  • Support for temperature sensors
  • Support for battery voltage monitoring
  • Proper DBus integration following the existing patterns
  • Comprehensive documentation and test cases

However, we cannot build and test this implementation on our Cerbo GX device.

Requested Solutions

Option 1: Make velib Repository Public (Preferred)

Make the velib repository public on GitHub, allowing developers to clone it as a submodule. This would:

  • Enable community contributions to dbus-ble-sensors
  • Allow developers to build and test locally
  • Maintain the existing build system without changes
  • Follow open-source best practices

Option 2: Provide velib Headers in Development Packages

Include the necessary header files in the velib-tools-dev and velib-canhw-socketcan-dev packages. The packages should install headers to /usr/include/velib/ with the following structure:

/usr/include/velib/
├── platform/
│   ├── console.h
│   ├── plt.h
│   └── task.h
├── types/
│   ├── types.h
│   ├── variant.h
│   ├── ve_dbus_item.h
│   ├── ve_item.h
│   └── ve_values.h
├── utils/
│   └── ve_item_utils.h
└── vecan/
    └── products.h

Option 3: Provide a Venus OS SDK

Create a Venus OS SDK that includes:

  • Pre-configured cross-compilation toolchain
  • All necessary headers (including velib)
  • Build scripts and documentation
  • Docker image or VM for easy setup

Option 4: Alternative Build Method

Provide documentation on how to:

  • Access the velib source for approved developers
  • Use Victron's internal build system
  • Submit patches without requiring local builds

Additional Information

Packages Installed for Build Attempt

We successfully installed all other build dependencies:

opkg install gcc make bluez5-dev dbus-dev
opkg install velib-tools-dev velib-canhw-socketcan-dev

All packages installed successfully, and the following development tools are available:

  • gcc (13.3.0)
  • make
  • pkg-config equivalents (dbus-dev, bluez5-dev, libevent-dev)
  • All standard C libraries

The only missing component is the velib headers.

Workaround Attempts

We attempted the following workarounds, all unsuccessful:

  1. Cloning velib via HTTPS instead of SSH - Failed: Repository not found
  2. Searching for headers in system directories - Failed: No headers found
  3. Extracting headers from installed packages - Failed: Packages are empty
  4. Finding headers in existing installation - Failed: Only binary present

Community Impact

The dbus-ble-sensors project is valuable for the Victron community because it:

  • Supports third-party BLE sensors
  • Extends Victron system capabilities
  • Reduces costs for users (no need for proprietary sensors)
  • Encourages community innovation

Making the build process accessible would:

  • Accelerate sensor support development
  • Improve code quality through community review
  • Reduce Victron's maintenance burden
  • Foster a stronger developer community

References

Thank you for considering this request. We're excited to contribute to the Victron ecosystem and help expand BLE sensor support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions