WSageNt: Multiagent Platform for Wireless Sensor Networks

The WSageNt platform is capable to run agents in wireless sensor nodes - specificly MICAz and IRIS motes. Software is divided to two main parts - agent platform and interpreter of ALLL language (Agent Low Level Language).

The WSageNt core platform is programmed in TinyOS (version 2). Such platform can be run in TOSSIM simulation tool, so you can easily test basic agents via simulation scripts. This way of working with WSageNt is reccomended if you don't have motes fysicaly. We also provide supporting applications that are written in Java language and their main purpose is to send/recieve messages (and agents) to/from Wireless Sensor Network (WSN). All software that we offer on this page is under BDS license (see Licence section for more information).

Key features of WSageNt platform are:

  • Load/unload agent from/to mote (agent mobility).
  • Send/receive messages (communication of agents).
  • Interpret agent code written in ALLL language.
  • Written in TinyOS v2 (better compatibility to the future).
  • Open source and able to run in TOSSIM simulator.

Installation

The WSageNt is divided into separate packages. First one contains core WSageNt platform which is loaded to real motes or can be run in TOSSIM simulator. Second part is named Control Panel and it is supporting application that is able to send/ receive agents to/from WSN network.

Installation - core

Requirements
  • TinyOS 2.1.1
  • MICAz or IRIS motes (to deploy physicaly)
  • (optional for testing) Python 2.6 (or higher)
Downloads

WSageNt source code
ZIP download wsnagent(TOS=2.1.1).tar.gz
 
Copy of BaseStation source code (Intel license)
TGZ download BaseStation.zip

Installation guide
Download and unpack WSageNt sourcecode. Compile and load our platform to mote:
make micaz install,2 mib520,/dev/ttyUSB0
NOTE: We suppose MICAz platform, ID of mote is 2 and we are using mib520 programmer located in /dev/ttyUSB0 - change acordingly to your needs.




Use BaseStation application located in you TinyOS/apps installation directory. We have also placed a copy of this application on our page. Compile and load to mote ID 1:

make micaz install,1 mib520,/dev/ttyUSB0
NOTE: Basesttation should have always ID = 1. It will be usefull to other software parts that we provide.

Testing using TOSSIM

Locate file src/interpret/AgentC.nc and modify event ControlI.booted(). You can add strings to plan part (stack) using Zasobnik.push_str, to register and planbase using Tabulka.add_str methods.

Example:
  event void ControlI.booted() {
    char c[200];
    dbg_clear("Boot", "Boot: Mote booted at %s\n",sim_time_string());
    call PoleCntrl.start();

    if (TOS_NODE_ID == 1) {
      strcpy(c, "!(2,(asd))");
    }
    if (TOS_NODE_ID == 2) {
      strcpy(c, "$(l,(r,0))$(s)$(l,(r,1))");
    }

    call Zasobnik.push_str(c, (uint16_t)strlen(c));

    call ControlI.run();
  }
Compile in simulation mode:
make micaz sim
Modify src/test.py script (add or remove some node) and run it.

Installation - Control Panel and BSComm

Control Pnel is a Tomcat application that can send/recieve agents to/from WSN network through your web browser. It uses supporting low layer application BSComm, which what it can communicate through socket. BSComm is used there for storing messages from/to network in queue and for establishing communication protocol used in our core platform.

Requirements
  • Mysql 5
  • Java 1.6 (or higher)
  • Netbeans 6.7 (or higher)
  • hibernate-support library
  • ejb3-persistence library
  • mysql-connector library
  • TinyOS .jar file
  • Tomcat 6
  • Apache 2
  • Struts 2
  • Basestation programmed and connected to /dev/ttyUSB0
Downloads

BSComm source code
ZIP download BSComm.zip
 
Control Panel source code
TGZ download ControlPanel.zip

Installation guide

Create database named "wsagent" and username "wsagent" with rigts to acces this database. Password should be "hesloveslo".

Download and unpack BSComm and ControlPanel source code.

Open in Netbeans project BSComm and correct paths to libraries depending on your system. Change username and password to your database in your hibernate options (hibernate.cfg.xml file). Do the same for ControlPanel.

Build BSComm project and run jar file:
java -jar BSComm.jar serial@/dev/ttyUSB1:iris 7777
NOTE: We suppose IRIS platform basestation with communication port at /dev/ttyUSB1. Socket for communicating with control panel will be at 7777 port - change acordingly to your needs.

Install tomcat, create user with admin and manager privileges. For Ubuntu systems should be in /var/lib/tomcat6/conf/tomcat-users.xml file something like this:

<tomcat-users>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="magik" password="makej" roles="admin,manager"/>
</tomcat-users>

Permit operation with database for Tomcat. This file will grant all permissions. Put it into config directory (/var/lib/tomcat6/conf/policy.d in Ubuntu).

Open your web browser and go to "localhost:8080". Start manager and login with user that is able to administrate projects (magik from an example). Deploy ControlPanel.war file with modified connection settings to your database (file hibernate.cfg.xml).

Start and open web page with Control Panel, it should run now:-)

Screenshots

screenshot1.png

Related publications

  • Horacek Jan, Zboril Frantisek: WSageNt: A case study, In: Proceedings of CSE 2010 International Scientific Conference on Computer Science and Engineering, Košice, SK, TU v Košiciach, 2010, p. 258-264, ISBN 978-80-8086-164-3
  • Zboril Frantisek, Horacek Jan, Spacil Pavel: Intelligent Agent Platform and Control Language for Wireless Sensor Networks, In: Proceedings of 3rd EMS, Athens, GR, IEEE CS, 2009, p. 6, ISBN 978-0-7695-3886-0
  • Zboril Frantisek, Spacil Pavel: Automata for Agent Low Level Language Interpretation, In: Proceedings of UKSim 2009, Cambridge, GB, IEEE CS, 2009, p. 6, ISBN 978-0-7695-3593-7

