How to...
Load a task graph
To load some of the existing examples, go to the menu item "Import from library...", and select the name of the example.
To add a new task graph to this menu, put the saved JSON file under profun/frontend/lib/flows
and restart the server.
You can also load JSON code directly: selection "Import from clipboard...".
If "Clear before import" is checked, the current model is replaced; if it is not checked, the models are merged.
Find the file of the last saved task graph
After you press "Save", the task graph will network and all the options is written in a file on the server. The file is stored under profun/frontend/
and is name flows_<hostname>.json
. For example, on my computer the name is flows_atis-work.json
. The file is a simple JSON object.
Clear everything
Use the "Clear all" menu item.
Warning: this clears not only the task graph and the network, but also all options and configuration objects (template, constraints, partitions).
Reset the state of the network
Use the "Clear dynamic state" menu item.
This is useful to clear the dynamic constraints automatically set up after some faults have been detected.
The dynamic state of a task can be seen in "Status" tab in its configuration dialog.
Setup tasks on a real network
Run the gateway server using a configuration file that contains the serial ID of the gateway mote. The ID can be found using motelist
.
cd scripts/gateway nano my-config.json ./gw.py my-config.json
Setup tasks on simulator
Run the gateway server with a predefined configuration file:
cd scripts/gateway ./gw.py preset/config-simulator.json
Collect data from gateway server
Issue a HTTP GET request to the query server to get a JSON array that contains the names of sensors and values of their readings.
Append sensors
parameter to query string with the names of the sensors that you want to collect. The format is a comma-separated list (e.g. sensors=light,humidity
).
Append timestamp
to query string to limit the number of data items collected: only data newer than the timestamp is returned. Note that the timestamp is compared to the current time on the gateway server, which might be unsynchronized with the time of your client. For example, if you issue periodic requests to collect all new data, use the timestamp received in the last response for the new request.
Example command:
curl http://localhost:12100/?sensors=light,humidity×tamp=1449656555
Returns:
[{"sensor": "light", "values": []}, {"sensor": "humidity", "values": []}]