Plus Quectel L70-R GPS, Quectel BC95 NB-IoT modules and thethings.io

The Completed NB-IoT GPS Tracker Application showing geolocation and sensor data (raw temperature)

Let’s build an NB-IoT GPS Tracker! A simple gadget that determines its current location based on received GPS signals… And transmits the location to a server via NB-IoT.

We shall take an existing Apache Mynewt Embedded OS + Embedded Rust project from the article “Rust Rocks NB-IoT! STM32 Blue Pill with Quectel BC95-G on Apache Mynewt”… And extend it with a GPS module: Quectel L70-R.

The project already includes the Quectel BC95 NB-IoT module for transmitting sensor data in CoAP format over NB-IoT.

STM32 Blue Pill F103 doesn’t support floating-point computations in hardware, so it will be inefficient to compute floating-point latitude/longitude coordinates for the GPS module.

We’ll upgrade the STM32 F103 microcontroller to an STM32 L476 because it supports floating-point computations in hardware.

Thankfully there’s already a developer kit that contains the STM32 L476 microcontroller, Quectel L70-R GPS module and Quectel BC95 NB-IoT module… Ghostyu NB-EK-L476 Developer Kit, as described in the article “Quick Peek of Huawei LiteOS with NB-IoT on Ghostyu NB-EK-L476 Developer Kit (STM32L476RCT6)”. Perfect for our NB-IoT GPS Tracker!

Alternatively we may create your own kit based on the same STM32L476RCT6 microcontroller and Quectel modules.

Upgrading from STM32 Blue Pill F103 to L476

How hard is it to switch microcontrollers and migrate a Mynewt + Rust project from STM32 Blue Pill F103 to L476? As we shall find out… Not that hard!

Below is the overall map of changes made to the Mynewt + Rust project while building the NB-IoT GPS Tracker. We’ll study each block in the subsequent sections.

Even if you’re new to Mynewt or Rust, feel free to skim this article! While building the NB-IoT GPS Tracker we made changes to a number of components in Mynewt OS and the Rust application… You’ll soon understand how the various parts of Mynewt and Rust work together to create an IoT gadget.