SwissQM Homepage Information and Communication Systems Research Group ETH Zurich

previous: Query Interface

Bytecode Assembly Interface

This gateway application provides a low-level interface to SwissQM. Programs written in SwissQM's bytecode assembly language can be disseminated into the sensor networks where they are executed by the SwissQM Virtual Machine. Result tuples generated by these programs are sent back to the gateway and can be logged into a database and/or a simple log file.

The QM programs are written in SwissQM assembly language and are stored in .s files. A set of example files are provided in source code distribution of the gateway software in the subfolder asmprogs. It contains the following programs:

See the Instruction Set Card for details about the instruction semantics. A detailed explanation can be found in the EuroSys paper.

Starting the Wireless Sensor Network

Power-up all your nodes. Nodes will turn on their green LED if they have a link to the root, which is required for proper operation. The root node (node with ID 0) will not turn on the green LED, as it has always a connection to itself. You should wait until the green LED of every node except the root node is lit.

Connect the root node to the machine on which you run the gateway.

Starting the Gateway

Change to the folder SwissQM-gateway, where you built and configured the gateway and run

ant asmgui

This will bring up the graphical user interface of the SwissQM Bytecode Assembler, as shown below.

Network Tab of SwissQM Bytecode Assembly Interface

Working with the Bytecode Assembly Interface of SwissQM

The Bytecode Assembly Interface can be used to sent QM programs into the network, and retrieve result data. The results are shown in a table in the GUI and/or logged into a database for offline analysis. For each program another tab is created that shows the result data.

Network Tab

The network tab is shown when SwissQM is started (see screenshot above). The left column shows the programs that are currently executing in the network. The right column shows the commands that can be sent to SwissQM. A command can sent to be executed by one specific node or by all nodes of the network. In the former case type the ID of the target node in to the Node text field, in the latter check the All Nodes checkbox. Note that when applying the command to all nodes the TinyOS broadcast address 0xffff (65535) is used. Currently supported commands are Node Reset and setting the LEDs of the nodes. For setting the LEDs use the value and the mask check box. The bits set in the mask determine which LEDs are affected by the command.

Injecting a new Program

Program stored in .s files can be opened by pressing the New button in the Network tab. Then a file open dialog appears (note: the default directory of this dialog can be configured in swissqm.properties by the key ch.ethz.inf.swissqm.asmdirectory). The assembly file is then parsed. Parsing errors, assembler errors and warnings are then showed in an error dialog. Warnings can be ingnored, errors must be corrected in the source file. Pressing the Retry button restarts the parsing process.

Error dialog shows parser error

If the file is sucessfully parsed and is semantically correct the following field selection dialog is displayed.

Selection of logged fields in SwissQM's Bytecode Assembly interface

The Field Selection dialog shows the fields of the result tuples generated by the program (specified in the .tupleformat directive in the assembly program). These tuple fields can be selected to be logged in a file and/or database table. All fields are also display in the result table in the program tab once the program is started. Database logging and file logging can be enabled or disabled globally using the two checkboxes Log into DB and Log into file. Depending of this selection the DB and file columns for the fields are enabled for selection. Note, if database logging is disabled in swissqm.propeties it remains disabled and cannot be re-enabled in this dialog. Specify the name of the file and the database table for the logging you want use the specific logging mechanism. Log files are written using tab separators. The program is injected by pressing the Run button, then a new Program tab is opened, which shows the result tuples received from the network.

Selection of logged fields in SwissQM's Bytecode Assembly interface

Bytecode Programs can be executed concurrently. The executed bytecode programs are shown in the QM Programs table in the network tab. For each program a tab showing the result tuples is created.

Multiple concurrently executed bytecode programs

previous: Query Interface  

Last update: January 27th, 2007

Valid XHTML 1.0 Strict

!!! Dieses Dokument stammt aus dem ETH Web-Archiv und wird nicht mehr gepflegt !!!
!!! This document is stored in the ETH Web archive and is no longer maintained !!!