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

False: No encryption or True: AES-128 encryption. ()default is False)

encryption_key

String, up to 16 characters (default is an empty string)

rpc_crc

True or False (default is False)

packet_crc

True or False (default is False)

A Network also holds some default communication parameters for callback and directed multicast RPCs:

Parameter

Description

default_group

Default multicast Group

default_ttl

Default multicast TTL

default_cb_timeout

Default callback timeout in seconds

default_cb_retries

Default callback retries

default_delay

Default directed multicast delay

Note

“rpc_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 and TCP) 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)

speed

Baud rate to use by default (Default is 38400)

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)

Under the Covers

SNAPtoolbelt stores its configuration in a toolbelt_config.db file, in a .snap folder under your user folder:

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

  • ~/.snap on Linux/Mac

You can specify an alternative config path with the --rcfile <rcfile> global option.