Skip to content

SWAPdmt (command line version)

dberenguer edited this page Oct 9, 2014 · 13 revisions

Introduction

This is the command-line version of the original graphical utility. This command-line application was developed in order to avoid most installation and compatibility problems of wxPython on recent versions of Windows. Due to its simplicity and ease of maintenance, SWAPdmt-cmd includes some features lacking in the GUI version, like control of regular outputs and wireless upload of firmware. SWAPdmt-cmd is in fact called to become the reference configuration tool for SWAP networks to the detriment of the GUI version.

SWAPdmt-cmd (SWAP Device Management Tool) is a command-line application designed to configure, read, control and upgrade SWAP nodes wirelessly. This application is based on pyswap and is entirely written in Python

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

At this point you should have all the necessary to run SWAPdmt from a terminal.

Usage

SWAPdmt can be run with or without parameters. If no parameter is passed as argument, SWAPdmt will take the necessary information from the (xml) configuration files in config/.

# python swapdmt.py

When passing arguments to the application, the config files will be updated with the new information. Running "python swapdmt.py --help" is the best way to check for possible arguments:

... python swapdmt.py --help usage: swapdmt.py [-h] [--port PORT] [--speed SPEED] [--channel CHANNEL] [--netid NETID] [--address ADDRESS] [--security SECURITY]

optional arguments: -h, --help show this help message and exit --port PORT Serial port connected to modem --speed SPEED Serial baud rate (bps) --channel CHANNEL RF channel --netid NETID Network ID --address ADDRESS SWAP address of modem --security SECURITY Security flag ...

Numeric parameters such as address, RF channel or Network ID can be passed either in decimal or hexadecimal format:

... python swapdmt.py --address 1 --netid 0x1234 --channel 0 ...

After calling SWAPdmt and once the SWAP server is initialized, you should see a ">>" prompt in the terminal. At this point you can enter any of the available interactive commands.

Interactive commands

Interactive mode is the normal mode of operation of SWAPdmt. This means that the SWAP server is running and that the application has control over the SWAP modem. When in this mode, the user has access to the full set of interactive commands. Running "help" will show all the available commands.

...

help SWAPdmt commands and syntax:

help Print help quit Quit application traffic <on|off> Print or hide SWAP traffic hexfile Enter hex file for SWAP firmware upgrade list nodes Print list of nodes detected in the SWAP network clear nodes Clear list of nodes detected in the SWAP network

node channel [<new_channel>] Print or set RF channel of node node netid [<new_netid>] Print or set SWAP network ID of node node address [<new_addr>] Print or set SWAP address of node node txinterval [<new_interval>] Print or set Tx interval of node node reg <reg_id> [<new_reg_value>] Print or set register value node details Print product details of node node restart Restart node (if it's not sleeping) node program Program node wirelessly with hex file ...

help

Print list of interactive commands and options.

quit

Quit application.

traffic

Display (traffic on) or hide (traffic off) wireless traffic (SWAP packets) getting to the modem and leaving the modem.

hexfile

Define path to the HEX file containing new firmware for a wireless node

list nodes

Print list of nodes previously detected in the SWAP network. SWAPdmt needs the nodes to be restarted at least once. Once detected, all node information is saved so that the utility will be able to interact with the node without having to rediscover it on each session. Calling "clear nodes" will empty the current list.

clear nodes

Empty list of discovered nodes. This is sometimes useful when you need to rediscover a node having the address of an old node.