diff --git a/hello_world_experiment.sh b/hello_world_experiment.sh index 46fd80a..c17299b 100755 --- a/hello_world_experiment.sh +++ b/hello_world_experiment.sh @@ -6,22 +6,24 @@ if [ -n "$IOT_LAB_FRONTEND_FQDN" ]; then source /opt/riot.source fi - build_firmware ${SENSE_HOME}/tutorials_riotos/hello-world +build_status=$? +if [ $build_status -ne 0 ]; then + exit $build_status +fi echo tutorials_riotos/hello-world/bin/${ARCH}/hello-world.elf -NODE=361 - -exit 0 +NODE=100 if [ -n "$IOT_LAB_FRONTEND_FQDN" ]; then cp tutorials_riotos/hello-world/bin/${ARCH}/hello-world.elf ${SENSE_FIRMWARE_HOME} - n_json=$(iotlab-experiment submit -n hello_gp_12 -d 1 -l grenoble,m3,${NODE},${SENSE_FIRMWARE_HOME}/hello-world.elf) + n_json=$(iotlab-experiment submit -n hello_gp_12 -d 5 -l grenoble,m3,${NODE},${SENSE_FIRMWARE_HOME}/hello-world.elf) n_node_job_id=$(echo $n_json | jq '.id') create_stopper_script $n_node_job_id wait_for_job "${n_node_job_id}" + echo "$ nc m3-${NODE} 20000" echo "$ help" echo "$ restart" nc m3-${NODE} 20000 diff --git a/tutorials_riotos/hello-world/Makefile b/tutorials_riotos/hello-world/Makefile index ac8f091..3bc9e32 100644 --- a/tutorials_riotos/hello-world/Makefile +++ b/tutorials_riotos/hello-world/Makefile @@ -9,6 +9,8 @@ RIOTBASE ?= ../../external/RIOT USEMODULE += shell USEMODULE += shell_cmds_default +USEMODULE += ps +USEMODULE += ztimer_msec # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the diff --git a/tutorials_riotos/hello-world/main.c b/tutorials_riotos/hello-world/main.c index 9527dd7..3efadd6 100644 --- a/tutorials_riotos/hello-world/main.c +++ b/tutorials_riotos/hello-world/main.c @@ -1,35 +1,24 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup examples - * @{ - * - * @file - * @brief Hello World application - * - * @author Kaspar Schleiser <kaspar@schleiser.de> - * @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de> - * - * @} - */ - #include <stdio.h> +#include "ztimer.h" int main(void) { - puts("Hello World!"); - puts("##########################################"); - puts("####### This is group 12 talking #########"); - puts("##########################################"); + int sequence = 0; + while (1) + { + puts(""); + puts("#-------------------------------------------------------#"); + printf("#----- This is group 12 talking Hello world - (%4d) --#\n", sequence); + puts("#-------------------------------------------------------#\n"); + + printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD); + printf("This board features a(n) %s MCU.\n", RIOT_MCU); + sequence += 1; + if (sequence > 1000) { + sequence = 0; + } + ztimer_sleep(ZTIMER_MSEC, 1000); + } - printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD); - printf("This board features a(n) %s MCU.\n", RIOT_MCU); - return 0; }