User manual
2. SNAP Overview
SNAP is a family of soware technologies that together form an integrated, end-to-end soluon for wireless
monitoring and control. The latest version is 2.5, which this document covers.
Key features of SNAP
• All devices are peers – any device can be a bridge for Portal, do mesh roung, sleep, etc. There are no
“coordinators” in SNAP.
• SNAP implements a full mesh topology. Any node can talk directly to any other node within radio range,
and can talk indirectly to any node within the SNAP network.
• Communicaon among devices can be unicast (addressed to a specific desnaon, with acknowledged
receipt, retrying as appropriate) or mulcast (unacknowledged, only sent once, and potenally acted on
by mulple recipients).
• Remote Procedure Call (RPC) among peers is the fundamental method of messaging.
• The PC based user interface (Portal) appears as a peer device on the SNAP network.
RPC
Remote Procedure Calls are a hallmark of SNAP interoperability. With RPCs, any node can make a request to
another node that it perform some task by running a funcon it knows. The calling node doesn’t need to know
anything about the task to be performed other than its name, and the task might or might not involve sending
data back to the calling node. (Such a data transfer would happen via a separate RPC call, this from the second
node back to the first.)
All SNAP devices implement a core set of built-in funcons (procedures) to handle basic network configuraon,
system services, and device hardware control. Addional user-defined funcons may be uploaded to devices as
well. Funcons are defined as SNAPpy scripts, in an embedded subset of the Python language called SNAPpy.
This upload process can occur over directly connected serial interfaces, or over the air.
Once uploaded, both the built-in funcons and the user-defined funcons are callable locally (from within the
user-defined script) or remotely by RPC from another node. These funcons may themselves invoke local and
remote funcons.
For example, imagine an HVAC system where the compressor unit communicates with the thermostat using
SNAP nodes. This could potenally allow a PC to become part of the network, to either query or control the
system.
The PC could send an askCurrentTemp RPC request to the thermostat, which could respond with a tellTemp RPC
back to the PC. The PC could send a setDesiredTemp RPC call to the thermostat, which (depending on how
things are set and the ambient condions) might then make RPC calls to the compressor unit to turn the unit on
or to change its mode from heang to cooling, for example.
Each of these commands in a SNAP network is a separate, independent RPC call, acted on by the recipient of the
call. In each case, the calling node does not need to know the implementaon of the funcon at the called node.
For example, the SNAPpy script in the PC node does not need to have an askCurrentTemp() funcon defined in
order to be able to request that the thermostat node run its askCurrentTemp() funcon.
4 SNAP® Network Operang System