-
Notifications
You must be signed in to change notification settings - Fork 1
Experimentation Scripts 0.8
- Create an Account
-
Get the Client
- Download here
-
Set up a Configuration File
- See detailed instructions below
- In the following denoted as
live.properties
-
Make a Reservation
- Choose nodes (eg list all isense nodes)
./wb-list-node-urns live.properties csv isense
* Reserve nodes (eg for for 30 minutes beginning in 10 minutes)
./wb-reserve ../live.properties 30 10 urn:wisebed:uzl1:0xcbe4,urn:wisebed:uzl1:0xcbe5
* Write down the secret reservation key you get
-
Flash Nodes
- Flash your image (eg iseraerial-isense.bin)
./wb-flash live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 iseraerial-isense.bin csv urn:wisebed:uzl1:0xcbe4,urn:wisebed:uzl1:0xcbe5
-
View the Results
- Get output (from the UART of your nodes) while the experiment is running
./wb-listen live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 csv
-
Start from Scratch
- Reset testbed to the state it was before your experiment
./wb-free live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900
Testbed Runtime provides a set of bash-scripts that trigger the execution of various BeanShell scripts by the Scripting Client 0.8. You can download the 0.8 version here. Then, unpack it by running:
tar xvzf tr.experimentation-scripts-0.8.tar.gz
The extracted directory contains the following subdirectories:
bin
lib
scripts
The directory bin
contains the executable bash scripts described below, lib
contains the Scripting Client 0.8 used to execute the BeanShell scripts and scripts
contains the BeanShell scripts that are being passed to the Scripting Client 0.8 upon invocation of one of the bash scripts from the bin
directory.
All scripts can be used in a similar way: the first argument is always a property file that contains the actual endpoint URLs of the WISEBED testbed to be used and the users' credentials. Here's an example of such a configuration file:
testbed.snaa.endpointurl = http://wisebed.itm.uni-luebeck.de:8890/snaa
testbed.rs.endpointurl = http://wisebed.itm.uni-luebeck.de:8889/rs
testbed.sm.endpointurl = http://wisebed.itm.uni-luebeck.de:8888/sessions
testbed.urnprefixes = urn:wisebed:uzl1:
testbed.usernames = [email protected]
testbed.passwords = yourpasswordhere
testbed.protobuf.hostname = wisebed.itm.uni-luebeck.de
testbed.protobuf.port = 8885
The first three lines point to the endpoint URLs of the SNAA, RS and SessionManagement endpoints of the specific testbed on which to conduct experiments. The property testbed.urnprefixes
contains the URN prefix which is served by the testbeds' endpoint (note the colon :
at the end of the value, e.g. urn:wisebed:uzl1:
!). If you are unsure which URN prefix your testbed is serving just check which prefix the individual node URNs have in common. Usually the URN prefix is concatenated with a nodes' MAC address so that, e.g. for a given node URN urn:wisebed:uzl1:0x1234
of a node with MAC address 0x1234
the testbeds' URN prefix is urn:wisebed:uzl1:
.
Lines 6 and 7 contain the users' credentials.
The properties testbed.protobuf.hostname
and testbed.protobuf.port
are optional. They are used by the unofficial protocol buffers based WISEBED API implemented by Testbed Runtime that allows to use the testbed without public IP and being firewalled as all communication happens through a client-initiated bidirectional TCP connection unlike the official APIs. If these properties are set the usage of this unofficial API is tried first and, if this doesn't work, the Web Service-based API is tried.
For Windows Users: If you're running Windows without Cygwin (i.e. you can not execute unix shell scripts) you can use the Alternative Invocation method which is described for every script. Unfortunately, there are no batch scripts until today.
Calls [WSN.areNodesAlive()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#areNodesAlive(java.util.List<java.lang.String>)) to check for a sensor nodes liveness.
./wb-are-nodes-alive PROPERTIES_FILE SECRET_RESERVATION_KEYS [csv|lines] [NODEURNS]
./wb-are-nodes-alive live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 csv urn:wisebed:uzl1:0xf859,urn:wisebed:uzl1:0xf860
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.listtype=[csv|lines] \
-Dtestbed.nodeurns=NODEURNS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-are-nodes-alive.java
Calls [SessionManagement.areNodesAlive()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/sm/SessionManagement.html#areNodesAlive(java.util.List<java.lang.String>, java.lang.String)) to check for a sensor nodes liveness.
./wb-are-nodes-alive-sm PROPERTIES_FILE [NODEURNS]
./wb-are-nodes-alive-sm live.properties urn:wisebed:uzl1:0xf859,urn:wisebed:uzl1:0xf860
java \
-Dtestbed.listtype=[csv|lines] \
-Dtestbed.nodeurns=NODEURNS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-are-nodes-alive-sm.java
Calls [WSN.destroyVirtualLink()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#destroyVirtualLink(java.lang.String, java.lang.String)) to remove a virtual link.
./wb-destroy-virtual-link PROPERTIES_FILE SECRET_RESERVATION_KEYS SOURCE_NODE_URN TARGET_NODE_URN [csv|lines]
./wb-destroy-virtual-link live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 urn:wisebed:uzl1:0xf859 urn:wisebed:uzl1:0xf860 csv
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.vlink.from=SOURCE_NODE_URN \
-Dtestbed.vlink.to=TARGET_NODE_URN \
-Dtestbed.listtype=[csv|lines] \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-destroy-virtual-link.java
Calls [WSN.flashPrograms()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#flashPrograms(java.util.List<java.lang.String>, java.util.List<java.lang.Integer>, java.util.List<eu.wisebed.api.wsn.Program>)) to reprogram devices.
./wb-flash PROPERTIES_FILE SECRET_RESERVATION_KEYS IMAGE [lines|csv] [NODEURNS]
./wb-flash live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 iseraerial-isense.bin csv urn:wisebed:uzl1:0xcc3d,urn:wisebed:uzl1:0xcc3e
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.image=IMAGE \
-Dtestbed.listtype=[lines|csv] \
-Dtestbed.nodeurns=NODEURNS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE
-f scripts/wb-flash.java
Calls [SessionManagement.free()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/sm/SessionManagement.html#free(java.util.List<eu.wisebed.api.sm.SecretReservationKey>)) to "free" the testbed back end from all experiment specific data such as pipeline or virtual link configurations. Sets back the state of the testbed back end to what it was when the experiment (i.e. the reservation time slot) started.
./wb-free PROPERTIES_FILE SECRET_RESERVATION_KEYS
./wb-free live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-free.java
Calls [WSN.getSupportedChannelHandlers()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#getSupportedChannelHandlers(\)) and pretty-prints the returned data.
./wb-get-supported-channelhandlers PROPERTIES_FILE SECRET_RESERVATION_KEYS
./wb-get-supported-channelhandlers live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-get-supported-channelhandlers.java
prints the supported channel handlers that can be configured into the backend by calling the set-channel-pipeline
script. The name
value in the example below corresponds to the value of the factory
attribute of the handler
tag in the XML configuration file of the set-channel-pipeline
script (see above). The configurationOptions
values correspond to what can be set as options in the corresponding handler
tags.
ChannelHandler {
name="isense-otap"
description="The module implements over-the-air-programming (OTAP) functionality to program a set of iSense nodes from coalesenses wirelessly. The nodes must be in single-hop range of the node that is connected to this pipeline. The connected sensor must have iSerAerial functionality enabled while the to-be-programmed devices must be OTAP-capable. Also see https://github.com/itm/netty-handlerstack/wiki/ISense-over-the-air-programming-Protocol."
configurationOptions={
key="timeoutMultiplier", description="(short, optional, default=1000)"
key="maxRerequests", description="(short, optional, default=30)"
key="timeunit", description="(int, optional, default=MILLISECONDS)"
key="threadCount", description="(int, optional, default=10)"
key="deviceTimeout", description="(int, optional, default=160*presenceDetectInterval)"
key="presenceDetectInterval", description="(int, optional, default=2000)"
}
}
ChannelHandler {
name="dlestxetx-framing-encoder"
description="Wraps an incoming ChannelBuffer with DLE STX (0x10 0x02) and DLE ETX (0x10 0x03) and does byte stuffing inside the ChannelBuffer (i.e. escape every DLE with another DLE). Also see https://github.com/itm/netty-handlerstack/wiki/DLESTXETX-Framing-Decoder-Encoder."
configurationOptions={}
}
ChannelHandler {
name="dlestxetx-framing-decoder"
description="Unwraps a ChannelBuffer instance that is wrapped with DLE STX (0x10 0x02) and DLE ETX (0x10 0x03) and does byte unstuffing (i.e. bytes of value DLE that were escaped with another DLE have the escape character removed. Also See https://github.com/itm/netty-handlerstack/wiki/DLESTXETX-Framing-Decoder-Encoder."
configurationOptions={}
}
...
Calls [SessionManagement.getNetwork()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/sm/SessionManagement.html#getNetwork(\)), parses the returned WiseML, extracts and prints information about all nodes.
./wb-list-node-details PROPERTIES_FILE [NODE_TYPES]
./wb-list-node-details live.properties isense,telosb
java \
-Dtestbed.nodetypes=NODE_TYPES \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-list-node-details.java
Calls [SessionManagement.getNetwork()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/sm/SessionManagement.html#getNetwork(\)), parses the returned WiseML, extracts and prints all node-urns.
./wb-list-node-urns PROPERTIES_FILE [csv|lines] [NODE_TYPES]
./wb-list-node-urns live.properties csv isense,telosb
java \
-Dtestbed.listtype=[csv|lines] \
-Dtestbed.nodetypes=NODE_TYPES \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-list-node-urns.java
Calls [WSN.getNetwork()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#getNetwork(\)), parses the returned WiseML, extracts and prints information about all nodes.
./wb-list-reserved-node-details PROPERTIES_FILE SECRET_RESERVATION_KEY [NODE_TYPES]
./wb-list-reserved-node-details live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 isense,telosb
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.nodetypes=NODE_TYPES \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-list-reserved-node-details.java
Calls [WSN.getNetwork()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#getNetwork(\)), parses the returned WiseML, extracts and prints all node-urns.
./wb-list-reserved-node-urns PROPERTIES_FILE SECRET_RESERVATION_KEY [csv|lines] [NODE_TYPES]
./wb-list-reserved-node-urns live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 csv isense,telosb
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.listtype=[csv|lines] \
-Dtestbed.nodetypes=NODE_TYPES \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-list-reserved-node-urns.java
Starts a Controller on the local host and connects to the running experiment. Prints out all data and notifications received. If the alternative unofficial protocol buffers based API is used no local Controller Web service is started but the asynchronous responses and node outputs come in through this TCP connection opened by the client.
./wb-listen PROPERTIES_FILE SECRET_RESERVATION_KEYS [lines|csv]
./wb-listen live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 csv
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.listtype=[lines|csv] \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-listen.java
Calls [RS.makeReservation()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/rs/RS.html#makeReservation(java.util.List<eu.wisebed.api.rs.SecretAuthenticationKey>, eu.wisebed.api.rs.ConfidentialReservationData)) to make a reservation with the given arguments.
./wb-reserve PROPERTIES_FILE DURATION_IN_MINUTES [OFFSET_IN_MINUTES] [NODE_URNS]
./wb-reserve ../live.properties 30 10 urn:wisebed:uzl1:0xcbe4
java \
-Dtestbed.duration=DURATION_IN_MINUTES \
-Dtestbed.offset=OFFSET_IN_MINUTES \
-Dtestbed.nodeurns=NODE_URNS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-reserve.java
Calls [WSN.resetNodes()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#resetNodes(java.util.List<java.lang.String>)) to reset the nodes.
./wb-reset PROPERTIES_FILE SECRET_RESERVATION_KEYS [lines|csv] [NODEURNS]
./wb-reset live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 csv urn:wisebed:uzl1:0xf859,urn:wisebed:uzl1:0xf860
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.listtype=[lines|csv] \
-Dtestbed.nodeurns=NODE_URNS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-reset.java
Calls [WSN.send()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#send(java.util.List<java.lang.String>, eu.wisebed.api.common.Message)) to send a binary message to the sensor node. Depending on the configuration of the channel pipeline (see Customizing the channel pipeline this data might be changed before being delivered to the sensor nodes UART.
Hint: MESSAGE consists of comma-separated bytes in base_10 (no prefix), base_2 (prefix 0b) or base_16 (prefix 0x)
./wb-send PROPERTIES_FILE SECRET_RESERVATION_KEYS MESSAGE [csv|lines] [NODEURNS]
./wb-send live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 0x0A,0x1B,0b11001001,40,40,0b11001001,0x1F csv urn:wisebed:uzl1:0xcc3d,urn:wisebed:uzl1:0xcc3e
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.message=MESSAGE \
-Dtestbed.listtype=[csv|lines] \
-Dtestbed.nodeurns=NODE_URNS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-send.java
Calls [WSN.setChannelPipeline()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#setChannelPipeline(java.util.List<java.lang.String>, java.util.List<eu.wisebed.api.wsn.ChannelHandlerConfiguration>)) to configure the back ends channel pipeline.
./wb-set-channel-pipeline PROPERTIES_FILE SECRET_RESERVATION_KEYS CONFIG_FILE [lines|csv] [NODEURNS]
./wb-set-channel-pipeline live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 handlerchain.xml urn:wisebed:uzl1:0xcc3d,urn:wisebed:uzl1:0xcc3e
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.configfile=CONFIG_FILE \
-Dtestbed.listtype=[lines|csv] \
-Dtestbed.nodeurns=NODEURNS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-set-channel-pipeline.java
The parameter CONFIG_FILE
contains an XML description of the protocol stack (i.e. the channel pipeline) that should be set for the individial node. An example of such a configuration can be seen below:
<itm-netty-handlerstack>
<handler factory="protocoly"/>
<handler factory="protocolx-encoder">
<option key="1" value="1"/>
<option key="2" value="2"/>
</handler>
<handler factory="protocolx-decoder">
<option key="11" value="11"/>
<option key="22" value="22"/>
</handler>
</itm-netty-handlerstack>
The order of the <handler>
-tags corresponds to the position of the protocol handler in the stack. Please check the netty-handlerstack project for the available handlers or invoke the get-channel-pipeline
script.
The parameter NODEURNS
can either be 1.) omitted, 2.) may contain a set of comma-separated node URNs or 3.) may contain the string "portal".
- If the parameter is omitted the channel pipeline will be set on all reserved node URNs, i.e. each node has the same channel pipeline configuration but each node has its own channel pipeline.
- If the parameter contains a set of node URNs only these node URNs will have their channel pipeline configured with the given configuration. Other nodes are left as they currently are.
- If the string "portal" is passed as argument there will be one channel pipeline with that configuration on the portal server of the testbed through which the traffic of all nodes will be flowing.
Calls [WSN.setVirtualLink()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#setVirtualLink(java.lang.String, java.lang.String, java.lang.String, java.util.List<java.lang.String>, java.util.List<java.lang.String>)) to set a unidirectional virtual link between a source node and a target node.
./wb-set-virtual-link PROPERTIES_FILE SECRET_RESERVATION_KEYS SOURCE_NODE_URN TARGET_NODE_URN [csv|lines]
./wb-set-virtual-link live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900 urn:wisebed:uzl1:0xf859 urn:wisebed:uzl1:0xf860 lines
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-Dtestbed.vlink.from=SOURCE_NODE_URN \
-Dtestbed.vlink.to=TARGET_NODE_URN \
-Dtestbed.listtype=[csv|lines] \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-set-virtual-link.java
Calls [WSN.getNetwork()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/wsn/WSN.html#getNetwork(\)) and pretty-prints the returned WiseML.
./show-wiseml PROPERTIES_FILE SECRET_RESERVATION_KEYS
./show-wiseml live.properties urn:wisebed:uzl1:,D2C88AEE416EDD2FD4038BC1252A8900
java \
-Dtestbed.secretreservationkeys=SECRET_RESERVATION_KEYS \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-show-reserved-wiseml.java
Calls [SessionManagement.getNetwork()](http://wisebed.eu/api/java/current/reference/eu/wisebed/api/sm/SessionManagement.html#getNetwork(\)) and pretty-prints the returned WiseML.
./wb-show-wiseml PROPERTIES_FILE
./wb-show-wiseml live.properties
java \
-jar lib/tr.scripting-client-0.8-onejar.jar \
-p PROPERTIES_FILE \
-f scripts/wb-show-wiseml.java