From 2122ffdeeb57d8b4d8948a61b9ceb92f3e902952 Mon Sep 17 00:00:00 2001 From: wirstrom Date: Fri, 26 Jan 2018 11:48:27 +0100 Subject: [PATCH 01/11] Fixed alignment bug for msp430 --- examples/nullnet/nullnet-broadcast.c | 4 +++- examples/nullnet/nullnet-unicast.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/nullnet/nullnet-broadcast.c b/examples/nullnet/nullnet-broadcast.c index 9b7108a99..7bb1f1c87 100644 --- a/examples/nullnet/nullnet-broadcast.c +++ b/examples/nullnet/nullnet-broadcast.c @@ -66,7 +66,9 @@ void input_callback(const void *data, uint16_t len, const linkaddr_t *src, const linkaddr_t *dest) { if(len == sizeof(unsigned)) { - LOG_INFO("Received %u from ", *(unsigned *)data); + unsigned count; + memcpy(&count, data, sizeof(count)); + LOG_INFO("Received %u from ", count); LOG_INFO_LLADDR(src); LOG_INFO_("\n"); } diff --git a/examples/nullnet/nullnet-unicast.c b/examples/nullnet/nullnet-unicast.c index eb41ac973..5dd9d9fcd 100644 --- a/examples/nullnet/nullnet-unicast.c +++ b/examples/nullnet/nullnet-unicast.c @@ -68,7 +68,9 @@ void input_callback(const void *data, uint16_t len, const linkaddr_t *src, const linkaddr_t *dest) { if(len == sizeof(unsigned)) { - LOG_INFO("Received %u from ", *(unsigned *)data); + unsigned count; + memcpy(&count, data, sizeof(count)); + LOG_INFO("Received %u from ", count); LOG_INFO_LLADDR(src); LOG_INFO_("\n"); } From 1c0e76025b805e013072e53a881ab6083b0242c1 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Fri, 26 Jan 2018 22:56:29 +0100 Subject: [PATCH 02/11] fixed slip-radio config, added shell to NBR and added parsing to no-framer --- examples/slip-radio/slip-net.c | 2 +- examples/slip-radio/slip-radio.c | 38 +++++ os/net/mac/framer/nullframer.c | 35 ++++ .../rpl-border-router/native/Makefile.native | 2 + .../native/border-router-cmds.c | 161 ++++++++++++++---- .../native/border-router-mac.c | 6 +- os/services/slip-cmd/cmd.c | 7 +- os/services/slip-cmd/cmd.h | 2 +- 8 files changed, 217 insertions(+), 36 deletions(-) diff --git a/examples/slip-radio/slip-net.c b/examples/slip-radio/slip-net.c index e1efbf4cf..edf219106 100644 --- a/examples/slip-radio/slip-net.c +++ b/examples/slip-radio/slip-net.c @@ -64,7 +64,7 @@ slipnet_input(void) packetbuf_datalen(), i); for(i = 0; i < uip_len; i++) { - LOG_DBG("%02x", (unsigned char)uip_buf[i]); + LOG_DBG_("%02x", (unsigned char)uip_buf[i]); if((i & 15) == 15) { LOG_DBG_("\n"); } else if((i & 7) == 7) { diff --git a/examples/slip-radio/slip-radio.c b/examples/slip-radio/slip-radio.c index 53a0324bc..65f0bde43 100644 --- a/examples/slip-radio/slip-radio.c +++ b/examples/slip-radio/slip-radio.c @@ -166,6 +166,25 @@ slip_radio_cmd_handler(const uint8_t *data, int len) packet_pos = 0; } + return 1; + } else if(data[1] == 'V') { + int type = ((uint16_t)data[2] << 8) | data[3]; + int value = ((uint16_t)data[4] << 8) | data[5]; + int param = type; /* packetutils_to_radio_param(type); */ + if(param < 0) { + printf("radio: unknown parameter %d (can not set to %d)\n", type, value); + } else { + if(param == RADIO_PARAM_RX_MODE) { + printf("radio: setting rxmode to 0x%x\n", value); + } else if(param == RADIO_PARAM_PAN_ID) { + printf("radio: setting pan id to 0x%04x\n", value); + } else if(param == RADIO_PARAM_CHANNEL) { + printf("radio: setting channel: %u\n", value); + } else { + printf("radio: setting param %d to %d (0x%02x)\n", param, value, value); + } + NETSTACK_RADIO.set_value(param, value); + } return 1; } } else if(uip_buf[0] == '?') { @@ -180,6 +199,25 @@ slip_radio_cmd_handler(const uint8_t *data, int len) uip_len = 10; cmd_send(uip_buf, uip_len); return 1; + } else if(data[1] == 'V') { + /* ask the radio about the specific parameter and send it back... */ + int type = ((uint16_t)data[2] << 8) | data[3]; + int value; + int param = type; /* packetutils_to_radio_param(type); */ + if(param < 0) { + printf("radio: unknown parameter %d\n", type); + } + + NETSTACK_RADIO.get_value(param, &value); + + uip_buf[0] = '!'; + uip_buf[1] = 'V'; + uip_buf[2] = type >> 8; + uip_buf[3] = type & 0xff; + uip_buf[4] = value >> 8; + uip_buf[5] = value & 0xff; + uip_len = 6; + cmd_send(uip_buf, uip_len); } } return 0; diff --git a/os/net/mac/framer/nullframer.c b/os/net/mac/framer/nullframer.c index 3df8f6ea1..019ed2209 100644 --- a/os/net/mac/framer/nullframer.c +++ b/os/net/mac/framer/nullframer.c @@ -36,7 +36,27 @@ * Joakim Eriksson */ #include "net/mac/framer/framer.h" +#include "net/packetbuf.h" +#ifdef NULLFRAMER_CONF_PARSE_802154 +#define NULLFRAMER_PARSE_802154 NULLFRAMER_CONF_PARSE_802154 +#else +/* defaults to parsing of the 802154 header as that is used for Slip-Radio */ +#define NULLFRAMER_PARSE_802154 1 +#endif + +/*---------------------------------------------------------------------------*/ +static int +is_broadcast_addr(uint8_t mode, uint8_t *addr) +{ + int i = mode == FRAME802154_SHORTADDRMODE ? 2 : 8; + while(i-- > 0) { + if(addr[i] != 0xff) { + return 0; + } + } + return 1; +} /*---------------------------------------------------------------------------*/ static int hdr_length(void) @@ -55,6 +75,21 @@ create(void) static int parse(void) { +#if NULLFRAMER_PARSE_802154 + frame802154_t frame; + int len; + len = packetbuf_datalen(); + if(frame802154_parse(packetbuf_dataptr(), len, &frame)) { + if(frame.fcf.dest_addr_mode) { + if(!is_broadcast_addr(frame.fcf.dest_addr_mode, frame.dest_addr)) { + packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, (linkaddr_t *)&frame.dest_addr); + } + } + packetbuf_set_addr(PACKETBUF_ADDR_SENDER, (linkaddr_t *)&frame.src_addr); + packetbuf_set_attr(PACKETBUF_ATTR_MAC_SEQNO, frame.seq); + return 0; + } +#endif return 0; } /*---------------------------------------------------------------------------*/ diff --git a/os/services/rpl-border-router/native/Makefile.native b/os/services/rpl-border-router/native/Makefile.native index 62f7221a0..f4c2fb5b9 100644 --- a/os/services/rpl-border-router/native/Makefile.native +++ b/os/services/rpl-border-router/native/Makefile.native @@ -1,8 +1,10 @@ MODULES += os/services/slip-cmd +MODULES += os/services/shell MAKE_MAC = MAKE_MAC_OTHER MAKE_NET = MAKE_NET_IPV6 + PREFIX ?= fd00::1/64 connect-router: border-router.native sudo ./border-router.native $(PREFIX) diff --git a/os/services/rpl-border-router/native/border-router-cmds.c b/os/services/rpl-border-router/native/border-router-cmds.c index 75788a920..a32ac6dd6 100644 --- a/os/services/rpl-border-router/native/border-router-cmds.c +++ b/os/services/rpl-border-router/native/border-router-cmds.c @@ -43,6 +43,7 @@ #include "rpl.h" #include "net/ipv6/uiplib.h" #include +#include "shell.h" #define DEBUG DEBUG_NONE #include "net/ipv6/uip-debug.h" @@ -54,6 +55,56 @@ void nbr_print_stat(void); /*---------------------------------------------------------------------------*/ PROCESS(border_router_cmd_process, "Border router cmd process"); +/*---------------------------------------------------------------------------*/ +static const uint8_t * +hextoi(const uint8_t *buf, int len, int *v) +{ + *v = 0; + for(; len > 0; len--, buf++) { + if(*buf >= '0' && *buf <= '9') { + *v = (*v << 4) + ((*buf - '0') & 0xf); + } else if(*buf >= 'a' && *buf <= 'f') { + *v = (*v << 4) + ((*buf - 'a' + 10) & 0xf); + } else if(*buf >= 'A' && *buf <= 'F') { + *v = (*v << 4) + ((*buf - 'A' + 10) & 0xf); + } else { + break; + } + } + return buf; +} +/*---------------------------------------------------------------------------*/ +static const uint8_t * +dectoi(const uint8_t *buf, int len, int *v) +{ + int negative = 0; + *v = 0; + if(len <= 0) { + return buf; + } + if(*buf == '$') { + return hextoi(buf + 1, len - 1, v); + } + if(*buf == '0' && *(buf + 1) == 'x' && len > 2) { + return hextoi(buf + 2, len - 2, v); + } + if(*buf == '-') { + negative = 1; + buf++; + } + for(; len > 0; len--, buf++) { + if(*buf < '0' || *buf > '9') { + break; + } + *v = (*v * 10) + ((*buf - '0') & 0xf); + } + if(negative) { + *v = - *v; + } + return buf; +} +/*---------------------------------------------------------------------------*/ + /*---------------------------------------------------------------------------*/ /* TODO: the below code needs some way of identifying from where the command */ /* comes. In this case it can be from stdin or from SLIP. */ @@ -64,35 +115,64 @@ border_router_cmd_handler(const uint8_t *data, int len) /* handle global repair, etc here */ if(data[0] == '!') { PRINTF("Got configuration message of type %c\n", data[1]); - if(data[1] == 'G' && command_context == CMD_CONTEXT_STDIO) { - /* This is supposed to be from stdin */ - printf("Performing Global Repair...\n"); + if(command_context == CMD_CONTEXT_STDIO) { + switch(data[1]) { + case 'G': + /* This is supposed to be from stdin */ + printf("Performing Global Repair...\n"); #if UIP_CONF_IPV6_RPL_LITE - rpl_global_repair(); + rpl_global_repair(); #else - rpl_repair_root(RPL_DEFAULT_INSTANCE); + rpl_repair_root(RPL_DEFAULT_INSTANCE); #endif - return 1; - } else if(data[1] == 'M' && command_context == CMD_CONTEXT_RADIO) { + return 1; + case 'C': { + /* send on a set-param thing! */ + uint8_t set_param[] = {'!', 'V', 0, RADIO_PARAM_CHANNEL, 0, 0 }; + int channel = -1; + dectoi(&data[2], len - 2, &channel); + if(channel >= 0) { + set_param[5] = channel & 0xff; + write_to_slip(set_param, sizeof(set_param)); + } + return 1; + } + case 'P': { + /* send on a set-param thing! */ + uint8_t set_param[] = {'!', 'V', 0, RADIO_PARAM_PAN_ID, 0, 0 }; + int pan_id; + dectoi(&data[2], len - 2, &pan_id); + set_param[4] = (pan_id >> 8) & 0xff; + set_param[5] = pan_id & 0xff; + write_to_slip(set_param, sizeof(set_param)); + return 1; + } + default: + return 0; + } + } else if(command_context == CMD_CONTEXT_RADIO) { /* We need to know that this is from the slip-radio here. */ - PRINTF("Setting MAC address\n"); - border_router_set_mac(&data[2]); - return 1; - } else if(data[1] == 'C' && command_context == CMD_CONTEXT_RADIO) { - /* We need to know that this is from the slip-radio here. */ - printf("Channel is:%d\n", data[2]); - return 1; - } else if(data[1] == 'R' && command_context == CMD_CONTEXT_RADIO) { - /* We need to know that this is from the slip-radio here. */ - PRINTF("Packet data report for sid:%d st:%d tx:%d\n", - data[2], data[3], data[4]); - packet_sent(data[2], data[3], data[4]); - return 1; - } else if(data[1] == 'D' && command_context == CMD_CONTEXT_RADIO) { - /* We need to know that this is from the slip-radio here... */ - PRINTF("Sensor data received\n"); - border_router_set_sensors((const char *)&data[2], len - 2); - return 1; + switch(data[1]) { + case 'M': + PRINTF("Setting MAC address\n"); + border_router_set_mac(&data[2]); + return 1; + case 'V': + if(data[3] == RADIO_PARAM_CHANNEL) { + printf("Channel is %d\n", data[5]); + } + if(data[3] == RADIO_PARAM_PAN_ID) { + printf("PAN_ID is 0x%04x\n", (data[4] << 8) + data[5]); + } + return 1; + case 'R': + PRINTF("Packet data report for sid:%d st:%d tx:%d\n", + data[2], data[3], data[4]); + packet_sent(data[2], data[3], data[4]); + return 1; + default: + return 0; + } } } else if(data[0] == '?') { PRINTF("Got request message of type %c\n", data[1]); @@ -110,8 +190,14 @@ border_router_cmd_handler(const uint8_t *data, int len) cmd_send(buf, 18); return 1; } else if(data[1] == 'C' && command_context == CMD_CONTEXT_STDIO) { - /* send on! */ - write_to_slip(data, len); + /* send on a set-param thing! */ + uint8_t set_param[] = {'?', 'V', 0, RADIO_PARAM_CHANNEL}; + write_to_slip(set_param, sizeof(set_param)); + return 1; + } else if(data[1] == 'P' && command_context == CMD_CONTEXT_STDIO) { + /* send on a set-param thing! */ + uint8_t set_param[] = {'?', 'V', 0, RADIO_PARAM_PAN_ID}; + write_to_slip(set_param, sizeof(set_param)); return 1; } else if(data[1] == 'S') { border_router_print_stat(); @@ -132,17 +218,34 @@ border_router_cmd_output(const uint8_t *data, int data_len) printf("\n"); } /*---------------------------------------------------------------------------*/ +static void +serial_shell_output(const char *str) +{ + printf("%s", str); +} +/*---------------------------------------------------------------------------*/ + PROCESS_THREAD(border_router_cmd_process, ev, data) { + static struct pt shell_input_pt; PROCESS_BEGIN(); PRINTF("Started br-cmd process\n"); + + shell_init(); + while(1) { PROCESS_YIELD(); if(ev == serial_line_event_message && data != NULL) { - PRINTF("Got serial data!!! %s of len: %d\n", + PRINTF("Got serial data!!! %s of len: %lu\n", (char *)data, strlen((char *)data)); command_context = CMD_CONTEXT_STDIO; - cmd_input(data, strlen((char *)data)); + if(cmd_input(data, strlen((char *)data))) { + /* Commnand executed - all is fine */ + } else { + /* did not find command - run shell and see if ... */ + // FOR SERIAL RADIO cmd_send((uint8_t *)"EUnknown command", 16); + PROCESS_PT_SPAWN(&shell_input_pt, shell_input(&shell_input_pt, serial_shell_output, data)); + } } } PROCESS_END(); diff --git a/os/services/rpl-border-router/native/border-router-mac.c b/os/services/rpl-border-router/native/border-router-mac.c index 7b002183e..bcfb829b7 100644 --- a/os/services/rpl-border-router/native/border-router-mac.c +++ b/os/services/rpl-border-router/native/border-router-mac.c @@ -63,7 +63,7 @@ struct tx_callback { struct packetbuf_attr attrs[PACKETBUF_NUM_ATTRS]; struct packetbuf_addr addrs[PACKETBUF_NUM_ADDRS]; }; - +/*---------------------------------------------------------------------------*/ static struct tx_callback callbacks[MAX_CALLBACKS]; /*---------------------------------------------------------------------------*/ void @@ -111,6 +111,10 @@ send_packet(mac_callback_t sent, void *ptr) /* ack or not ? */ packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1); + /* Will make it send only DATA packets... for now */ + packetbuf_set_attr(PACKETBUF_ATTR_FRAME_TYPE, FRAME802154_DATAFRAME); + /* printf("Sending packet of type: %s \n", get_frame_type(packetbuf_attr(PACKETBUF_ATTR_FRAME_TYPE))); */ + if(NETSTACK_FRAMER.create() < 0) { /* Failed to allocate space for headers */ PRINTF("br-rdc: send failed, too large header\n"); diff --git a/os/services/slip-cmd/cmd.c b/os/services/slip-cmd/cmd.c index a2853efd2..c821fe77c 100644 --- a/os/services/slip-cmd/cmd.c +++ b/os/services/slip-cmd/cmd.c @@ -48,19 +48,18 @@ void CMD_OUTPUT(const uint8_t *data, int data_len); extern const cmd_handler_t cmd_handlers[]; /*---------------------------------------------------------------------------*/ -void +int cmd_input(const uint8_t *data, int data_len) { int i; for(i = 0; cmd_handlers[i] != NULL; i++) { if(cmd_handlers[i](data, data_len)) { /* Command has been handled */ - return; + return 1; } } - /* Unknown command */ - cmd_send((uint8_t *)"EUnknown command", 16); + return 0; } /*---------------------------------------------------------------------------*/ void diff --git a/os/services/slip-cmd/cmd.h b/os/services/slip-cmd/cmd.h index d363ac933..c3282b536 100644 --- a/os/services/slip-cmd/cmd.h +++ b/os/services/slip-cmd/cmd.h @@ -47,7 +47,7 @@ typedef int (* cmd_handler_t)(const uint8_t *data, int len); #define CMD_HANDLERS(...) \ const cmd_handler_t cmd_handlers[] = {__VA_ARGS__, NULL} -void cmd_input(const uint8_t *data, int data_len); +int cmd_input(const uint8_t *data, int data_len); void cmd_send(const uint8_t *data, int data_len); #endif /* CMD_H_ */ From 21a1a2e220b1f274ac28a274fd8f6a20f6198856 Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Fri, 26 Jan 2018 13:37:24 +0100 Subject: [PATCH 03/11] Platform: native: initialize serial line --- arch/platform/native/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/platform/native/platform.c b/arch/platform/native/platform.c index 4d1a1421c..8f119acd9 100644 --- a/arch/platform/native/platform.c +++ b/arch/platform/native/platform.c @@ -253,6 +253,7 @@ void platform_init_stage_two() { set_lladdr(); + serial_line_init(); } /*---------------------------------------------------------------------------*/ void From 50642b3e49c1d0f2a1ba3586fbd86f2919153156 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Sat, 27 Jan 2018 14:52:14 +0100 Subject: [PATCH 04/11] removed unused code and sensors on Sky slip-radio --- examples/slip-radio/sky/module-macros.h | 2 - examples/slip-radio/sky/slip-radio-cc2420.c | 60 ------------- .../slip-radio/sky/slip-radio-sky-sensors.c | 90 ------------------- examples/slip-radio/slip-radio.c | 4 +- .../native/border-router-cmds.c | 2 +- .../native/border-router-native.c | 31 ------- 6 files changed, 4 insertions(+), 185 deletions(-) delete mode 100644 examples/slip-radio/sky/slip-radio-cc2420.c delete mode 100644 examples/slip-radio/sky/slip-radio-sky-sensors.c diff --git a/examples/slip-radio/sky/module-macros.h b/examples/slip-radio/sky/module-macros.h index cbf6a3827..1fabdf1cf 100644 --- a/examples/slip-radio/sky/module-macros.h +++ b/examples/slip-radio/sky/module-macros.h @@ -32,7 +32,5 @@ #define QUEUEBUF_CONF_NUM 4 #define UIP_CONF_BUFFER_SIZE 140 -#define CMD_CONF_HANDLERS slip_radio_cmd_handler,cmd_handler_cc2420 -#define SLIP_RADIO_CONF_SENSORS slip_radio_sky_sensors #define UART1_CONF_RX_WITH_DMA 1 /*---------------------------------------------------------------------------*/ diff --git a/examples/slip-radio/sky/slip-radio-cc2420.c b/examples/slip-radio/sky/slip-radio-cc2420.c deleted file mode 100644 index f49e3c4e9..000000000 --- a/examples/slip-radio/sky/slip-radio-cc2420.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2011, Swedish Institute of Computer Science - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - * - * Sets up some commands for the CC2420 radio chip. - */ - -#include "contiki.h" -#include "cc2420.h" -#include "cmd.h" -#include - -int -cmd_handler_cc2420(const uint8_t *data, int len) -{ - if(data[0] == '!') { - if(data[1] == 'C') { - printf("cc2420_cmd: setting channel: %d\n", data[2]); - cc2420_set_channel(data[2]); - return 1; - } - } else if(data[0] == '?') { - if(data[1] == 'C') { - uint8_t buf[4]; - printf("cc2420_cmd: getting channel: %d\n", data[2]); - buf[0] = '!'; - buf[1] = 'C'; - buf[2] = cc2420_get_channel(); - cmd_send(buf, 3); - return 1; - } - } - return 0; -} diff --git a/examples/slip-radio/sky/slip-radio-sky-sensors.c b/examples/slip-radio/sky/slip-radio-sky-sensors.c deleted file mode 100644 index 9cf238741..000000000 --- a/examples/slip-radio/sky/slip-radio-sky-sensors.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2011, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "contiki.h" -#include "lib/sensors.h" -#include "dev/sht11/sht11-sensor.h" -#include "slip-radio.h" -#include "cmd.h" -#include - -/*---------------------------------------------------------------------------*/ -static void -init(void) -{ -} -/*---------------------------------------------------------------------------*/ -static int -write_percent_float(char *data, int maxlen, int temp) -{ - int t; - t = temp % 100; - if(t < 0) { - t = -t; - } - return snprintf(data, maxlen, "%d.%02d", temp / 100, t); -} -/*---------------------------------------------------------------------------*/ -static void -send(void) -{ -#define MAX_SIZE 40 - char data[MAX_SIZE]; - int temperature; - int ms; - long hum; - int pos = 0; - - /* SENSORS_ACTIVATE(light_sensor); */ - SENSORS_ACTIVATE(sht11_sensor); - - pos += snprintf(data, MAX_SIZE, "!D"); - /* int light1 = light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC); */ - /* int light2 = light_sensor.value(LIGHT_SENSOR_TOTAL_SOLAR); */ - temperature = -3970 + sht11_sensor.value(SHT11_SENSOR_TEMP); - ms = sht11_sensor.value(SHT11_SENSOR_HUMIDITY); - /* this is in * 10000 */ - /* -2.0468 + 0.0367 * ms + -1.5955e-6 * ms * ms ...too small value... */ - hum = (-20468L + 367L * ms) / 100L; - - /* SENSORS_DEACTIVATE(light_sensor); */ - SENSORS_DEACTIVATE(sht11_sensor); - - pos += snprintf(&data[pos], MAX_SIZE - pos, "temp="); - pos += write_percent_float(&data[pos], MAX_SIZE - pos, temperature); - pos += snprintf(&data[pos], MAX_SIZE - pos, ";hum="); - pos += write_percent_float(&data[pos], MAX_SIZE - pos, hum); - - cmd_send((uint8_t *)data, pos); -} -/* ---------------------------------------------------------------------- */ -const struct slip_radio_sensors slip_radio_sky_sensors = { - init, send -}; -/* ---------------------------------------------------------------------- */ diff --git a/examples/slip-radio/slip-radio.c b/examples/slip-radio/slip-radio.c index 65f0bde43..30a9387df 100644 --- a/examples/slip-radio/slip-radio.c +++ b/examples/slip-radio/slip-radio.c @@ -227,7 +227,9 @@ static void slip_input_callback(void) { LOG_DBG("SR-SIN: %u '%c%c'\n", uip_len, uip_buf[0], uip_buf[1]); - cmd_input(uip_buf, uip_len); + if(!cmd_input(uip_buf, uip_len)) { + cmd_send((uint8_t *)"EUnknown command", 16); + } uip_clear_buf(); } /*---------------------------------------------------------------------------*/ diff --git a/os/services/rpl-border-router/native/border-router-cmds.c b/os/services/rpl-border-router/native/border-router-cmds.c index a32ac6dd6..4a044f96e 100644 --- a/os/services/rpl-border-router/native/border-router-cmds.c +++ b/os/services/rpl-border-router/native/border-router-cmds.c @@ -44,6 +44,7 @@ #include "net/ipv6/uiplib.h" #include #include "shell.h" +#include #define DEBUG DEBUG_NONE #include "net/ipv6/uip-debug.h" @@ -243,7 +244,6 @@ PROCESS_THREAD(border_router_cmd_process, ev, data) /* Commnand executed - all is fine */ } else { /* did not find command - run shell and see if ... */ - // FOR SERIAL RADIO cmd_send((uint8_t *)"EUnknown command", 16); PROCESS_PT_SPAWN(&shell_input_pt, shell_input(&shell_input_pt, serial_shell_output, data)); } } diff --git a/os/services/rpl-border-router/native/border-router-native.c b/os/services/rpl-border-router/native/border-router-native.c index 07bd322c6..36516429d 100644 --- a/os/services/rpl-border-router/native/border-router-native.c +++ b/os/services/rpl-border-router/native/border-router-native.c @@ -51,18 +51,11 @@ #include -#define MAX_SENSORS 4 - extern long slip_sent; extern long slip_received; static uint8_t mac_set; -static uint8_t sensor_count = 0; - -/* allocate MAX_SENSORS char[32]'s */ -static char sensors[MAX_SENSORS][32]; - extern int contiki_argc; extern char **contiki_argv; extern const char *slip_config_ipaddr; @@ -101,30 +94,6 @@ border_router_print_stat() printf("bytes sent over SLIP: %ld\n", slip_sent); } /*---------------------------------------------------------------------------*/ -/* Format: ;;...;*/ -/* this function just cut at ; and store in the sensor array */ -void -border_router_set_sensors(const char *data, int len) -{ - int i; - int last_pos = 0; - int sc = 0; - for(i = 0; i < len; i++) { - if(data[i] == ';') { - sensors[sc][i - last_pos] = 0; - memcpy(sensors[sc++], &data[last_pos], i - last_pos); - last_pos = i + 1; /* skip the ';' */ - } - if(sc == MAX_SENSORS) { - sensor_count = sc; - return; - } - } - sensors[sc][len - last_pos] = 0; - memcpy(sensors[sc++], &data[last_pos], len - last_pos); - sensor_count = sc; -} -/*---------------------------------------------------------------------------*/ PROCESS_THREAD(border_router_process, ev, data) { static struct etimer et; From 069b3996399f70a62301cac9d44685e7c1c8a674 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Sat, 27 Jan 2018 15:52:45 +0100 Subject: [PATCH 05/11] added CI test for native border router --- .../07-native-border-router-sky.csc | 235 ++++++++++++++++++ .../07-native-border-router-sky.sh | 9 + tests/17-tun-rpl-br/test-nbr.sh | 56 +++++ 3 files changed, 300 insertions(+) create mode 100644 tests/17-tun-rpl-br/07-native-border-router-sky.csc create mode 100755 tests/17-tun-rpl-br/07-native-border-router-sky.sh create mode 100644 tests/17-tun-rpl-br/test-nbr.sh diff --git a/tests/17-tun-rpl-br/07-native-border-router-sky.csc b/tests/17-tun-rpl-br/07-native-border-router-sky.csc new file mode 100644 index 000000000..22e1fbf9d --- /dev/null +++ b/tests/17-tun-rpl-br/07-native-border-router-sky.csc @@ -0,0 +1,235 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/collect-view + [APPS_DIR]/powertracker + + My simulation + 1.0 + 123456 + 1000000 + + org.contikios.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + 40000 + + + org.contikios.cooja.mspmote.SkyMoteType + sky1 + Sky Mote Type #sky1 + [CONTIKI_DIR]/examples/slip-radio/slip-radio.c + make clean TARGET=sky +make -j slip-radio.sky TARGET=sky + [CONTIKI_DIR]/examples/slip-radio/slip-radio.sky + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.interfaces.IPAddress + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + org.contikios.cooja.mspmote.interfaces.MspClock + org.contikios.cooja.mspmote.interfaces.MspMoteID + org.contikios.cooja.mspmote.interfaces.SkyButton + org.contikios.cooja.mspmote.interfaces.SkyFlash + org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem + org.contikios.cooja.mspmote.interfaces.Msp802154Radio + org.contikios.cooja.mspmote.interfaces.MspSerial + org.contikios.cooja.mspmote.interfaces.SkyLED + org.contikios.cooja.mspmote.interfaces.MspDebugOutput + org.contikios.cooja.mspmote.interfaces.SkyTemperature + + + org.contikios.cooja.mspmote.SkyMoteType + sky2 + Sky Mote Type #sky2 + [CONTIKI_DIR]/examples/hello-world/hello-world.c + make clean TARGET=sky +make -j hello-world.sky TARGET=sky + [CONTIKI_DIR]/examples/hello-world/hello-world.sky + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.interfaces.IPAddress + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + org.contikios.cooja.mspmote.interfaces.MspClock + org.contikios.cooja.mspmote.interfaces.MspMoteID + org.contikios.cooja.mspmote.interfaces.SkyButton + org.contikios.cooja.mspmote.interfaces.SkyFlash + org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem + org.contikios.cooja.mspmote.interfaces.Msp802154Radio + org.contikios.cooja.mspmote.interfaces.MspSerial + org.contikios.cooja.mspmote.interfaces.SkyLED + org.contikios.cooja.mspmote.interfaces.MspDebugOutput + org.contikios.cooja.mspmote.interfaces.SkyTemperature + + + + + org.contikios.cooja.interfaces.Position + -24.750327773354453 + 17.688901393447438 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 1 + + sky1 + + + + + org.contikios.cooja.interfaces.Position + 1.091493067677618 + 40.943504236660225 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 2 + + sky2 + + + + + org.contikios.cooja.interfaces.Position + 22.647678967805337 + 61.6365018442491 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 3 + + sky2 + + + + + org.contikios.cooja.interfaces.Position + 44.02005813888037 + 93.02398317771755 + 0.0 + + + org.contikios.cooja.mspmote.interfaces.MspClock + 1.0 + + + org.contikios.cooja.mspmote.interfaces.MspMoteID + 4 + + sky2 + + + + org.contikios.cooja.plugins.SimControl + 280 + 1 + 160 + 400 + 0 + + + org.contikios.cooja.plugins.Visualizer + + true + org.contikios.cooja.plugins.skins.IDVisualizerSkin + org.contikios.cooja.plugins.skins.UDGMVisualizerSkin + 2.3610941331949244 0.0 0.0 2.3610941331949244 119.38219749746548 -4.52452305190821 + + 400 + 3 + 400 + 1 + 1 + + + org.contikios.cooja.plugins.LogListener + + + + + + 1404 + 6 + 240 + 400 + 160 + + + org.contikios.cooja.plugins.TimeLine + + 0 + 1 + 2 + 3 + + + + 500.0 + + 1804 + 5 + 166 + 0 + 742 + + + org.contikios.cooja.plugins.Notes + + Enter notes here + true + + 1124 + 4 + 160 + 680 + 0 + + + org.contikios.cooja.serialsocket.SerialSocketServer + 0 + + 60001 + true + + 362 + 2 + 116 + 30 + 403 + + + org.contikios.cooja.plugins.ScriptRunner + + + true + + 600 + 0 + 700 + 850 + 13 + + diff --git a/tests/17-tun-rpl-br/07-native-border-router-sky.sh b/tests/17-tun-rpl-br/07-native-border-router-sky.sh new file mode 100755 index 000000000..b986b3fce --- /dev/null +++ b/tests/17-tun-rpl-br/07-native-border-router-sky.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Contiki directory +CONTIKI=$1 + +# Simulation file +BASENAME=07-native-border-router-sky + +bash test-nbr.sh $CONTIKI $BASENAME fd02::0212:7202:0002:0202 diff --git a/tests/17-tun-rpl-br/test-nbr.sh b/tests/17-tun-rpl-br/test-nbr.sh new file mode 100644 index 000000000..fdb4b191c --- /dev/null +++ b/tests/17-tun-rpl-br/test-nbr.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Contiki directory +CONTIKI=$1 + +# Simulation file +BASENAME=$2 + +# Destination IPv6 +IPADDR=$3 + +# Start simulation +echo "Starting Cooja simulation $BASENAME.csc" +java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$BASENAME.csc -contiki=$CONTIKI > $BASENAME.coojalog & +JPID=$! +sleep 20 + +echo "Enabling IPv6" +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 + +# Connect to the simlation +echo "Starting native border-router" +make -C $CONTIKI/examples/rpl-border-router/ +sudo $CONTIKI/examples/rpl-border-router/border-router.native -B 115200 -a localhost fd02::1/64 >> $BASENAME.nbr.log 2>&1 & +MPID=$! +echo "Waiting for network formation" +sleep 50 + +# Do ping +echo "Pinging" +ping6 $IPADDR -s 10 -c 5 | tee $BASENAME.scriptlog +# Fetch ping6 status code (not $? because this is piped) +STATUS=${PIPESTATUS[0]} + +echo "Closing simulation and nbr" +sleep 1 +kill -9 $JPID +kill -9 $MPID +sleep 1 +rm COOJA.testlog +rm COOJA.log + +if [ $STATUS -eq 0 ] ; then + printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog; +else + echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog; + echo "==== $BASENAME.nbr.log ====" ; cat $BASENAME.nbr.log; + echo "==== $BASENAME.scriptlog ====" ; cat $BASENAME.scriptlog; + + printf "%-32s TEST FAIL\n" "$BASENAME" | tee $BASENAME.testlog; +fi + +# We do not want Make to stop -> Return 0 +# The Makefile will check if a log contains FAIL at the end + +exit 0 From d9e3abac2f5247c66ffe7b1b098c7e9e5252e3e9 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 27 Jan 2018 08:26:12 -0800 Subject: [PATCH 06/11] Native BR: add makefile target 'connect-router-cooja' --- os/services/rpl-border-router/native/Makefile.native | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/services/rpl-border-router/native/Makefile.native b/os/services/rpl-border-router/native/Makefile.native index f4c2fb5b9..a225e1666 100644 --- a/os/services/rpl-border-router/native/Makefile.native +++ b/os/services/rpl-border-router/native/Makefile.native @@ -8,3 +8,6 @@ MAKE_NET = MAKE_NET_IPV6 PREFIX ?= fd00::1/64 connect-router: border-router.native sudo ./border-router.native $(PREFIX) + +connect-router-cooja: border-router.native + sudo ./border-router.native -a localhost $(PREFIX) From b7fe599848ff5eb31dcfa975b06bbc981be4d3de Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 27 Jan 2018 08:27:02 -0800 Subject: [PATCH 07/11] Border router CI test: check that all ping replies are received --- tests/17-tun-rpl-br/test-border-router.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/17-tun-rpl-br/test-border-router.sh b/tests/17-tun-rpl-br/test-border-router.sh index 1a1d22a46..fac803ba8 100755 --- a/tests/17-tun-rpl-br/test-border-router.sh +++ b/tests/17-tun-rpl-br/test-border-router.sh @@ -9,6 +9,9 @@ BASENAME=$2 # Destination IPv6 IPADDR=$3 +# ICMP request-reply count +COUNT=5 + # Start simulation echo "Starting Cooja simulation $BASENAME.csc" java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$BASENAME.csc -contiki=$CONTIKI > $BASENAME.coojalog & @@ -28,9 +31,10 @@ sleep 5 # Do ping echo "Pinging" -ping6 $IPADDR -c 5 | tee $BASENAME.scriptlog +ping6 $IPADDR -c $COUNT | tee $BASENAME.scriptlog # Fetch ping6 status code (not $? because this is piped) STATUS=${PIPESTATUS[0]} +REPLIES=`grep -c 'icmp_seq=' $BASENAME.scriptlog` echo "Closing simulation and tunslip6" sleep 1 @@ -40,7 +44,7 @@ sleep 1 rm COOJA.testlog rm COOJA.log -if [ $STATUS -eq 0 ] ; then +if [ $STATUS -eq 0 ] && [ $REPLIES -eq $COUNT ] ; then printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog; else echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog; From 5e04920db9c9d3aabec82641ea2423b2c4072b75 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 27 Jan 2018 08:28:57 -0800 Subject: [PATCH 08/11] Fix NBR CI test, and convert from sky to cooja motes --- .../07-native-border-router-cooja.csc | 255 ++++++++++++++++++ .../07-native-border-router-cooja.sh | 9 + .../07-native-border-router-sky.csc | 235 ---------------- .../07-native-border-router-sky.sh | 9 - tests/17-tun-rpl-br/test-nbr.sh | 13 +- 5 files changed, 272 insertions(+), 249 deletions(-) create mode 100644 tests/17-tun-rpl-br/07-native-border-router-cooja.csc create mode 100755 tests/17-tun-rpl-br/07-native-border-router-cooja.sh delete mode 100644 tests/17-tun-rpl-br/07-native-border-router-sky.csc delete mode 100755 tests/17-tun-rpl-br/07-native-border-router-sky.sh diff --git a/tests/17-tun-rpl-br/07-native-border-router-cooja.csc b/tests/17-tun-rpl-br/07-native-border-router-cooja.csc new file mode 100644 index 000000000..7c214070f --- /dev/null +++ b/tests/17-tun-rpl-br/07-native-border-router-cooja.csc @@ -0,0 +1,255 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/collect-view + [APPS_DIR]/powertracker + + My simulation + 1.0 + 123456 + 1000000 + + org.contikios.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + 40000 + + + org.contikios.cooja.contikimote.ContikiMoteType + mtype295 + Cooja Mote Type #1 + [CONTIKI_DIR]/examples/slip-radio/slip-radio.c + make TARGET=cooja clean +make -j slip-radio.cooja TARGET=cooja + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.Battery + org.contikios.cooja.contikimote.interfaces.ContikiVib + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + org.contikios.cooja.contikimote.interfaces.ContikiBeeper + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.contikimote.interfaces.ContikiIPAddress + org.contikios.cooja.contikimote.interfaces.ContikiRadio + org.contikios.cooja.contikimote.interfaces.ContikiButton + org.contikios.cooja.contikimote.interfaces.ContikiPIR + org.contikios.cooja.contikimote.interfaces.ContikiClock + org.contikios.cooja.contikimote.interfaces.ContikiLED + org.contikios.cooja.contikimote.interfaces.ContikiCFS + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + false + + + org.contikios.cooja.contikimote.ContikiMoteType + mtype686 + Cooja Mote Type #2 + [CONTIKI_DIR]/examples/hello-world/hello-world.c + make TARGET=cooja clean +make -j hello-world.cooja TARGET=cooja + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.Battery + org.contikios.cooja.contikimote.interfaces.ContikiVib + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + org.contikios.cooja.contikimote.interfaces.ContikiBeeper + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.contikimote.interfaces.ContikiIPAddress + org.contikios.cooja.contikimote.interfaces.ContikiRadio + org.contikios.cooja.contikimote.interfaces.ContikiButton + org.contikios.cooja.contikimote.interfaces.ContikiPIR + org.contikios.cooja.contikimote.interfaces.ContikiClock + org.contikios.cooja.contikimote.interfaces.ContikiLED + org.contikios.cooja.contikimote.interfaces.ContikiCFS + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + false + + + + org.contikios.cooja.interfaces.Position + 54.36775767371176 + 24.409055040864118 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 1 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype295 + + + + org.contikios.cooja.interfaces.Position + 83.54989222799365 + 52.63050856506214 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 2 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype686 + + + + org.contikios.cooja.interfaces.Position + 108.91767775240822 + 78.59778809170032 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 3 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype686 + + + + org.contikios.cooja.interfaces.Position + 139.91021061864723 + 98.34190023350419 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 4 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype686 + + + + org.contikios.cooja.plugins.SimControl + 280 + 1 + 160 + 400 + 0 + + + org.contikios.cooja.plugins.Visualizer + + true + org.contikios.cooja.plugins.skins.UDGMVisualizerSkin + org.contikios.cooja.plugins.skins.IDVisualizerSkin + 1.9798610460263038 0.0 0.0 1.9798610460263038 -61.112037797038525 -1.2848438586294648 + + 400 + 4 + 400 + 1 + 1 + + + org.contikios.cooja.plugins.LogListener + + ID:4 + + + + 1404 + 2 + 240 + 400 + 160 + + + org.contikios.cooja.plugins.TimeLine + + 0 + 1 + 2 + 3 + + + + 500.0 + + 1804 + 6 + 166 + 0 + 753 + + + org.contikios.cooja.plugins.Notes + + Enter notes here + true + + 1124 + 5 + 160 + 680 + 0 + + + org.contikios.cooja.serialsocket.SerialSocketServer + 0 + + 60001 + true + + 362 + 3 + 116 + 13 + 414 + + + org.contikios.cooja.plugins.ScriptRunner + + + true + + 600 + 0 + 700 + 1037 + 40 + + diff --git a/tests/17-tun-rpl-br/07-native-border-router-cooja.sh b/tests/17-tun-rpl-br/07-native-border-router-cooja.sh new file mode 100755 index 000000000..d5d2642fe --- /dev/null +++ b/tests/17-tun-rpl-br/07-native-border-router-cooja.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Contiki directory +CONTIKI=$1 + +# Simulation file +BASENAME=07-native-border-router-cooja + +bash test-nbr.sh $CONTIKI $BASENAME fd00::204:4:4:4 diff --git a/tests/17-tun-rpl-br/07-native-border-router-sky.csc b/tests/17-tun-rpl-br/07-native-border-router-sky.csc deleted file mode 100644 index 22e1fbf9d..000000000 --- a/tests/17-tun-rpl-br/07-native-border-router-sky.csc +++ /dev/null @@ -1,235 +0,0 @@ - - - [APPS_DIR]/mrm - [APPS_DIR]/mspsim - [APPS_DIR]/avrora - [APPS_DIR]/serial_socket - [APPS_DIR]/collect-view - [APPS_DIR]/powertracker - - My simulation - 1.0 - 123456 - 1000000 - - org.contikios.cooja.radiomediums.UDGM - 50.0 - 100.0 - 1.0 - 1.0 - - - 40000 - - - org.contikios.cooja.mspmote.SkyMoteType - sky1 - Sky Mote Type #sky1 - [CONTIKI_DIR]/examples/slip-radio/slip-radio.c - make clean TARGET=sky -make -j slip-radio.sky TARGET=sky - [CONTIKI_DIR]/examples/slip-radio/slip-radio.sky - org.contikios.cooja.interfaces.Position - org.contikios.cooja.interfaces.RimeAddress - org.contikios.cooja.interfaces.IPAddress - org.contikios.cooja.interfaces.Mote2MoteRelations - org.contikios.cooja.interfaces.MoteAttributes - org.contikios.cooja.mspmote.interfaces.MspClock - org.contikios.cooja.mspmote.interfaces.MspMoteID - org.contikios.cooja.mspmote.interfaces.SkyButton - org.contikios.cooja.mspmote.interfaces.SkyFlash - org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem - org.contikios.cooja.mspmote.interfaces.Msp802154Radio - org.contikios.cooja.mspmote.interfaces.MspSerial - org.contikios.cooja.mspmote.interfaces.SkyLED - org.contikios.cooja.mspmote.interfaces.MspDebugOutput - org.contikios.cooja.mspmote.interfaces.SkyTemperature - - - org.contikios.cooja.mspmote.SkyMoteType - sky2 - Sky Mote Type #sky2 - [CONTIKI_DIR]/examples/hello-world/hello-world.c - make clean TARGET=sky -make -j hello-world.sky TARGET=sky - [CONTIKI_DIR]/examples/hello-world/hello-world.sky - org.contikios.cooja.interfaces.Position - org.contikios.cooja.interfaces.RimeAddress - org.contikios.cooja.interfaces.IPAddress - org.contikios.cooja.interfaces.Mote2MoteRelations - org.contikios.cooja.interfaces.MoteAttributes - org.contikios.cooja.mspmote.interfaces.MspClock - org.contikios.cooja.mspmote.interfaces.MspMoteID - org.contikios.cooja.mspmote.interfaces.SkyButton - org.contikios.cooja.mspmote.interfaces.SkyFlash - org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem - org.contikios.cooja.mspmote.interfaces.Msp802154Radio - org.contikios.cooja.mspmote.interfaces.MspSerial - org.contikios.cooja.mspmote.interfaces.SkyLED - org.contikios.cooja.mspmote.interfaces.MspDebugOutput - org.contikios.cooja.mspmote.interfaces.SkyTemperature - - - - - org.contikios.cooja.interfaces.Position - -24.750327773354453 - 17.688901393447438 - 0.0 - - - org.contikios.cooja.mspmote.interfaces.MspClock - 1.0 - - - org.contikios.cooja.mspmote.interfaces.MspMoteID - 1 - - sky1 - - - - - org.contikios.cooja.interfaces.Position - 1.091493067677618 - 40.943504236660225 - 0.0 - - - org.contikios.cooja.mspmote.interfaces.MspClock - 1.0 - - - org.contikios.cooja.mspmote.interfaces.MspMoteID - 2 - - sky2 - - - - - org.contikios.cooja.interfaces.Position - 22.647678967805337 - 61.6365018442491 - 0.0 - - - org.contikios.cooja.mspmote.interfaces.MspClock - 1.0 - - - org.contikios.cooja.mspmote.interfaces.MspMoteID - 3 - - sky2 - - - - - org.contikios.cooja.interfaces.Position - 44.02005813888037 - 93.02398317771755 - 0.0 - - - org.contikios.cooja.mspmote.interfaces.MspClock - 1.0 - - - org.contikios.cooja.mspmote.interfaces.MspMoteID - 4 - - sky2 - - - - org.contikios.cooja.plugins.SimControl - 280 - 1 - 160 - 400 - 0 - - - org.contikios.cooja.plugins.Visualizer - - true - org.contikios.cooja.plugins.skins.IDVisualizerSkin - org.contikios.cooja.plugins.skins.UDGMVisualizerSkin - 2.3610941331949244 0.0 0.0 2.3610941331949244 119.38219749746548 -4.52452305190821 - - 400 - 3 - 400 - 1 - 1 - - - org.contikios.cooja.plugins.LogListener - - - - - - 1404 - 6 - 240 - 400 - 160 - - - org.contikios.cooja.plugins.TimeLine - - 0 - 1 - 2 - 3 - - - - 500.0 - - 1804 - 5 - 166 - 0 - 742 - - - org.contikios.cooja.plugins.Notes - - Enter notes here - true - - 1124 - 4 - 160 - 680 - 0 - - - org.contikios.cooja.serialsocket.SerialSocketServer - 0 - - 60001 - true - - 362 - 2 - 116 - 30 - 403 - - - org.contikios.cooja.plugins.ScriptRunner - - - true - - 600 - 0 - 700 - 850 - 13 - - diff --git a/tests/17-tun-rpl-br/07-native-border-router-sky.sh b/tests/17-tun-rpl-br/07-native-border-router-sky.sh deleted file mode 100755 index b986b3fce..000000000 --- a/tests/17-tun-rpl-br/07-native-border-router-sky.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# Contiki directory -CONTIKI=$1 - -# Simulation file -BASENAME=07-native-border-router-sky - -bash test-nbr.sh $CONTIKI $BASENAME fd02::0212:7202:0002:0202 diff --git a/tests/17-tun-rpl-br/test-nbr.sh b/tests/17-tun-rpl-br/test-nbr.sh index fdb4b191c..63862a656 100644 --- a/tests/17-tun-rpl-br/test-nbr.sh +++ b/tests/17-tun-rpl-br/test-nbr.sh @@ -9,6 +9,9 @@ BASENAME=$2 # Destination IPv6 IPADDR=$3 +# ICMP request-reply count +COUNT=5 + # Start simulation echo "Starting Cooja simulation $BASENAME.csc" java -Xshare:on -jar $CONTIKI/tools/cooja/dist/cooja.jar -nogui=$BASENAME.csc -contiki=$CONTIKI > $BASENAME.coojalog & @@ -20,17 +23,17 @@ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 # Connect to the simlation echo "Starting native border-router" -make -C $CONTIKI/examples/rpl-border-router/ -sudo $CONTIKI/examples/rpl-border-router/border-router.native -B 115200 -a localhost fd02::1/64 >> $BASENAME.nbr.log 2>&1 & +nohup make -C $CONTIKI/examples/rpl-border-router/ connect-router-cooja TARGET=native >> $BASENAME.nbr.log 2>&1 & MPID=$! echo "Waiting for network formation" -sleep 50 +sleep 60 # runs in real time so we need to wait a bit # Do ping echo "Pinging" -ping6 $IPADDR -s 10 -c 5 | tee $BASENAME.scriptlog +ping6 $IPADDR -c $COUNT | tee $BASENAME.scriptlog # Fetch ping6 status code (not $? because this is piped) STATUS=${PIPESTATUS[0]} +REPLIES=`grep -c 'icmp_seq=' $BASENAME.scriptlog` echo "Closing simulation and nbr" sleep 1 @@ -40,7 +43,7 @@ sleep 1 rm COOJA.testlog rm COOJA.log -if [ $STATUS -eq 0 ] ; then +if [ $STATUS -eq 0 ] && [ $REPLIES -eq $COUNT ] ; then printf "%-32s TEST OK\n" "$BASENAME" | tee $BASENAME.testlog; else echo "==== $BASENAME.coojalog ====" ; cat $BASENAME.coojalog; From 8f7c4fb977e96573b0ec4c913f2a6b2078a00c2e Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 27 Jan 2018 11:35:37 -0800 Subject: [PATCH 09/11] Shell: do not disable logging at init --- os/services/shell/shell-commands.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/os/services/shell/shell-commands.c b/os/services/shell/shell-commands.c index 7c14e1ef5..09edda827 100644 --- a/os/services/shell/shell-commands.c +++ b/os/services/shell/shell-commands.c @@ -712,11 +712,6 @@ shell_commands_init(void) /* Set up Ping Reply callback */ uip_icmp6_echo_reply_callback_add(&echo_reply_notification, echo_reply_handler); - /* Start with soft log level 0 so as to minimize interference with shell */ - log_set_level("all", LOG_LEVEL_NONE); -#if MAC_CONF_WITH_TSCH && TSCH_LOG_PER_SLOT - tsch_log_stop(); -#endif /* MAC_CONF_WITH_TSCH && TSCH_LOG_PER_SLOT */ } /*---------------------------------------------------------------------------*/ struct shell_command_t shell_commands[] = { From d5ede05f9a903c5a026d84caf724476f797c1867 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 27 Jan 2018 13:06:28 -0800 Subject: [PATCH 10/11] Native CoAP CI test: fix cleanup --- tests/17-tun-rpl-br/06-native-coap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/17-tun-rpl-br/06-native-coap.sh b/tests/17-tun-rpl-br/06-native-coap.sh index 453d76e2e..da5e06a72 100755 --- a/tests/17-tun-rpl-br/06-native-coap.sh +++ b/tests/17-tun-rpl-br/06-native-coap.sh @@ -41,7 +41,7 @@ done echo "Closing native node" sleep 2 -pgrep hello-world | sudo xargs kill -9 +pgrep coap-example | sudo xargs kill -9 if [ $TESTCOUNT -eq $OKCOUNT ] ; then printf "%-32s TEST OK %3d/%d\n" "$BASENAME" "$OKCOUNT" "$TESTCOUNT" > $BASENAME.testlog; From 151f2e0b7390edcf40aba0410711b7f79a77f0da Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 27 Jan 2018 13:07:44 -0800 Subject: [PATCH 11/11] CI: remove obsolte sky-slip-radio test --- .../07-simulation-base/10-sky-slip-radio.csc | 189 ------------------ 1 file changed, 189 deletions(-) delete mode 100644 tests/07-simulation-base/10-sky-slip-radio.csc diff --git a/tests/07-simulation-base/10-sky-slip-radio.csc b/tests/07-simulation-base/10-sky-slip-radio.csc deleted file mode 100644 index 85eb6e9d5..000000000 --- a/tests/07-simulation-base/10-sky-slip-radio.csc +++ /dev/null @@ -1,189 +0,0 @@ - - - [APPS_DIR]/mrm - [APPS_DIR]/mspsim - [APPS_DIR]/avrora - [APPS_DIR]/serial_socket - [APPS_DIR]/collect-view - [APPS_DIR]/powertracker - - slip radio 1 - 123456 - 1000000 - - se.sics.cooja.radiomediums.UDGM - 15.0 - 15.0 - 1.0 - 1.0 - - - 40000 - - - se.sics.cooja.mspmote.SkyMoteType - sky1 - slip radio - [CONTIKI_DIR]/examples/slip-radio/slip-radio.c - make -j slip-radio.sky TARGET=sky - [CONTIKI_DIR]/examples/slip-radio/slip-radio.sky - se.sics.cooja.interfaces.Position - se.sics.cooja.interfaces.RimeAddress - se.sics.cooja.interfaces.IPAddress - se.sics.cooja.interfaces.Mote2MoteRelations - se.sics.cooja.interfaces.MoteAttributes - se.sics.cooja.mspmote.interfaces.MspClock - se.sics.cooja.mspmote.interfaces.MspMoteID - se.sics.cooja.mspmote.interfaces.SkyButton - se.sics.cooja.mspmote.interfaces.SkyFlash - se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem - se.sics.cooja.mspmote.interfaces.Msp802154Radio - se.sics.cooja.mspmote.interfaces.MspSerial - se.sics.cooja.mspmote.interfaces.SkyLED - se.sics.cooja.mspmote.interfaces.MspDebugOutput - se.sics.cooja.mspmote.interfaces.SkyTemperature - - - se.sics.cooja.mspmote.SkyMoteType - sky2 - wait-dag - [CONFIG_DIR]/code-slip-radio/wait-dag.c - make -j wait-dag.sky TARGET=sky - [CONFIG_DIR]/code-slip-radio/wait-dag.sky - se.sics.cooja.interfaces.Position - se.sics.cooja.interfaces.RimeAddress - se.sics.cooja.interfaces.IPAddress - se.sics.cooja.interfaces.Mote2MoteRelations - se.sics.cooja.interfaces.MoteAttributes - se.sics.cooja.mspmote.interfaces.MspClock - se.sics.cooja.mspmote.interfaces.MspMoteID - se.sics.cooja.mspmote.interfaces.SkyButton - se.sics.cooja.mspmote.interfaces.SkyFlash - se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem - se.sics.cooja.mspmote.interfaces.Msp802154Radio - se.sics.cooja.mspmote.interfaces.MspSerial - se.sics.cooja.mspmote.interfaces.SkyLED - se.sics.cooja.mspmote.interfaces.MspDebugOutput - se.sics.cooja.mspmote.interfaces.SkyTemperature - - - - - se.sics.cooja.interfaces.Position - 43.565500781711165 - 14.697933087406794 - 0.0 - - - se.sics.cooja.mspmote.interfaces.MspMoteID - 1 - - sky1 - - - - - se.sics.cooja.interfaces.Position - 53.849666651434326 - 14.629826028666905 - 0.0 - - - se.sics.cooja.mspmote.interfaces.MspMoteID - 2 - - sky2 - - - - se.sics.cooja.plugins.SimControl - 315 - 1 - 175 - 433 - 0 - - - se.sics.cooja.plugins.Visualizer - - se.sics.cooja.plugins.skins.IDVisualizerSkin - se.sics.cooja.plugins.skins.GridVisualizerSkin - se.sics.cooja.plugins.skins.TrafficVisualizerSkin - se.sics.cooja.plugins.skins.UDGMVisualizerSkin - 14.682765905648006 0.0 0.0 14.682765905648006 -512.6620495401903 -96.80631081927221 - - 432 - 4 - 291 - 1 - 1 - - - se.sics.cooja.plugins.LogListener - - - - 758 - 3 - 289 - 748 - 159 - - - se.sics.cooja.plugins.Notes - - Slip-radio Tests, 01-sky-slip-radio-dio - -Test that we can send a packet over a slip-radio. -In this basic test, we send a DIO from mote 1, and wait for "DAG Found" in mote 2. - true - - 928 - 5 - 159 - 749 - -1 - - - se.sics.cooja.plugins.ScriptRunner - - - true - - 758 - 2 - 502 - 749 - 449 - - - se.sics.cooja.plugins.RadioLogger - - 150 - - 746 - 0 - 657 - 3 - 294 - -