Übersetzungen dieser Seite:

Dies ist eine alte Version des Dokuments!


Client-Server Example

Pess the Button on the client Node, the led on the client Node and server Node changed. The Client Software must know the server node adress.

Client Node

Edit er-examole-client.c osd-contiki-work/examples/osd/er-rest-example-merkurboard/er-examole-client.c

  --- snip --
  /* TODO: This server address is hard-coded for Cooja. */
  -#define SERVER_NODE(ipaddr)   uip_ip6addr(ipaddr, 0xfe80, 0, 0, 0, 0x0221, 0x2eff, 0xff00, 0x26D0) /* cooja2 */
  +#define SERVER_NODE(ipaddr)   uip_ip6addr(ipaddr, 0xfe80, 0, 0, 0, 0x0221, 0x2eff, 0xff00, 0x26D0) /* edit the correct server mac adress */
  
  #define LOCAL_PORT      UIP_HTONS(COAP_DEFAULT_PORT+1)
  #define REMOTE_PORT     UIP_HTONS(COAP_DEFAULT_PORT)
  --- snip ---

compile and flash the client:

makeclient.sh
flashclient.sh

Server Node

Edit the params.h file osd-contiki-work/platform/osd-merkur/params.h

  --- snip ---
  /* This form of of EUI64 mac allows full 6LoWPAN header compression from mac address */
  #if UIP_CONF_LL_802154
  //#define PARAMS_EUI64ADDR {0x02, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN}
  //#define PARAMS_EUI64ADDR {0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x01}
  -#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x26, 0xd0} 
  +#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x26, 0xd0}  /* edit the correct server mac adress here !!!! */
  //#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x1E, 0xFB}
  #else
  --- snip ---

compile and flash the server:

 
make.sh
flash.sh

de/ideen/serverclient.1455889876.txt.gz · Zuletzt geändert: 2016/02/19 14:51 von harald42