mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
49 lines
1.7 KiB
Makefile
49 lines
1.7 KiB
Makefile
.PHONY: iotlab-auth iotlab-exp iotlab-flash iotlab-reset iotlab-term
|
|
|
|
IOTLAB_NODES ?= 5
|
|
IOTLAB_DURATION ?= 30
|
|
IOTLAB_SITE ?= grenoble
|
|
IOTLAB_TYPE ?= m3:at86rf231
|
|
IOTLAB_AUTH ?= $(HOME)/.iotlabrc
|
|
IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH))
|
|
IOTLAB_EXP_ID ?= $(shell experiment-cli get -l --state Running | grep -m 1 '"id"' | grep -Eo '[[:digit:]]+')
|
|
IOTLAB_EXP_NAME ?= RIOT_EXP
|
|
|
|
IOTLAB_AUTHORITY := "$(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info"
|
|
|
|
ifneq (,$(findstring m3,$(IOTLAB_TYPE)))
|
|
BINARY := $(ELFFILE)
|
|
else
|
|
BINARY := $(HEXFILE)
|
|
endif
|
|
|
|
$(IOTLAB_AUTH):
|
|
auth-cli -u $(IOTLAB_USER)
|
|
|
|
iotlab-exp: $(IOTLAB_AUTH) all
|
|
ifneq (RIOT_EXP,$(IOTLAB_EXP_NAME))
|
|
$(eval IOTLAB_EXP_NAME := RIOT_EXP_$(IOTLAB_EXP_NAME))
|
|
endif
|
|
|
|
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
|
|
|
|
ifeq (,$(AD))
|
|
@echo "experiment-cli submit -d $(IOTLAB_DURATION) -l $(NODES_LIST) -n $(IOTLAB_EXP_NAME)"
|
|
endif
|
|
$(eval NEW_ID := $(shell experiment-cli submit -d $(IOTLAB_DURATION) -l $(NODES_LIST) -n $(IOTLAB_EXP_NAME) | grep -Eo '[[:digit:]]+'))
|
|
$(AD)experiment-cli wait -i $(NEW_ID)
|
|
|
|
iotlab-flash: $(IOTLAB_AUTH) all
|
|
$(AD)node-cli --update $(BINARY) -i $(IOTLAB_EXP_ID)
|
|
|
|
iotlab-reset: $(IOTLAB_AUTH)
|
|
$(AD)node-cli --reset -i $(IOTLAB_EXP_ID)
|
|
|
|
iotlab-term:
|
|
$(AD)ssh -t $(IOTLAB_AUTHORITY) "test -f ~/.iotlabrc || auth-cli -u $(IOTLAB_USER)"
|
|
$(AD)ssh -t $(IOTLAB_AUTHORITY) "serial_aggregator -i $(IOTLAB_EXP_ID)"
|