Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
U

ubxlib

> 编程语言
Open source

Portable C libraries which provide APIs to build applications with u-blox products and services. Delivered as add-on to existing microcontroller and RTOS SDKs.

359 stars0 likes0 views
WebsiteGitHub

About

Portable C libraries which provide APIs to build applications with u-blox products and services. Delivered as add-on to existing microcontroller and RTOS SDKs.

Dear ubxlib community,

After careful consideration, we have decided to discontinue the ubxlib project. This decision was not made lightly, and we want to thank everyone who has contributed, used, and supported this project over the years.

The repository will be archived on 2024-11-08. This means it will become read-only, but you will still be able to fork and clone it. Open issues will be closed till end of 2024. Afterwards no more support for ubxlib is available. For any questions please use our support portal.

Thank you for your understanding.

Best regards, The ubxlib team


Note: if you are reading this from a package-file created by a third-party [e.g. PlatformIO] and the links do not work, please try reading it at the original ubxlib Github site instead.

Introduction to ubxlib

This repository contains an add-on to microcontroller and RTOS SDKs for building embedded applications with u-blox products and services. It provides portable C libraries which expose APIs with examples. ubxlib supports u-blox modules with cellular (2G/3G/4G), short-range (Bluetooth and Wi-Fi) and positioning (GNSS) functionality. The ubxlib libraries present high level C APIs for use in customer applications (e.g. connect to a network, open a TCP socket, establish location, etc.) and implements these APIs on selected popular MCUs, also available inside u-blox modules.

The goal of ubxlib is to deliver a single tested solution, with examples, which provides uniform easy-to-use APIs across several u-blox products. Releases of ubxlib are tested automatically for all configurations on multiple boards in a test farm.

The easiest way to quickly explore ubxlib is to start with a board listed in the test farm. u-blox EVKs (evaluation kits) or application boards can be found here or at major electronics distributors and code examples which run on the u-blox XPLR-IOT-1 platform can be found here. If you've heard enough and want to get started with the XPLR-IOT-1 platform, or maybe with PlatformIO, jump straight to How To Use This Repo below.

ubxlib runs on a host microcontroller and has a peripheral attached. This setup is very common in embedded applications. An example of such a host-peripheral configuration with EVK-NINA-B301 (Bluetooth 5.0) and EVK-R4 (SARA-R4 with 2G/3G/4G) in which the ubxlib host sets up a TCP connection is shown in the following figure. Many other combinations can be achieved, with the supported hosts and peripherals in the tables in the next section.

APIs

The key APIs provided by this repo, and their relationships with each other, are shown in the picture below.

  • If you wish to bring up a device/network and don't care about the details, use the common device and network APIs, which can bring up cellular, BLE/Wi-Fi or GNSS network(s) at your choosing.
  • If you wish to use a socket over that network, use the common sock API.
  • If you wish to use security, use the common security API.
  • If you wish to contact an MQTT broker over that network, use the common mqtt_client API.
  • If you wish to use HTTP, use the common http_client API.
  • If you wish to get a location fix use the common location API.
  • If you wish to build a geofence that can be used with gnss, wifi and cellular, see the common geofence API.
  • If you wish to take finer control of cellular, ble, wifi or gnss, use the respective control API directly.
  • GNSS may be used via the gnss API.
  • The BLE and Wi-Fi APIs are internally common within u-blox and so they both use the common short_range API.
  • The at_client API is used by the cellular and short range APIs to talk to AT-based u-blox modules.
  • The ubx_protocol API implements the necessary encoding/decoding to talk to u-blox GNSS modules.
  • The port API permits all of the above to run on different hosts; this API is not really intended for customer use - you can use it if you wish but it is quite restricted and is intended only to provide what ubxlib needs in the form that ubxlib needs it.

All APIs are documented with Doxygen compatible comments: simply download the latest Doxygen and either run it from the ubxlib directory at a command prompt or open Doxyfile in the Doxygen GUI and run it to obtain the output.

Supported ubxlib host platforms and APIs

