Hi, I'm stuck.. I need some help...
In simulation, using TOSSIM, the SQL SELECT statement in TinyDB does
not return the actual attribute values in the SimObject. How can I get
the SELECT statement using TinyDB to return the actual, unchanged
attribute values stored in the SimObjects representing the motes?
Problem Description: I created a sensor environment an initialized a
sensor attribute, “temp”, to 20 on every mote. Then I used TinyDB to
query the sensor attribute values via an SQL statement: SELECT nodeid,
temp FROM SENSORS
The values returned from TOSSIM are not those saved in the attribute
variables.
The values in the SimObjects representing the motes are not changed.
How can I get the SELECT statement using TinyDB to return the actual
attribute values stored in the SimObjects?
……………..Here’s my scenario: …………………………….
# Start the TOSSIM Driver
Java net.tinyos.sim.SimDriver
# Start the simulated application for TinyDB tuplerouter to run on the
motes
TinyDBApp = "/opt/tinyos-1.x/apps/TinyDBApp/build/pc/main.exe"
sim.exec(TinyDBApp, worldMoteCount, "-b=1 -l=1.0")
#Add sensor attributes with values to each mote
for moteID in range (0, worldMoteCount-1):
TempAttribute = SensorAttribute(“temp”,20)
simcore.motes[moteID].addAttribute(“temp”, TempAttribute)
# Start the TinyDB environment on the ‘PC’ side of the simulation
TinyDBMain.simulate = True;
TinyDBMain.initMain()
# Resume the simulation after it is paused by TinyDBMain.
sim.resume()
# The result returned by TOSSIM is the sensor information originally
set in the mote: 20.
simcore.motes[x].getAttribute(“temp”)
# I query the sensor environment using TinyDB. Sending an SQL (SELECT
nodeid, temp FROM SENSORS) string to be parsed into a TinyDBQuery and
injecting that query into the network via TinyDBMain and TinyDBNetwork
setupQuery = Query(“SELECT nodeid, temp FROM SENSORS”, epochCount)
setupQuery.startQuerying()
The results I get are a series of results for each epoch where the temp
attribute value is changed randomly.
ex. Mote[1] had a value of 400, 367, 500,..
# After the query, the sensor information in the mote, is still the
original value: 20
simcore.motes[x].getAttribute(“temp”)
........................................................................
............
Thanks,
Marguerite Doman
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help