Skip to content

SWAPdmt (GUI version)

dberenguer edited this page Nov 6, 2014 · 2 revisions

Introduction

SWAPdmt is a software tool, written in Python, designed to configure SWAP devices wirelessly. SWAPdmt basically acts as a remote editor for any register belonging to any of the wireless devices (motes) within the same SWAP network.

SWAPdmt allows configuring the following parameters:

  • Serial port settings on the modem (serial interface).
  • Network settings on the modem: frequency channel, network ID, address and security options.
  • Network settings on any mote: frequency channel, network ID, address, security options and periodic Tx interval.
  • Custom registers on any mote

Besides, SWAPdmt can identify every SWAP mote in the network (with the same frequency channel and network id as the modem) and monitors the network, providing feedback for register values and device addresses.

Installation

Before installing SWAPdmt, you should check that your computer meets the following requirements:

Once the above requirements met, you can start installing SWAPdmt as follows:

1- Download the latest version of our Python tools. You will find there all the necessary to install pyswap and SWAPdmt.

2- Enter the pyswap directory and install the package with this command

# python setup.py install

3- Now enter the SWAPdmt folder and run the application as follows:

# python path/to/swapdmt/pyswapdmtgui.py

Serial port

In order to connect SWAPdmt to the network, a SWAP wireless gateway must be available on the computer. At the moment of writing this document only panStick or a usb/serial panStamp can be used as SWAP interfaces. The SWAP modem communicates with the computer via serial port (a real serial port or a virtual one) so before pressing the “Connect” button you should check the serial settings.

SWAPdmt serial port settings

Once the serial port configured, you can connect SWAPdmt to the wireless network by pressing Gateway->Connect.

Serial gateway network settings

SWAPdmt can only be connected to a single SWAP network at the same time. This said, specific network parameter for the management tool can be configured from Gateway->Network. Frequency channel, network id, device address and security can be directly changed from this menu.

SWAPdmt serial port settings

Identify SWAP devices

Once SWAPdmt gets connected to the wireless network, the application continuously listens to any SWAP packet in the network. SWAPdmt sends queries in order to get the product code from the existing motes and checks these codes against the database of device description files (xml). This procedure lets SWAPdmt automatically discover devices, identifying them and their respective I/O resources.

SWAPdmt serial port settings

SWAPdmt basically consists in three panels:

SWAP network browser

This is a SWAP browsing tree containing every SWAP device detected in the network and its associated resources (registers, configuration parameters and endpoints). Parameters and motes can be edited from this tree by right-clicking on the corresponding branch.

Wireless packet sniffer

SWAP packets read by the serial gateway are displayed in this panel. Packet details can be displayed too by rignt-clicking on any SWAP frame.

Network events

Any event occurred in the SWAP network such as "New mote detected" or "Endpoint value changed" is displayed in this panel.

Device network settings

Devices->Network opens a configuration window that lets you configure the configuration registers that have to do with network connectivity on each wireless device (mote). Frequency channel, network id, device address, security and Tx interval are the most important network parameters when you need to add new motes to a SWAP network. Just remember that in order to connect to a given wireless device, SWAP gateway and wireless device must share the same network parameters, except address, that must be different.

As a side note, SWAP devices, including serial gateways, can take any address from 1 to 255. 0 is reserved as broadcast address.

SWAPdmt serial port settings

After pressing OK SWAPdmt checks the availability of the wireless device. If the device is supposed to be sleeping – mostly happening on battery-operated devices – the user will be asked to manually put the device into SYNC mode. This action will awake the wireless mote from its sleeping state and will let the mote receive the necessary wireless commands before leaving the SYNC state again.

Configuring custom settings

The configuration procedure is quite straightforward. First click on Devices->Custom Settings and then select "your wireless device from the list. This action will tell SWAPdmt which settings to edit. Then, the configuration tool will sequentially prompt the user for the required values. At the end, SWAPdmt will ask the user to put his device in SYNC mode, probably pressing a button.

The magics behind this procedure resides in the existence of a XML definition file for each type of mote. Every XML file defines the position of each register within the device, bit length, data type and the way to filter the user input.

SWAPdmt serial port settings

Anti Swap

API for Anti Swap

Clone this wiki locally