Hosts run ubxlib and interact with an attached periperal. A host platform contains an MCU, toolchain and RTOS/SDK as listed in the table below. Hosts are typically u-blox open CPU (standalone) modules or other MCUs. To use a host you need a development board or an EVK. Currently ubxlib supports and tests the following purchasable boards out-of-the box.

  • u-blox XPLR-IOT-1
  • u-blox XPLR-HPG-1
  • u-blox XPLR-HPG-2
  • u-blox C030-U201 board
  • u-blox NINA-W1 EVK
  • Nordic nRF52840 DK board
  • Nordic nRF5340 DK board
  • ESP32-DevKitC
  • STM32F4 Discovery board
  • STM32F7 Nucleo board
  • STM32U5 Nucleo board
  • NXP FRDM-MCXN947 board

If your MCU is on the list but your board is not:

  • just set the HW pins in the source file of the example to match how your MCU is wired to the u-blox peripheral.

If your MCU is not on the list:

  • if you are using PlatformIO and Zephyr then any MCU that Zephyr supports should work with ubxlib, just follow the instructions here to bring ubxlib into your existing PlatformIO environment,
  • otherwise, to port ubxlib to a new host platform follow the DIY instructions for the port API.

|ubxlib hosts |NINA-W10|NINA-B40 series NINA-B30 series NINA-B1 series ANNA-B1 series

|NORA-B1 series|C030 board|PC|PC| |-----------|-----------|--------------|-----|-----|------|------| |MCU|Espressif ESP32|Nordic nRF52|Nordic nRF53|ST-Micro STM32F4|x86/64 (Linux)|x86 (Win32)1| |Toolchain|ESP-IDF Arduino-ESP32|GCC nRF Connect|nRF Connect|Cube|GCC|MSVC| |RTOS/SDK|FreeRTOS|FreeRTOS Zephyr|Zephyr|FreeRTOS|Posix|Windows| |APIs provided by host with peripheral attached2|wifi ble device network sock|ble device network|ble device network | cell device network sock location3 TLS security | N/A | N/A |

1: For development/test purposes only. 2: Only SPS API provided for native (on-chip) BLE interface, other APIs for native (on-chip) access, e.g. WiFi support, are a work in progress.

Supported modules as ubxlib peripherals and APIs

Peripherals are u-blox modules which accept commands (e.g. AT-commands) over a serial interface and have no open MCU environment. To run the APIs they need to be attached to a host which runs ubxlib. For example in the test farm combinations of hosts and peripherals are listed.

|ubxlib peripherals |NINA-B41 series NINA-B31 series NINA-B1 series ANNA-B1|NINA-W13|NINA-W15 NORA-W364|SARA-U2 series|LENA-R8 series|LEXI-R10 series LEXI-R4 series LEXI-R5 series SARA-R4 series SARA-R5 series LARA-R6 series |SARA-R510M8S SARA-R520M10S SARA-R422M8S

SARA-R422M10S|M8/M9/M10 series| |-----------|-----------|--------------|-----|-----|-----|------|------|------| |APIs provided by host with peripheral attached|ble device network|wifi device network sock TLS security mqtt_client http_client|wifi ble device network sock TLS security mqtt_client http_client|cell device network sock location3 TLS security http_client|cell device network sock location3 TLS security mqtt_client|cell device network sock location3 security5 mqtt_client http_client|All APIs of SARA-R4, SARA-R5 series + gnss location|gnss location|

3: Through the u-blox CellLocate mobile network-based location service.

4: Beta support: please add short_range_gen2 to the UBXLIB_FEATURES variable in your make or CMake file when building ubxlib for NORA-W36; NORA-W36 comes with a second generation u-connectExpress, please see the release notes for NORA-W36 for the supported features.

5: Except SARA-R422 (non-S), which supports no form of security, and LEXI-R5/LEXI-R4/LEXI-R10/SARA-R52, which support only TLS security.

Structure of ubxlib

The APIs for each type of u-blox module can be found in the relevant directory (e.g. cell for cellular modules and ble/wifi for BLE/Wi-Fi modules). The common directory contains APIs and 'he

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Capiblebluetoothdeveloper-tools

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言