iTracker RAK8211 (G/NB)

RAK8211

Binaries can be found in:

Using

GPS

require("iTracker").setGPSOn(true,print)
/* { "time": "23:59:43",
  "lat": NaN, "lon": NaN,
  "fix": 0, "satellites": 0, "altitude": NaN } */

When a fix is received, the values no longer be NaN and fix will be 1.

SMS

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 sms.at.debug(); here if you want debug messages

  sms.init(function(err) {
    if (err) throw err;
    console.log("Initialised!");

    sms.list("ALL", function(err,list) {
      if (err) throw err;
      if (list.length)
        console.log(list);
      else
        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)
});

GSM/GPRS

function connectionReady() {
  var http = require("http");
  http.get("http://www.pur3.co.uk/hello.txt", function(res) {
    res.on('data', function(data) {
      console.log(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('QuectelM35').connect(usart, {}, function(err) {
      console.log("Connected!");
      if (err) throw err;
      connectionReady();
    });
  }, 30000);
});

Sensors

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

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

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

o=require("iTracker").setOptoOn(true, function() {
  console.log(o.read());
});
// 2709.76

Reference

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 QuectelM35 to the serial device usart

Tutorials

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

Tutorials using Bluetooth LE:

About Bluetooth LE (BLE)About Bluetooth LE (BLE)BLE Advertising with Node.js/Python/C#/AndroidBLE Advertising with Node.js/Python/C#/AndroidControlling Bluetooth Lights with Puck.jsControlling Bluetooth Lights with Puck.jsControlling Other BLE Espruino DevicesControlling Other BLE Espruino DevicesExercise Machine controlled VideoExercise Machine controlled VideoGetting Started with Puck.jsGetting Started with Puck.jsPixl.js Bluetooth to Ethernet MQTT BridgePixl.js Bluetooth to Ethernet MQTT BridgePixl.js SMS Remote MonitoringPixl.js SMS Remote MonitoringPuck.js Bluetooth with the Graphical EditorPuck.js Bluetooth with the Graphical EditorPuck.js MIDIPuck.js MIDIPuck.js Music ControllerPuck.js Music ControllerPuck.js Security and Access ControlPuck.js Security and Access ControlPuck.js and BLE PrintersPuck.js and BLE PrintersPuck.js and BLE UARTsPuck.js and BLE UARTsPuck.js and Eddystone BeaconsPuck.js and Eddystone BeaconsPuck.js and HID KeyboardsPuck.js and HID KeyboardsPuck.js and HTTP ProxiesPuck.js and HTTP ProxiesPuck.js and If This Then ThatPuck.js and If This Then ThatPuck.js and Node-RED with MQTTPuck.js and Node-RED with MQTTPuck.js and iBeaconsPuck.js and iBeaconsPuck.js with SMS controlPuck.js with SMS controlQuick Start (Bluetooth LE)Quick Start (Bluetooth LE)Using Puck.js from a Web Bluetooth WebsiteUsing Puck.js from a Web Bluetooth WebsiteWeb Bluetooth on LinuxWeb Bluetooth on LinuxWeb IDE on a Raspberry PiWeb IDE on a Raspberry Pi

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

Door Controlled Light with Puck.jsDoor Controlled Light with Puck.jsInfrared Record and Playback with Puck.jsInfrared Record and Playback with Puck.jsPixl.js Wireless Temperature DisplayPixl.js Wireless Temperature DisplayPixl.js Wireless Weather StationPixl.js Wireless Weather StationTemperature Controlled Night Light with Puck.jsTemperature Controlled Night Light with Puck.js

Pinout

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

  • Purple boxes show pins that are used for other functionality on the board. You should avoid using these unless you know that the marked device is not used.
  • ! boxes contain extra information about the pin. Hover your mouse over them to see it.
  • 3.3v boxes mark pins that are not 5v tolerant (they only take inputs from 0 - 3.3v, not 0 - 5v).
  • GND is ground (0v).
  • ADC is an Analog to Digital Converter (for reading analog voltages)
  • USART is a 2 wire peripheral for Serial Data.

Firmware Updates

You need to attach a nRF52DK or other SWD programmer to the SWDCLK and SWDIO pins.

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