License

This software is licensed under the BUT OPEN SOURCE LICENCE (EN, CZ), full text of the licence follows:

BUT OPEN SOURCE LICENCE
Version 1.
Copyright (c) 2010, Brno University of Technology, Antoninska 548/1, 601 90, Czech Republic

---------------------------------------------------------------------------------------------------------------------------------------------------

BY INSTALLING, COPYING OR OTHER USES OF SOFTWARE YOU ARE DECLARING THAT YOU AGREE WITH THE TERMS AND CONDITIONS OF THIS LICENCE AGREEMENT. IF YOU DO NOT AGREE WITH THE TERMS AND CONDITIONS, DO NOT INSTAL, COPY OR USE THE SOFTWARE.

IF YOU DO NOT POSESS A VALID LICENCE, YOU ARE NOT AUTHORISED TO INSTAL, COPY OR OTHERWISE USE THE SOTWARE.

Definitions:

For the purpose of this agreement, Software shall mean a computer program (a group of computer programs functional as a unit) capable of copyright protection and accompanying documentation.

Work based on Software shall mean a work containing Software or a portion of it, either verbatim or with modifi-cations and/or translated into another language, or a work based on Software. Portions of work not containing a portion of Software or not based on Software are not covered by this definition, if it is capable of independent use and distributed separately.

Source code shall mean all the source code for all modules of Software, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable program. Source code distri-buted with Software need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable program runs.

Anyone who uses Software becomes User. User shall abide by this licence agreement.

BRNO UNIVERSITY OF TECHNOLOGY GRANTS TO USER A LICENCE TO USE SOFTWARE ON THE FOLLOWING TERMS AND CONDITIONS:

    1. User may use Software for any purpose, commercial or non-commercial, without a need to pay any li-cence fee.
    2. User may copy and distribute verbatim copies of executable Software with source code as he/she re-ceived it, in any medium, provided that User conspicuously and appropriately publishes on each copy an appropriate copyright notice and disclaimer of warranty; keeps intact all the notices that refer to this li-cence and to the absence of any warranty; and give any other recipients of Software a copy of this licence along with Software. User may charge a fee for the physical act of transferring a copy, and may offer war-ranty protection in exchange for a fee.
    3. User may modify his/her copy or copies of Software or any portion of it, thus forming a work based on Software, and copy and distribute such modifications or work, provided that User clearly states this work is modified Software. These modifications or work based on software may be distributed only under the terms of section 2 of this licence agreement, regardless if it is distributed alone or together with other work. Previous sentence does not apply to mere aggregation of another work not based on software with Software (or with a work based on software) on a volume of a storage or distribution medium.
    4. User shall accompany copies of Software or work based on software in object or executable form with:
        a) the complete corresponding machine-readable source code, which must be distributed on a medium customarily used for software interchange; or,
        b) written offer, valid for at least three years, to give any third party, for a charge no more than actual cost of physically performing source distribution, a complete machine-readable copy of the corres-ponding source code, to be distributed on a medium customarily used for software interchange; or,
        c) the information User received as to the offer to distribute corresponding source code. (This alterna-tive is allowed only for noncommercial distribution and only if User received the program in objects code or executable form with such an offer, in accord with subsection b above.)
    5. User may not copy, modify, grant sublicences or distribute Software in any other way than expressly pro-vided for in this licence agreement. Any other copying, modifying, granting of sublicences or distribution of Software is illegal and will automatically result in termination of the rights granted by this licence. This does not affect rights of third parties acquired in good faith, as long as they abide by the terms and condi-tions of this licence agreement.
    6. User may not use and/or distribute Software, if he/she cannot satisfy simultaneously obligations under this licence and any other pertinent obligations.
    7. User is not responsible for enforcing terms of this agreement by third parties.
    8. BECAUSE SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHER-WISE STATED IN WRITING, BUT PROVIDES SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,EITHER EXPRESSED OR IMPLIED,INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU-LAR PURPOSE.THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF SOFT-WARE IS WITH USER. SHOULD SOFTWARE PROVE DEFECTIVE, USER SHALL ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
       IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL BRNO UNIVERSITY OF TECHNOLOGY BE LIABLE FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF SOFTWARE TO OPERATE WITH ANY OTHER PRO-GRAMS). 

Final provisions:
Any provision of this licence agreement that is prohibited, unenforceable, or not authorized in any jurisdiction shall, as to such jurisdiction, be ineffective to the extent of such prohibition, unenforceability, or non-authorization without invalidating or affecting the remaining provisions.
This licence agreement provides in essentials the same extent of rights as the terms of GNU GPL version 2 and Software fulfils the requirements of Open Source software.
This agreement is governed by law of the Czech Republic. In case of a dispute, the jurisdiction shall be that of courts in the Czech Republic.
By installing, copying or other use of Software User declares he/she has read this terms and conditions, under-stands them and his/her use of Software is a demonstration of his/her free will absent of any duress.

Authors

Jan Horacek (primary contact)
http://www.fit.vutbr.cz/~ihoracek/
ihoracek@fit.vutbr.cz
 
Frantisek Zboril
http://www.fit.vutbr.cz/~zborilf/
zborilf@fit.vutbr.cz
 
Martin Gabor
As master thesis of Control Panel
 

Bug reporting

... via email to ihoracek@fit.vutbr.cz

Acknowledgement

This project was developed with support coming from:

  • The grant BUT FIT-10-S-1 of the Brno University of Technology, Faculty of Information Technology.
  • The research plan CEZ MSM 0021630528 of the Czech Ministry of Education.
  • The research plan GP102/07/P431 of GACR.