Skip to content

inReach Device Support

Amos Hayes edited this page Jun 19, 2025 · 7 revisions

Nunaliit provides integration of inReach devices. It is possible to load inReach devices with preset forms that can be filled out in the field and sent back to the Nunaliit database.

Device forms are defined using a XML file with a format resembling this example:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <table tableName="Forms" version="1">
    <form id="1">
      <title>Place</title>
      <destination>tsfn-manager@gcrc.carleton.ca</destination>
      <prefix>TSFN-P-1-</prefix>
      <delimiter>|</delimiter>
      <field id="1">
        <name>Type</name>
        <type>PickList</type>
        <value>camp</value>
        <value>waypoint</value>
        <value>historic</value>
        <value>other (put in notes)</value>
        <required>Y</required>
      </field>
      <field id="2">
        <name>Name</name>
        <type>Text</type>
        <length>140</length>
        <required>N</required>
        <default/>
      </field>
      <field id="3">
        <name>Notes</name>
        <type>Text</type>
        <length>140</length>
        <required>N</required>
        <default/>
      </field>
    </form>
  </table>
</root>

To configure Nunaliit to accepts the messages sent by inReach devices, copy the form definition file to <atlas>/config/inreach_forms.xml After copying the file, the server must be restarted.

This configuration is read and passed to the Nunaliit robot. The robot monitors the database for new incoming messages (documents) and augments them with the following information:

  • The geometry (nunaliit_geom) is derived from geographic information
  • A schema name (nunaliit_schema) is assigned. If a form is associated with the message, then the schema name is "inReach_<form title>". In the case that no form is associated with the message, then the schema name is set to "inReach".
  • The form data is added to a special document location. An object is added at location "inReach_<form title>". Each field is added to this structure with the appropriate value.

In order to display the values in the augmented documents, schemas are needed. These schemas can be generated from schema definitions automatically generated from the device forms. This command is explained in this section.

The Garmin Explore inreach subscriptions support pushing messages out to a URL (webhook) as they are received. The catch is that their code to do this will only accept an HTTP 200 response header as successful. In HTTP, that is the standard response to a get request for a document. After receiving a POST request to submit something, a server is expected to return an HTTP 201 to indicate receipt of the data. This is what CouchDB does. To make this easy in Nunaliit, a special proxy was developed that receives these requests from Garmin, posts them to a dedicated DB in CouchDB, watches for the 201, and returns a 200 to Garmin to indicate success in their system. This proxy was added in pull request #1219. Additional documentation remains to be written.

Clone this wiki locally