Home :: News archive

News Archive

Synapse RF266 SNAP Quickstart Guide

Looking to add as much excitement and "awesome-ness" as we can to our new products range/catalogue, Ocean Controls has recently developed a breakout board that would be Synapse RF266/ XBee modules compatible.

Exploring the SNAP world can be quite confusing and mind boggling, yet full of excitement. Well that was the impact it had on me anyway.

In this quickstart guide I'm just going to go demonstratehow the Synapse RF266 module is used with the breakout board in a point to multi-point mesh. I chose this module over the XBee modules because well it was easier to grasp. Maybe the next tutorial can be XBee module focus instead, just maybe.

If you are after a more in-depth documentation of the SNAP modules, I highly recommend you giving their Forum a visit. It's an extremely useful forum that will provide tons of great resources for their SNAP modules, whether it is the RF266/RF100 etc...

What is/are SNAP:

SNAP stands for Synapse Network Application Protocol. Synapse's SNAP network operating system is an Internet-enabled, instant-on, multi-hop, mesh network designed to cost-effectively run efficiently over a wide range of popular microprocessors and microcontrollers. The operating system works behind the scenes to accomplish three tasks: IEEE 802.15.4 networking, hardware abstraction (controlling the i/o, low-level microcontroller stuff, etc.), and subset of Python script (SNAPpy) interpretation.

Figure 1: Synapse Wireless- Technology Overview

What you'll need:

Synapse's IDE: Portal

To get started what you would need to do is download "Portal", which is Synapse's free development environment and can be downloaded from the link provided here: Latest Portal Software. This is where you will be developing your SNAPpy scripts, which is a sub-set of Python and everything thye do is event-driven.

Please note that to download Portal from the Forum, you will be required to sign up and don't worry the file is only 35.8 MB!

Figure 2: Typical Portal UI

The UI's very customizable, you drag-and-drop panes wherever you like! The windows I find most useful are:

  • Node Views: Shows every node on a network, along with some brief info like link quality and address.
  • Node Info: Shows a completely rundown of a node's configuration. You'll use this pane to upload scripts to nodes. You can also manually run procedures by clicking on them and filling out a few parameters (great for debugging).
  • SNAPpy scripts: Can be edited from within Portal. Obviously this is an essential part to any development environment.
  • Event Log: Great place to watch for debug messages and errors.
Synapse Modules and Breakout board:

You'll need at least one SNAP module, but to emphasize on the wireless side of things, in this quick guide, I will be using three modules to demonstrate a point to multi-point mesh. Each of these modules can work as a standalone microcontroller, but it's not very practical as you won't get much use out of its integrated transceiver unless you've got something else for the module to talk to.

Synapse modules and breakout board ticked, now next thing to do is to bridge the modules with Portal and your PC

A SNAP-to-Serial Bridge

Figure 3: SNAP-to-Serial Bridge

By default the RF266 comes with an AT Command Interpreter script on it which makes it act much like an XBee. Unfortunately, this script uses the UART and interferes with Portal's attempts to communicate with it. In order to use this module with Portal's serial port, you've got to erase the script:

  • Go to Options, and select Erase SNAPpy Image
  • Select the correct port number under the Port pull-down
  • On the Platform pull-down select RF266
  • Hit Erase
  • A Please restart your device... dialog will appear. You'll have to manually reset the module by shorting the RST pin to GND. This may take a few tries, you'll have to quickly touch RST to GND.

If you have knowledge of C/C++/Java languages, it might take awhile to get used to SNAPpy script. Good news is that there are tons of documentation available to get you started such as SNAPpy Script reference manual

Here are a few things I have learned so far:

  • White space matters! Statements are terminated by end-of-lines and code blocks are structured using indentations.
  • No semicolons!
  • There are regular colons, statements like if, else, while and procedure declarations should all be followed by a regular colon(:)
  • No curly brackets!
  • No need to define data types (dynamic typing), Python will figure out what kind of variable you need
  • Global variables are a little odd, you can declare global variables at the top of your script, but within individual procedures you need to delcare that you're using that global variable, strange I know but it is what it is.

To get things going, I have made a video to demonstrate on how these modules work in a point to multi-point mesh by wirelessly blinking LEDs with a pushbutton and a switch. The push button and switch are used as digital inputs when the switch is flicked ON from the "Master" unit, the LED of relay one will be triggered and stays on until the switch if flicked OFF from the "Master" unit. When the button is pushed from the "Master" unit the second relay will be triggered for 60s then all units will be told to turn off.

As you may have noticed when viewing the video, I have placed a plastic enclosure with IP65 rating over the top of it. This is to emphasize on how well and strong their link quality is. The down side of this is that they only work approximately within 50 m distance apart, anymore than that the signal will be lost.

You can download the scripts used in this video, plus other example scripts here

Video1: Synapse RF266 Quickstart Guide - point to multi-point mesh

Hope you will find this quickstart guide somewhat useful and remember this is only a small stepping stone to unlocking more complex applications! So start coding!

Stay tuned for more updates by subscribing to our News RSS and our New Products RSS using your favourite RSS reader.