iTracker RAK8212


NOTE: The RAK RAK8212 is no longer manufactured and new Espruino binaries are no longer being created. For new designs RAKwireless recommends the RAK5010.

Binaries can be found in:



Serial connection

When the iTracker powers on, if it detects 3.3v on pin D28 (Serial RX) then it will enable serial comms at 9600 baud on D28(RX) and D29(TX).

For instance if the iTracker is connected to the adaptor board and that board is powered on, you'll be able to use the USB Serial interface to program your iTracker.

However there is just one Serial port on the nRF52. If you then use GPS or GSM, the connection to D28/D29 will be moved, removing your communications. If you need to maintain communications during that time, please connect via Bluetooth instead.


There is no separate GPS chip on the RAK8212. Instead, it is built into the BG96. Use as follows - this also turns the BG96 on if it wasn't already enabled.

require("iTracker").setGPSOn(true, function(err, gps) {
  /* gps contains: {
    at : AT command handler
    on : function(callback(err)) // turn GPS on (turned on automatically)
    off : function(callback(err)) // turn GPS off
    get : function(callback(data)) // get GPS data
  } */
  setInterval(function() {
    gps.get(function(data) {
      print("GPS", data);
      /* returns {error:...} on failure. 'ERROR: 516' means 'no fix'
         returns { raw : raw data as <UTC>,<latitude>,<longitude>,<hdop>,<altitude>,<fix>,<cog>,<spkm>,<spkn>,<date>,<nsat>
                   lat :   latitude in degrees,
                   lon :   longitude in degrees,
                   alt : altitude in m  } */
  }, 10000);

Modem testing

The following code will power up the modem and report back the version number. It's a quick, easy way to test it without needing an active SIM.

var at;
console.log("Turning Cell on");
require("iTracker").setCellOn(true, function(usart) {
  console.log("Cell now on");
  at = require("AT").connect(usart);
  at.cmd("AT+GMR\r\n",1000,function cb(d) {
    if (d=="AT+GMR") return cb;
    if (d!="OK") console.log("Version is "+d);

You can use the AT Module in this way to send your own custom commands as well (it's also available as and in the examples below.


See the ATSMS module for full documentation.

var sms;

console.log("Turning Cell on");
require("iTracker").setCellOn(true, function(usart) {
  console.log("Connecting SMS");
  var ATSMS = require("ATSMS");
  sms = new ATSMS(usart);
  //Use; here if you want debug messages

  sms.init(function(err) {
    if (err) throw err;

    sms.list("ALL", function(err,list) {
      if (err) throw err;
      if (list.length)
        console.log("No Messages");

    // and to send a message:
    //sms.send('+441234567890','Hello world!', callback)

  sms.on('message', function(msgIndex) {
    console.log("Got new message, index ", msgIndex);

  // when done use require("iTracker").setCellOn(false)


See the QuectelBG96 module for full documentation.

function connectionReady() {
  var http = require("http");
  http.get("", function(res) {
    res.on('data', function(data) {

var gprs;
console.log("Turning Cell on");
require("iTracker").setCellOn(true, function(usart) {
  console.log("Waiting 30 sec for GPRS connection");
  setTimeout(function() {
    console.log("Connecting GPRS");
    gprs = require('QuectelBG96').connect(usart, {
      apn : "",
      username : "",
      password : ""
    }, function(err) {
      if (err) throw err;
  }, 30000);


This blog post by Wolfgang Klenk shows how to get connected with Vodafone's NB-IoT in Germany.


e=require("iTracker").setEnvOn(true, function() {
// { "temp": 27.05661935425, "pressure": 1007.23205361758, "humidity": 40.728515625 }

m=require("iTracker").setMagOn(true, function() {
// { "x": -92, "y": -17, "z": 424 }

a=require("iTracker").setAccelOn(true, function() {
// { "x": 0.0263671875, "y": 0.3505859375, "z": -0.3291015625 }

o=require("iTracker").setOptoOn(true, function() {
// 2709.76


iTracker.setGPSOn = function(isOn, callback) { ... }

Return GPS instance. callback is called whenever data is available!

iTracker.setEnvOn = function(isOn, callback) { ... }

Returns BME280 instance. callback when initialised. Call getData to get the information

iTracker.setMagOn = function(isOn, callback) { ... }

Returns a LIS2MDL instance. callback when initialised. Then use read to get data

iTracker.setAccelOn = function(isOn, callback) { ... }

Returns a LIS3DH instance. callback when initialised. Then use read to get data

iTracker.setOptoOn = function(isOn, callback) { ... }

Returns a OPT3001 instance. callback when initialised. Then use read to get data

iTracker.setCellOn = function(isOn, callback) { ... }

Turn cell connectivity on - will take around 8 seconds. Calls the callback(usart) when done. You then need to connect either ATSMS or QuectelBG96 to the serial device usart

iTracker.setCharging = function(isCharging) { ... }

Set whether the BQ24210 should charge the battery (default is yes)


First, it's best to check out the Getting Started Guide

Tutorials using Bluetooth LE:

Tutorials using Bluetooth LE and functionality that may not be part of the iTracker:


Hover the mouse over a pin function for more information. Clicking in a function will tell you how to use it in Espruino.

Firmware Updates

You need to attach a nRF52DK or other SWD programmer to the SWDCLK and SWDIO pins, then upload the hex file by copying it to the JLINK drive or using nrfjprog.

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.