SNAP RF on BeagleBone Black

Created by Mike Pearson, last modified by Robert Nelson on Sep 08, 2017

image

Introduction

This page will show you step-by-step how to interface a Synapse Wireless Snap RF Engine to the BeagleBone Black. This example uses the EK2100 Starter Kit from Synapse Wireless. From the kit, an SN132 SNAPstick (lower left photo), is connected to the BeagleBone’s USB Port. In this scenario we will press a button on the SN171 (lower right photo), also from the kit, wirelessly prompting a python script on the BeagleBone to send an email notifying “something has happened”. My goal when starting this project was to have multiple sensor nodes throughout a business or home communicating with a low power web enabled device.

Hardware Requirements

BeagleBone Black at Digi-Key
BeagleBone Green at Digi-Key

Development Kit:
EK2100-220 Starter Kit at Digi-Key
EK5100-220 Starter Kit at Digi-Key
EK2500 Starter Kit at Digi-Key

Or a combination of these:
SN132 SNAPstick at Digi-Key
SN171 ProtoBoard at Digi-Key
SNAP Transceivers at Digi-Key

image
image

Software Requirements

  • BeagleBone Black running Debian or Ubuntu
  • Portal IDE
  • SNAP Connect
    • 3.1.0-python2.7
    • This is the main software that will run on the BeagleBone Black.
    • It is written in Python and made specifically for ARM devices to interact with SNAP networks.
    • Will acquire and install in later steps.

Install Portal on Windows Machine

  1. Login here and download Portal-setup-2.4.36.exe (this is the version for my Windows 7 machine).
  2. Follow guided installation.

Install script on nodes

  1. Download node_smtp.py
  2. Move or save this file in the following directory on your machine:
  3. C:\Users\YourName\Documents\Portal\snappyImages (exact location may vary).
  4. Connect SNAPstick to an available USB port on your machine.
  5. Connect the ProtoBoard to a power source.
  6. Open Portal.
  7. Click “Connect” when prompted (mine says “USB0” for the Port).
  8. Update Firmware if needed Portal: Reference Manual Page 46
  9. In the “Node Views” window, click on “Stick” under “Device Type” (Figure 1).
    image
  10. In the “Node Info” window, click on the "Upload SNAPpy Image (Figure 2).
    image
  11. Select the node_smtp we saved earlier and click OK.
  12. The SNAPstick is now programmed.
  13. Now click on the “Device Type” labeled “Buzz” and repeat.
  14. You just programmed the ProtoBoard “over the air”.

SSH Into BeagleBone

Login as root.

/home/debian
ssh debian@192.168.x.x
sudo su

Install SNAP Connect

The following steps are done on the Beaglebone Black.

Acquire SNAP Connect software.

/home/debian
pip install --extra-index-url https:` `//update.synapse-wireless.com/pypi snapconnect

Get email Scripts

/home/debian/synapse
cd /home/debian/synapse
wget http:` `//eewiki.net/download/attachments/35848337/smtp_single.tar.xz
tar xf smtp_single.tar.xz
cd smtp_single
nano smtp_single_recipient.py
  1. Edit the “to”,gmail_user and gmail_pwd to your credentials.
  2. Save and exit.

Run Script

  1. Connect the SNAPstick to the USB port of the BeagleBone and reboot.
  2. Power the ProtoBoard.
  3. SSH back into the BeagleBone as root.
/home/debian/synapse/smtp_single_recipient
ssh debian@192.168.x.x
sudo su
cd synapse/smtp_single


python run_me.py

What you should see:

/home/debian/synapse/smtp_single_recipient
Permanent license created on 2012-02-14 14:14:45.343000 for 000020

Waiting for button press.

Press CTRL+C to end script.

Now when you press the button on the ProtoBoard an email will be sent.

Email Multiple Recipients

This is an alternative script that allows you to send to multiple recipients. In this example, I chose one of my recipients to be MyNumber@vtext.com, allowing me to receive an email and text message.

/home/debian/synapse
cd /home/debian/synapse
wget https:` `//eewiki.net/download/attachments/35848337/smtp_multi.tar.xz
tar xf smtp_multi.tar.xz
cd smtp_multi
nano smtp_multi_recipient.py

Edit the file with your information and run the script just like before.