> Hi, I followed all CoAP tutorial steps
> http://sing.stanford.edu/tinywiki/index.php/CoAP and I edited CoapBlip
> Makefile enabling temperature and voltage CoAP resources (NUM_URIS=2).
> When I run CoAP example client only the temperature request seems to work
> properly, because when I try to get the voltage a value is returned but I
> need to press CTRL+C to return.
For immediate resources, pressing Ctrl-C is the expected behaviour. For
deferred resources, the client returns.
> I thought to debug the code using Printf, so I edited CoapBlip Makefile
> uncommenting CFLAGS += -DNEW_PRINTF_SEMANTICS -DPRINTFUART_ENABLED line,
> but when I tried to recompile the application I got this error:
> *
> msp430-ld: region text is full (build/telosb/main.exe section .text)
> msp430-ld: section .vectors [0000ffe0 -> 0000ffff] overlaps section .text
> [00004000 -> 0001054b]
> msp430-ld: build/telosb/main.exe: section .vectors lma 0xffe0 overlaps
> previous sections*
>
> I suppose memory space becomes insufficient including Printf components.
Exactly.
> How can I compile CoapBlip with Printf functionality?
Do you have the new mspgcc packages? You might want to check the email thread
'[Tinyos-devel] [Tinyos-help] [Tinyos Core WG] Cross compilers and 2.1.2 update'
With the following compiler versions, I can at least compile all
COAP_RESOURCE_* individually (except for COAP_RESOURCE_ALL) with printf.
dpkg -l | grep tinyos
ii msp430-binutils-tinyos 2.21.1-20110821
TinyOS-specific MSP430 binutils
ii msp430-gcc-tinyos 4.5.3-20110821
TinyOS-specific MSP430 gcc
ii msp430-libc-tinyos 20110612-20110821
TinyOS-specific MSP430 libc
ii msp430-tinyos 20110821
Dummy package to pull in all the MSP430 packages
ii msp430mcu-tinyos 20110613-20110821
TinyOS-specific MSP430 headers and linker scripts
Please also check whether your ncc call is 'ncc -o build/telosb/main.exe -Os
-Os ...' or ncc -o 'build/telosb/main.exe -Os -O ...'
Latter disables size optimizations of the compiler.
> Why temperature request works properly, while the voltage (and the others)
> doesn't?
Voltage and all others work fine for me.
Settings in the Makefile:
# CFLAGS += -DNEW_PRINTF_SEMANTICS -DPRINTFUART_ENABLED
# uncomment this line if you are having problems displaying the new printf
semantics
# CFLAGS += -DPRINTF_BUFFER_SIZE=1024
################ CoAP Server ###############################
CFLAGS += -DCOAP_SERVER_ENABLED
# port where server is listening
CFLAGS += -DCOAP_SERVER_PORT=61616L
#set max uri length
CFLAGS += -DMAX_URI_LENGTH=5
# set available resources.
# Don't forget to change CFLAG: NUM_URIS!!!!!
CFLAGS += -DNUM_URIS=6
CFLAGS += -DCOAP_RESOURCE_TEMP
CFLAGS += -DCOAP_RESOURCE_HUM
CFLAGS += -DCOAP_RESOURCE_VOLT
CFLAGS += -DCOAP_RESOURCE_KEY
CFLAGS += -DCOAP_RESOURCE_LED
CFLAGS += -DCOAP_RESOURCE_ALL #TEMP + HUM + VOLT
mab@shelbyville:~/src/external/svn/tinyos-main-svn/support/sdk/c/coap/examples$
./coap-client -m get coap://[fec0::3]:61616/sv -T aa -t binary
C\x01E\x91\x11*\x82sv"aa
send to [fec0::3]:61616:
pdu (12 bytes) v:1 t:0 oc:3 c:1 id:17809 o: 1:'*' 9:'sv' 11:'aa'
Aug 29 10:41:37 ** received from [fec0::3]:61616:
pdu (11 bytes) v:1 t:2 oc:2 c:80 id:17809 o: 1:'*' 11:'aa'
data:'!\x01'
Aug 29 10:41:37 *** removed transaction 17809
** process pdu: pdu (11 bytes) v:1 t:2 oc:2 c:80 id:17809 o: 1:'*' 11:'aa'
data:'!\x01'
** Voltage: 2.89 V
^C
mab@shelbyville:~/src/external/svn/tinyos-main-svn/support/sdk/c/coap/examples$
./coap-client -m get coap://[fec0::3]:61616/sh -T aa -t binary
C\x01\x980\x11*\x82sh"aa
send to [fec0::3]:61616:
pdu (12 bytes) v:1 t:0 oc:3 c:1 id:38960 o: 1:'*' 9:'sh' 11:'aa'
Aug 29 10:41:34 ** received from [fec0::3]:61616:
pdu (11 bytes) v:1 t:2 oc:2 c:80 id:38960 o: 1:'*' 11:'aa'
data:'@\x14'
Aug 29 10:41:34 *** removed transaction 38960
** process pdu: pdu (11 bytes) v:1 t:2 oc:2 c:80 id:38960 o: 1:'*' 11:'aa'
data:'@\x14'
** Humidity: 51.84 %
^C
mab@shelbyville:~/src/external/svn/tinyos-main-svn/support/sdk/c/coap/examples$
./coap-client -m get coap://[fec0::3]:61616/st -T aa -t binary
C\x01 @\x11*\x82st"aa
send to [fec0::3]:61616:
pdu (12 bytes) v:1 t:0 oc:3 c:1 id:8256 o: 1:'*' 9:'st' 11:'aa'
Aug 29 10:41:41 ** received from [fec0::3]:61616:
pdu (4 bytes) v:1 t:2 oc:0 c:0 id:8256
Aug 29 10:41:41 *** removed transaction 8256
** process pdu: pdu (4 bytes) v:1 t:2 oc:0 c:0 id:8256
** PreAck received
Aug 29 10:41:41 ** received from [fec0::3]:61616:
pdu (11 bytes) v:1 t:0 oc:2 c:80 id:20742 o: 1:'*' 11:'aa'
data:' u'
** process pdu: pdu (11 bytes) v:1 t:0 oc:2 c:80 id:20742 o: 1:'*' 11:'aa'
data:' u'
** Temperatur: 299.84 K
send to [fec0::3]:61616:
pdu (4 bytes) v:1 t:2 oc:0 c:0 id:20742
mab@shelbyville:~/src/external/svn/tinyos-main-svn/support/sdk/c/coap/examples$
./coap-client -m get coap://[fec0::3]:61616/r -T aa -t binary
C\x011\x06\x11*\x81r"aa
send to [fec0::3]:61616:
pdu (11 bytes) v:1 t:0 oc:3 c:1 id:12550 o: 1:'*' 9:'r' 11:'aa'
Aug 29 10:41:49 ** received from [fec0::3]:61616:
pdu (4 bytes) v:1 t:2 oc:0 c:0 id:12550
Aug 29 10:41:49 *** removed transaction 12550
** process pdu: pdu (4 bytes) v:1 t:2 oc:0 c:0 id:12550
** PreAck received
Aug 29 10:41:49 ** received from [fec0::3]:61616:
pdu (18 bytes) v:1 t:0 oc:2 c:80 id:20743 o: 1:'*' 11:'aa'
data:'\x02 u\x12\xEF\x13"!\x01'
** process pdu: pdu (18 bytes) v:1 t:0 oc:2 c:80 id:20743 o: 1:'*' 11:'aa'
data:'\x02 u\x12\xEF\x13"!\x01'
** All values:
** Temperature: 299.84 K
** Humidity: 51.03 %
** Voltage: 2.89 V
send to [fec0::3]:61616:
pdu (4 bytes) v:1 t:2 oc:0 c:0 id:20743
mab@shelbyville:~/src/external/svn/tinyos-main-svn/support/sdk/c/coap/examples$
./coap-client -m get coap://[fec0::3]:61616/l -T aa -t binary
C\x01Z<\x11*\x81l"aa
send to [fec0::3]:61616:
pdu (11 bytes) v:1 t:0 oc:3 c:1 id:23100 o: 1:'*' 9:'l' 11:'aa'
Aug 29 10:41:54 ** received from [fec0::3]:61616:
pdu (10 bytes) v:1 t:2 oc:2 c:80 id:23100 o: 1:'*' 11:'aa'
data:'\x02'
Aug 29 10:41:54 *** removed transaction 23100
** process pdu: pdu (10 bytes) v:1 t:2 oc:2 c:80 id:23100 o: 1:'*' 11:'aa'
data:'\x02'
** led 0 (red) OFF
** led 1 (green) ON
** led 2 (blue) OFF
> Any hint is welcome.
Hope this helps.
Markus
------------------------------------------------
| Dipl.-Ing. Markus Becker
| Communication Networks
| TZI - Center for Computing Technologies
| University Bremen
| Germany
------------------------------------------------
| web: http://www.comnets.uni-bremen.de/~mab/
| mailto: [email protected]
| telephone: +49 421 218 62379
| building: NW1 room: N2260
------------------------------------------------
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help