This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
lab10 [2016/01/12 13:50] dan.tudose created |
lab10 [2018/01/25 19:03] (current) narcisa_ana.vasile [Building] |
||
---|---|---|---|
Line 5: | Line 5: | ||
SLIP is the " | SLIP is the " | ||
- | Contiki uses SLIP to bridge the wireless IPv6 network onto a PC via a USB connection. So with your Zigduino | + | Contiki uses SLIP to bridge the wireless IPv6 network onto a PC via a USB connection. So with your Sparrow |
- | On Zigduino, there is only one UART exposed. This means we have to choose between reading debug messages and connecting to our PC via SLIP. This change is exposed by adding " | + | On Sparrow, there is only one UART exposed. This means we have to choose between reading debug messages and connecting to our PC via SLIP. This change is exposed by adding " |
- | Speaking of the PC side... In order for SLIP to work, something on the host PC has to be listening. Using Instant Contiki, the ' | + | Speaking of the PC side... In order for SLIP to work, something on the host PC has to be listening. Using Instant Contiki, the ' |
===== Building ===== | ===== Building ===== | ||
First, built the tunslip6 tool. This works without modification on Instant Contiki. | First, built the tunslip6 tool. This works without modification on Instant Contiki. | ||
- | |||
< | < | ||
$ cd tools | $ cd tools | ||
Line 23: | Line 22: | ||
< | < | ||
$ cd examples/ | $ cd examples/ | ||
- | $ make TARGET=avr-zigduino | + | $ make TARGET=sparrow |
$ make WITH_SLIP=1 WITH_WEBSERVER=0 -j10 | $ make WITH_SLIP=1 WITH_WEBSERVER=0 -j10 | ||
$ make upload AVRDUDE_PORT=/ | $ make upload AVRDUDE_PORT=/ | ||
+ | |||
+ | ===== Connecting ===== | ||
+ | |||
+ | Ok, now it's built. Let's bring up the slip interface on Linux. Note that the baud rate here has to match the baud rate in the uart setup on the board, which is currently 38400. That's a little slow, but I'll work on bringing it up in future revisions. Also note the " | ||
+ | |||
+ | < | ||
+ | ********SLIP started on ``/ | ||
+ | ifconfig tun0 inet `hostname` up | ||
+ | ifconfig tun0 add aaaa:: | ||
+ | ifconfig tun0 | ||
+ | tun0 Link encap: | ||
+ | inet addr: | ||
+ | inet6 addr: aaaa::1/64 Scope: | ||
+ | UP POINTOPOINT RUNNING NOARP MULTICAST | ||
+ | RX packets:0 errors:0 dropped:0 overruns:0 frame: | ||
+ | TX packets:0 errors:0 dropped:0 overruns:0 carrier: | ||
+ | | ||
+ | tun0 Link encap: | ||
+ | inet addr: | ||
+ | inet6 addr: aaaa::1/64 Scope: | ||
+ | UP POINTOPOINT RUNNING NOARP MULTICAST | ||
+ | RX packets:0 errors:0 dropped:0 overruns:0 frame: | ||
+ | TX packets:0 errors:0 dropped:0 overruns:0 carrier: | ||
+ | | ||
+ | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
+ | IP addresses [4 max] fdfd::3 fe80:: | ||
+ | *** Address: | ||
+ | Setting prefix aaaa:: created a new RPL dag Server IPv6 addresses: | ||
+ | fdfd:: | ||
+ | |||
+ | It's helpful that tunslip6 is putting through the debug messages from the Sparrow. So we can see the boot-up process complete successfully. | ||
+ | |||
+ | ===== Ping ===== | ||
+ | We should now be able to ping the border router from the host PC. First, we can ping its auto-configured aaaa::/64 address | ||
+ | < | ||
+ | PING aaaa:: | ||
+ | 64 bytes from aaaa:: | ||
+ | 64 bytes from aaaa:: | ||
+ | 64 bytes from aaaa:: | ||
+ | |||
+ | ===== Nodes Beyond the Border ===== | ||
+ | |||
+ | We want to reach more nodes than just the one connected. So let's add a route on the host PC. This "route add" command tells Ubuntu that whenever it wants to reach a node whose IP starts with fdfd::/64, it can send that through the tun0 interface. | ||
+ | |||
+ | < | ||
+ | $ sudo route -A inet6 add fdfd::/64 dev tun0 | ||
+ | $ netstat -r6 Kernel IPv6 routing table | ||
+ | Destination | ||
+ | aaaa::/ | ||
+ | fdfd::/ | ||
+ | |||
+ | Now that we have the route set up, we can put another node on the network, and ping that. | ||
+ | |||
+ | Put anything that speaks RPL on fdfd::1, for example rpl-collect/ | ||
+ | |||
+ | < | ||
+ | $ make TARGET=sparrow savetarget | ||
+ | $ make udp-sender.sparrow.u AVRDUDE_PORT=/ | ||
+ | |||
+ | Now see that we can ping it ok: | ||
+ | |||
+ | < | ||
+ | 64 bytes from fdfd::1: icmp_seq=1 ttl=64 time=67.8 ms | ||
+ | 64 bytes from fdfd::1: icmp_seq=2 ttl=64 time=66.3 ms</ | ||
+ | |||
+ | ====== Using the Webserver ====== | ||
+ | |||
+ | From a PC on our network, we want to view a web page served up by any node on our wireless IP network. This will allow us to look at sensor values or other data stored there. | ||
+ | |||
+ | ===== Building ===== | ||
+ | |||
+ | We'll put the rpl-border-router (with no webserver) on the node connected to the PC, and talk SLIP over USB between it and the PC. The other node will run webserver-ipv6 with ' | ||
+ | |||
+ | < | ||
+ | $ make TARGET=sparrow savetarget | ||
+ | $ make upload WITH_WEBSERVER=0 WITH_SLIP=1 AVRDUDE_PORT=/ | ||
+ | $ cd examples/ | ||
+ | $ make TARGET=sparrow savetarget | ||
+ | $ make WITH_WEBSERVER=webserver-nano -j10 | ||
+ | $ make upload login WITH_WEBSERVER=webserver-nano AVRDUDE_PORT=/ | ||
+ | |||
+ | ===== Running ===== | ||
+ | |||
+ | This has to be done in another window, because "make login" above took over that window. Here we will bring up the tunnel, and try everything out, one thing at a time. Ping the router, ping the webserver, do the ' | ||
+ | |||
+ | < | ||
+ | $ sudo route -A inet6 add fdfd::/64 dev tun0 | ||
+ | $ ping6 fdfd::3 $ ping6 fdfd:: | ||
+ | $ curl -g " | ||
+ | |||
+ | Here's what success looks like! | ||
+ | |||
+ | < | ||
+ | |||
+ | Plus here's the Wireshark summary of this conversation: | ||
+ | < | ||
+ | | ||
+ | 1 0.000000 | ||
+ | 2 0.242296 | ||
+ | 3 0.242351 | ||
+ | 4 0.242589 | ||
+ | 5 0.630341 | ||
+ | 6 0.630388 | ||
+ | 7 0.898326 | ||
+ | 8 0.898360 | ||
+ | 9 1.258323 | ||
+ | 10 1.258369 | ||
+ | 11 1.550390 | ||
+ | 12 1.550426 | ||
+ | 13 1.842334 | ||
+ | 14 1.842364 | ||
+ | 15 2.098333 | ||
+ | 16 2.098508 | ||
+ | 17 2.334295 |