diff --git a/examples/hello-world/Makefile b/examples/hello-world/Makefile index 63efcf852..10aeb8ed9 100644 --- a/examples/hello-world/Makefile +++ b/examples/hello-world/Makefile @@ -2,6 +2,9 @@ #make TARGET=avr-raven hello-world.elf #Load the .elf in AVR Studio and connect a hapsim terminal to the 1284p simulation. +#Do $make clean when switching between ipv4 and ipv6 builds on a platform. +#Otherwise the library will contain duplicate or unresolved modules. + CONTIKI_PROJECT = hello-world all: $(CONTIKI_PROJECT) diff --git a/platform/avr-raven/contiki-conf.h b/platform/avr-raven/contiki-conf.h index b6e981877..495bb8318 100644 --- a/platform/avr-raven/contiki-conf.h +++ b/platform/avr-raven/contiki-conf.h @@ -167,25 +167,34 @@ #define UIP_CONF_UDP_CHECKSUMS 1 #define UIP_CONF_TCP_SPLIT 1 -#if 0 /* RPL */ -/* Define these to reduce tx power and ignore weak rx packets for testing a miniature multihop network. +/* ************************************************************************** */ +//#pragma mark RPL Settings +/* ************************************************************************** */ +#if UIP_CONF_IPV6 //Allows hello-world ip4 to compile +#define UIP_CONF_IPV6_RPL 0 +#endif +#if UIP_CONF_IPV6_RPL + +/* Define MAX_*X_POWER to reduce tx power and ignore weak rx packets for testing a miniature multihop network. * Leave undefined for full power and sensitivity. * tx=0 (3dbm, default) to 15 (-17.2dbm) * RF230_CONF_AUTOACK sets the extended mode using the energy-detect register with rx=0 (-91dBm) to 84 (-7dBm) * else the rssi register is used having range 0 (91dBm) to 28 (-10dBm) - * For simplicity RF230_MIN_RX_POWER is based on the rssi value and multiplied by 3 when autoack is set. + * For simplicity RF230_MIN_RX_POWER is based on the energy-detect value and divided by 3 when autoack is not set. * On the RF230 a reduced rx power threshold will not prevent autoack if enabled and requested. + * These numbers applied to both Raven and Jackdaw give a maximum communication distance of about 15 cm + * and a 10 meter range to a full-sensitivity RF230 sniffer. */ -#define RF230_MAX_TX_POWER 15 -#define RF230_MIN_RX_POWER 30 +//#define RF230_MAX_TX_POWER 15 +//#define RF230_MIN_RX_POWER 30 #define UIP_CONF_ROUTER 1 #define UIP_CONF_IPV6_RPL 1 /* Handle 10 neighbors */ -#define UIP_CONF_DS6_NBR_NBU 4 +#define UIP_CONF_DS6_NBR_NBU 10 /* Handle 10 routes */ -#define UIP_CONF_DS6_ROUTE_NBU 4 +#define UIP_CONF_DS6_ROUTE_NBU 10 #define UIP_CONF_ND6_SEND_RA 0 #define UIP_CONF_ND6_REACHABLE_TIME 600000 diff --git a/platform/avr-ravenusb/contiki-conf.h b/platform/avr-ravenusb/contiki-conf.h index 6b8730e32..ca3a6ecc3 100644 --- a/platform/avr-ravenusb/contiki-conf.h +++ b/platform/avr-ravenusb/contiki-conf.h @@ -210,7 +210,7 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len); * The tx pad is the middle one behind the jackdaw leds. * RS232 output will work with or without enabling the USB serial port */ -#define USB_CONF_RS232 1 +#define USB_CONF_RS232 0 /* Disable mass storage enumeration for more program space */ //#define USB_CONF_STORAGE 1 /* TODO: Mass storage is currently broken */ @@ -281,8 +281,9 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len); /* ************************************************************************** */ //#pragma mark RPL Settings /* ************************************************************************** */ - +#if UIP_CONF_IPV6 //Allows hello-world ip4 to compile #define UIP_CONF_IPV6_RPL 0 +#endif #if UIP_CONF_IPV6_RPL @@ -297,7 +298,7 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len); buffer_length = uip_len - uip_l2_l3_icmp_hdr_len + UIP_LLH_LEN; //Add jackdaw ethernet header */ -/* Define these to reduce tx power and ignore weak rx packets for testing a miniature multihop network. +/* Define MAX_*X_POWER to reduce tx power and ignore weak rx packets for testing a miniature multihop network. * Leave undefined for full power and sensitivity. * tx=0 (3dbm, default) to 15 (-17.2dbm) * RF230_CONF_AUTOACK sets the extended mode using the energy-detect register with rx=0 (-91dBm) to 84 (-7dBm) @@ -311,6 +312,7 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len); //#define RF230_MIN_RX_POWER 30 #define UIP_CONF_ROUTER 1 +#define UIP_CONF_ROUTER_RECEIVE_RA 1 #define RPL_BORDER_ROUTER 1 #define RPL_CONF_STATS 0 #define UIP_CONF_BUFFER_SIZE 1300 @@ -331,9 +333,10 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len); #define UIP_CONF_PINGADDRCONF 0 #define UIP_CONF_LOGGING 0 #undef UIP_CONF_MAX_CONNECTIONS -#define UIP_CONF_MAX_CONNECTIONS 1 +#define UIP_CONF_MAX_CONNECTIONS 2 #undef UIP_CONF_MAX_LISTENPORTS -#define UIP_CONF_MAX_LISTENPORTS 3 +#define UIP_CONF_MAX_LISTENPORTS 2 +#define UIP_CONF_UDP_CONNS 6 /* Optional, TCP needed to serve the RPL neighbor web page currently hard coded at bbbb::11 */ /* The RPL neighbors can also be viewed using the jack menu */ @@ -348,13 +351,14 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len); #define UIP_CONF_DS6_NBR_NBU 5 #undef UIP_CONF_DS6_ROUTE_NBU #define UIP_CONF_DS6_ROUTE_NBU 5 +#undef UIP_CONF_MAX_CONNECTIONS +#define UIP_CONF_MAX_CONNECTIONS 2 #endif #define UIP_CONF_ICMP_DEST_UNREACH 1 #define UIP_CONF_DHCP_LIGHT -#define UIP_CONF_UDP_CONNS 12 #undef UIP_CONF_FWCACHE_SIZE #define UIP_CONF_FWCACHE_SIZE 30 #define UIP_CONF_BROADCAST 1 diff --git a/platform/avr-ravenusb/httpd-simple-avr.c b/platform/avr-ravenusb/httpd-simple-avr.c index c17f64576..6e634f642 100644 --- a/platform/avr-ravenusb/httpd-simple-avr.c +++ b/platform/avr-ravenusb/httpd-simple-avr.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: httpd-simple-avr.c,v 1.5 2010/11/29 21:21:36 dak664 Exp $ + * $Id: httpd-simple-avr.c,v 1.6 2010/12/01 16:23:55 dak664 Exp $ */ /** @@ -253,15 +253,15 @@ extern uip_ds6_route_t uip_ds6_routing_table[]; static PT_THREAD(generate_routes(struct httpd_state *s)) { - static int i; + int i; PSOCK_BEGIN(&s->sout); PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, TOP1); PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, TOP2); +#if UIP_CONF_IPV6 //allow ip4 builds blen = 0; ADD("