Skip to content

Commit

Permalink
Merge pull request #5351 from cgundogan/pr/make/iotlab_log
Browse files Browse the repository at this point in the history
dist: make: iotlab: add logging to iotlab-term via tmux
  • Loading branch information
cgundogan committed May 4, 2016
2 parents ec80efd + 7b1fc8c commit efb16ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
20 changes: 18 additions & 2 deletions dist/testbed-support/Makefile.iotlab
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ iotlab-exp: $(IOTLAB_AUTH) all
$(eval NEW_ID := $(shell experiment-cli submit -d $(IOTLAB_DURATION) $(NODES_PARAM) -n $(IOTLAB_EXP_NAME) | grep -Eo '[[:digit:]]+'))
$(AD)experiment-cli wait -i $(NEW_ID)

ifdef $(IOTLAB_LOGGING)
$(AD)ssh -t $(IOTLAB_AUTHORITY) "tmux new -d -s riot-$(NEW_ID)\
'script -fac "'"'"serial_aggregator -i $(NEW_ID)"'"'"\
RIOT_LOG-$(IOTLAB_EXP_NAME)-$(NEW_ID)'"
endif

iotlab-flash: $(IOTLAB_AUTH) iotlab-check-exp all
$(AD)node-cli --update $(BINARY) -i $(IOTLAB_EXP_ID) $(NODES_PARAM_BASE) $(EXCLUDE_PARAM)

Expand All @@ -66,9 +72,19 @@ iotlab-term: iotlab-check-exp
$(AD)ssh -t $(IOTLAB_AUTHORITY) "test -f ~/.iotlabrc || auth-cli -u $(IOTLAB_USER)"

ifndef NODES_PARAM
$(AD)ssh -t $(IOTLAB_AUTHORITY) "serial_aggregator -i $(IOTLAB_EXP_ID)"
$(AD)ssh -t $(IOTLAB_AUTHORITY)\
"tmux attach -t riot-$(IOTLAB_EXP_ID) || tmux new -s riot-$(IOTLAB_EXP_ID)\
'$(if $(IOTLAB_LOGGING),\
script -fac "'"'"serial_aggregator -i $(IOTLAB_EXP_ID)"'"'"\
RIOT_LOG-$(IOTLAB_EXP_NAME)-$(IOTLAB_EXP_ID),\
serial_aggregator -i $(IOTLAB_EXP_ID))'"
else
$(AD)ssh -t $(IOTLAB_AUTHORITY) "serial_aggregator $(NODES_PARAM_BASE)"
$(AD)ssh -t $(IOTLAB_AUTHORITY)\
"tmux attach -t riot-$(IOTLAB_EXP_ID) || tmux new -s riot-$(IOTLAB_EXP_ID)\
'$(if $(IOTLAB_LOGGING),\
script -fac "'"'"serial_aggregator $(NODES_PARAM_BASE)"'"'"\
RIOT_LOG-$(IOTLAB_EXP_NAME)-$(IOTLAB_EXP_ID),\
serial_aggregator $(NODES_PARAM_BASE))'"
endif

iotlab-check-exp:
Expand Down
6 changes: 6 additions & 0 deletions dist/testbed-support/README.iotlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ brackets):
* IOTLAB_EXP_NAME (RIOT_EXP)
* IOTLAB_PHY_NODES
* IOTLAB_EXCLUDE_NODES
* IOTLAB_LOGGING

### Format of a Resource ID
Both variables `IOTLAB_PHY_NODES` and `IOTLAB_EXCLUDE_NODES` use the resource id
Expand Down Expand Up @@ -63,6 +64,8 @@ Note that the usage of `IOTLAB_PHY_NODES` ignores `IOTLAB_NODES`. It will also f
binary of the current application to all registered nodes. The name of the
experiment is set to "RIOT_EXP" or "RIOT_EXP_$(IOTLAB_EXP_NAME)"
if `IOTLAB_EXP_NAME` is defined.
If `IOTLAB_LOGGING` is set to `1`, then the output of all nodes will be logged on the server
into a file called "RIOT_LOG-<EXPNAME>-<EXPID>".

#### iotlab-flash

Expand All @@ -83,3 +86,6 @@ then you must specify the site with `IOTLAB_SITE`.

Uses ssh to login the user on the IoT-LAB server of the specified site and
start the `serial_aggregator` to communication with all registered nodes.
If `IOTLAB_LOGGING` is set to `1`, then closing the connection with `CTRL+C/D` will also quit
the logging process. Detach from the server-side tmux process with `CTRL+A-D`
(or as defined in your server-side `.tmux.conf` file)

0 comments on commit efb16ba

Please sign in to comment.