Subject: [core] Help me!!! Problem: running rest-example/rest-server-example.csc but "curl" command to get resource but it said: couldn't connect to host

From: Thanh Ngoc <[email-masked]>
Date: Mon, 29 Nov 2010 12:16:26 +0900

Dear Every one,

*could you help to solve the problem?
 i run rest-server-example, but when i used "curl" command to get result
from the IP address as readme.txt, it told me: couldn't connect to host
even though i can ping to this address and run everything successful as
redme.txt .*
do you know why did that problem  happen?
this is my detail :

1. i run rest-server-example.csc successful:
"-------------------------
user@instant-contiki:~/contiki-2.x/examples/rest-example$ *make TARGET=cooja
rest-server-example.csc*
....
INFO [main] (SerialSocketServer.java:120) - Listening on port: 60001
 INFO [Thread-3] (SerialSocketServer.java:179) - Forwarder: socket -> serial
port
"----------------------------
2. i run route connect-router-cooja successful
"-----------------------------------
user@instant-contiki:~/contiki-2.x/examples/rest-example$ *make
connect-router-cooja*
sudo ../../tools/tunslip6 -a 127.0.0.1 aaaa::1/64
slip connected to ``127.0.0.1:60001''
opened tun device ``/dev/tun0''
ifconfig tun0 inet `hostname` up
ifconfig tun0 add aaaa::1/64
ifconfig tun0

tun0      Link encap:UNSPEC  HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.1.1  P-t-P:127.0.1.1  Mask:255.255.255.255
          inet6 addr: aaaa::1/64 Scope:Global
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

SIN: 104
SUT: 104
SIN: 104
SUT: 104

"-------------------------------
3. I ping6 to address successful

"-------------------------------------------
user@instant-contiki:~$* ping6 aaaa::0212:7402:0002:0202*
PING aaaa::0212:7402:0002:0202(aaaa::212:7402:2:202) 56 data bytes
64 bytes from aaaa::212:7402:2:202: icmp_seq=1 ttl=63 time=187 ms
64 bytes from aaaa::212:7402:2:202: icmp_seq=2 ttl=63 time=177 ms
64 bytes from aaaa::212:7402:2:202: icmp_seq=3 ttl=63 time=165 ms

"-----------------------------------------------------

4. but when i use curl command to get result. it can not connect to host:
"-------------------------------------
user@instant-contiki:~/contiki-2.x/examples/rest-example$ *curl -H
"User-Agent: curl" aaaa::0212:7402:0002:0202:8080/helloworld #get
curl: (7) couldn't connect to host*
"-------------------------------------------

thank you very much,

     Ngoc Thanh