2015-03-18 19:03:26 +01:00
|
|
|
.PHONY: iotlab-auth iotlab-exp iotlab-flash iotlab-reset iotlab-term
|
|
|
|
|
|
|
|
IOTLAB_NODES ?= 5
|
|
|
|
IOTLAB_DURATION ?= 30
|
|
|
|
IOTLAB_SITE ?= grenoble
|
2015-09-07 10:13:26 +02:00
|
|
|
IOTLAB_TYPE ?= m3:at86rf231
|
2015-03-18 19:03:26 +01:00
|
|
|
IOTLAB_AUTH ?= $(HOME)/.iotlabrc
|
|
|
|
IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH))
|
2015-06-02 16:41:13 +02:00
|
|
|
IOTLAB_EXP_ID ?= $(shell experiment-cli get -l --state Running | grep -m 1 '"id"' | grep -Eo '[[:digit:]]+')
|
2015-07-28 11:43:52 +02:00
|
|
|
IOTLAB_EXP_NAME ?= RIOT_EXP
|
2015-03-18 19:03:26 +01:00
|
|
|
|
2015-09-02 18:17:32 +02:00
|
|
|
ifneq (,$(findstring m3,$(IOTLAB_TYPE)))
|
|
|
|
BINARY := $(ELFFILE)
|
|
|
|
else
|
|
|
|
BINARY := $(HEXFILE)
|
|
|
|
endif
|
|
|
|
|
2015-03-18 19:03:26 +01:00
|
|
|
$(IOTLAB_AUTH):
|
|
|
|
auth-cli -u $(IOTLAB_USER)
|
|
|
|
|
2015-08-05 19:07:33 +02:00
|
|
|
iotlab-exp: $(IOTLAB_AUTH) all
|
2015-07-28 11:43:52 +02:00
|
|
|
ifneq (RIOT_EXP,$(IOTLAB_EXP_NAME))
|
|
|
|
$(eval IOTLAB_EXP_NAME := RIOT_EXP_$(IOTLAB_EXP_NAME))
|
|
|
|
endif
|
2015-09-07 10:13:26 +02:00
|
|
|
|
|
|
|
ifndef IOTLAB_PHY_NODES
|
|
|
|
$(eval NODES_LIST := "$(IOTLAB_NODES),archi=$(IOTLAB_TYPE)+site=$(IOTLAB_SITE),$(BINARY),$(IOTLAB_PROFILE)")
|
|
|
|
else
|
|
|
|
$(eval NODES_LIST := "$(IOTLAB_SITE),$(firstword $(subst :, ,$(IOTLAB_TYPE))),$(IOTLAB_PHY_NODES),$(BINARY),$(IOTLAB_PROFILE)")
|
|
|
|
endif
|
|
|
|
|
2015-06-02 16:41:13 +02:00
|
|
|
ifeq (,$(AD))
|
2015-09-07 10:13:26 +02:00
|
|
|
@echo "experiment-cli submit -d $(IOTLAB_DURATION) -l $(NODES_LIST) -n $(IOTLAB_EXP_NAME)"
|
2015-06-02 16:41:13 +02:00
|
|
|
endif
|
2015-09-07 10:13:26 +02:00
|
|
|
$(eval NEW_ID := $(shell experiment-cli submit -d $(IOTLAB_DURATION) -l $(NODES_LIST) -n $(IOTLAB_EXP_NAME) | grep -Eo '[[:digit:]]+'))
|
2015-05-11 21:11:08 +02:00
|
|
|
$(AD)experiment-cli wait -i $(NEW_ID)
|
2015-03-18 19:03:26 +01:00
|
|
|
|
|
|
|
iotlab-flash: $(IOTLAB_AUTH) all
|
2015-09-02 18:17:32 +02:00
|
|
|
$(AD)node-cli --update $(BINARY) -i $(IOTLAB_EXP_ID)
|
2015-03-18 19:03:26 +01:00
|
|
|
|
|
|
|
iotlab-reset: $(IOTLAB_AUTH)
|
2015-05-11 21:11:08 +02:00
|
|
|
$(AD)node-cli --reset -i $(IOTLAB_EXP_ID)
|
2015-03-18 19:03:26 +01:00
|
|
|
|
|
|
|
iotlab-term:
|
2015-05-11 21:11:08 +02:00
|
|
|
$(AD)ssh -t $(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info "test -f ~/.iotlabrc || auth-cli -u $(IOTLAB_USER)"
|
|
|
|
$(AD)ssh -t $(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info "serial_aggregator -i $(IOTLAB_EXP_ID)"
|