Configuration

|SNAPtoolbelt| needs to know two things in order to talk to devices on your |SNAP| networks:
  1. How your |SNAP| network is configured
  2. How to connect to your |SNAP| network

Networks

A Network describes how a |SNAP| network is configured. All nodes in the |SNAP| network need to be configured the same way. It contains the following parameters:

Parameter Description
channel Integer from 0-15 (for 2.4 GHz networks, 0-63 for 900 MHz, default is 4)
network_id (default is 0x1c2c)
encryption_type None, Basic, or AES-128 (default is None)
encryption_key String, up to 16 characters (defaults is an empty string)
encryption_key String, up to 16 characters (default is an empty string)
second_crc True or False (default is False)
packet_crc True or False (default is False)

Note

“second_crc” and “packet_crc” refer to feature bits 8 (0x0100) and 10 (0x0400), respectively. See the SNAPcore section for more information on these CRCs.

Profiles

A Profile describes the method in which |SNAPtoolbelt| will connect to a |SNAP| network. Each of the supported connection methods (serial, TCP, and MQTT) have specific parameters.

Serial

A Serial Profile is used when you are talking to a serial node such as a SS200, SN220, or SN171 Protoboard. It contains the following parameters:

Parameter Description
device Device string can be a COM identifier on Windows such as COM1, USB0 for SN132 paddleboards in USB mode, SnapStick0 for SS200s in USB mode, or a device path like /dev/snap1 on POSIX systems.
address Licensed address to use (or blank to use the default)

TCP

A TCP Profile is used when you’re talking to a |SNAPconnect| instance that is accepting TCP connections. It contains the following parameters:

Parameter Description
host Hostname or IP address
port Port to connect to (default is 48625)
ssl Should this connection use SSL? (True or False)
username User to authenticate as
password Password to authenticate with
address Licensed address to use (or blank to use the default)

MQTT

An MQTT Profile is used when you’re talking to a SNAP2MQTT instance via an MQTT gateway. It contains the following parameters:

Parameter Description
host Hostname or IP address
port Port to connect to (default is 1883)
ca_certs Path to client SSL certificates
address SNAP2MQTT’s address (default is 000080)

Under the Covers

|SNAPtoolbelt| stores its configuration in a .snap folder under your user folder:

  • %USERPROFILE% on Windows, e.g. “C:\Users\YourName\.snap”
  • ~/.snap on Linux/Mac

The configuration (and some other data) is stored in a few files:

Filename Description
profiles.cfg SNAP Profiles, or “how should I talk to your SNAP networks?”
networks.cfg SNAP Networks, or “What networks do you talk to, and how are they configured?”
nodes.cache Node addresses you’ve recently talked to