
Working With the Gateway's SNAP Module
The E12 supports an internal SNAP module for 915MHz or 2.4GHz
communications depending on the unit you purchased. These modules are
interchangable, and the E12 can access the SNAP module serially via serial ports
/dev/snap0
and
/dev/snap1
connecting to UART0 and UART1 on the
module, respectively. By default, SNAP-powered modules communicate serially
over UART1, so when making your SNAPconnect or SNAPtoolbelt connection to
the module, you should use
/dev/snap1
unless you have modified your
modules’s default UART settings.
For detailed instructions on SNAPconnect, please consult the SNAPconnect
Python Package Manual, available from
http://developer.synapse-
wireless.com/software/snapconnect
.
In addition to the serial connections, there is one GPIO pin from the E12 that is tied to the module for controlling and
signaling.
l
GPIO 48: Tied to the Reset pin on the RF220SU, you can use this pin to reboot the module.
Waking the SNAP Module
At times it may be helpful to have the SNAP module in your E12 sleep, and then be woken by the E12’s processor. If
you have installed the recommended E12-snap-utils package, you can easily do this by defining GPIO_F1 on the
SNAP module as a wake pin, like this:
from synapse.pinWakeup import *
from synapse.platforms import *
@setHook(HOOK_STARTUP)
def onStartup():
setPinDir(GPIO_12, False)
setPinPullup(GPIO_12, True)
wakeupOn(GPIO_12, True, True)
Now, whether your SNAP module is in a timed sleep or an untimed sleep, having the code on your E12 invoke this
command will wake the SNAP module:
/usr/local/bin/wake-snap-node
This command invokes a Bash script to pull the E12s GPIO33 high, pause a second, and then pull the line low. The
Bash script must be invoked as
sudo
or by a process invoked as
sudo
. You can examine the Bash script to see
how the GPIO value is controlled for use in your own scripts, should you wish to use the pin as a one-bit signal to the
SNAP module.
13
Содержание SNAPconnect E12
Страница 30: ...26 SNAPconnect E12 User Guide 116 081614 030 B001 E12 Dimensions ...
Страница 34: ......
Страница 35: ......