wsn lab ipv6 on wsn

14
Lab Session Indoors and Outdoors: how far can we go? every 2 seconds, transmit unicast packets to your neighbour + light a LED everytime you send/receive a packet Unicast example Timer every 2 sec Toggle red LED when you send, green LED when received Tuesday, March 8, 2011

Upload: kyloz

Post on 24-Apr-2015

81 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: WSN Lab IPv6 on WSN

Lab Session

• Indoors and Outdoors: how far can we go?

• every 2 seconds, transmit unicast packets to your neighbour + light a LED everytime you send/receive a packet

• Unicast example

• Timer every 2 sec

• Toggle red LED when you send, green LED when received

Tuesday, March 8, 2011

Page 2: WSN Lab IPv6 on WSN

Lab Session

• Indoors and Outdoors: how far can we go?

• examples/rime example-unicast2.c

• Setting up a multi-hop network

• Measuring temperature or battery outdoors/indoors via multi-hop

Tuesday, March 8, 2011

Page 3: WSN Lab IPv6 on WSN

REMINDER: your RIME address

• make z1-reset && make login

• “Rime Started address with 225.1”

Tuesday, March 8, 2011

Page 4: WSN Lab IPv6 on WSN

Lab Session Tuesday 8th • Summing up yesterday’s Lab:

• Yesterday you should have checked distance between two sensor nodes, putting together several things you should have learned last week

• It was done via unicast packets sent between you and your partner

• Solution was in examples/rime/example-unicast2.c and example-unicast3.c

• You should have added led toggling when sending and receiving packets, and should have got between 60m ~ 200m LOS, outdoors, depending on the nodes you used.

Tuesday, March 8, 2011

Page 5: WSN Lab IPv6 on WSN

Lab Session Tuesday 8th • Today we will set an IPv6 Multihop network

• I will run a border router, (to avoid interferences)

• later maybe you can run border-router in a different channel from anyone else

• Each of you will run a web-server on their own mote!!! Then I’ll be able to connect to your sever, and turn your leds on/off, or see the last history of your battery and temperature sensor readings

Tuesday, March 8, 2011

Page 6: WSN Lab IPv6 on WSN

Lab Session Tuesday 8th

• Today, first of all get my changes typing 2 commands:

• git stash save

• git pull

• go to examples/ipv6/z1-websense directory

Tuesday, March 8, 2011

Page 7: WSN Lab IPv6 on WSN

Lab Session Tuesday 8th • Look at z1-websense.c, see main THREAD

• upload program to Z1 mote with command:

• make z1-websense.upload

• find out YOUR OWN IPv6 local link MAC address (how? make z1-reset && make login)

• mine is: fe80::c30c:0:0:97 (yours will differ!). I want to know!

• My border router will assign your mote the routable address aaaa::c30c:0:0:97

Tuesday, March 8, 2011

Page 8: WSN Lab IPv6 on WSN

Route Discovery• Now if I see the webpage of

the border router I will see all discovered nodes, with their own address, and how to get to them. After a while, look, 2 nodes at my reach!

• I can ping each discovered node with e.g., for my mote:

• ping6 aaaa::c30c:0:0:97

• Some nodes can be routed via other nodes, we’ll see

Tuesday, March 8, 2011

Page 9: WSN Lab IPv6 on WSN

I will ping6 your node (come and I’ll let you do it)• enricm@ubuntu:~/$ ping6 aaaa::c30c:0:0:97

• PING aaaa::c30c:0:0:97(aaaa::c30c:0:0:97) 56 data bytes

• 64 bytes from aaaa::c30c:0:0:97: icmp_seq=1 ttl=63 time=105 ms

• 64 bytes from aaaa::c30c:0:0:97: icmp_seq=2 ttl=63 time=91.6 ms

• 64 bytes from aaaa::c30c:0:0:97: icmp_seq=3 ttl=63 time=201 ms

• 64 bytes from aaaa::c30c:0:0:97: icmp_seq=4 ttl=63 time=188 ms

• 64 bytes from aaaa::c30c:0:0:97: icmp_seq=5 ttl=63 time=178 ms

• 64 bytes from aaaa::c30c:0:0:97: icmp_seq=6 ttl=63 time=160 ms

• 64 bytes from aaaa::c30c:0:0:97: icmp_seq=7 ttl=63 time=510 ms

Tuesday, March 8, 2011

Page 10: WSN Lab IPv6 on WSN

Let’s see your sensing data

• Your node is running a web server, capable of showing your battery sensor and your temperature sensor. Just go to its address [aaaa:c30c:0:0:97]

• It can do lots of stuff, look:

Tuesday, March 8, 2011

Page 11: WSN Lab IPv6 on WSN

Small commands for your webserver

• Commands are sent adding a special page at the end:

• http://[aaaa::c30c:0:0:97]/1 turn leds-on

• http://[aaaa::c30c:0:0:97]/0 turn leds-off

• http://[aaaa::c30c:0:0:97]/batt see last batt. readings

• http://[aaaa::c30c:0:0:97]/temp see last temp readings

Tuesday, March 8, 2011

Page 12: WSN Lab IPv6 on WSN

Example: battery readings

• http://[aaaa::c30c:0:0:97]/batt see last batt. readings

Tuesday, March 8, 2011

Page 13: WSN Lab IPv6 on WSN

Exercises

• How many sensor readings are kept in a buffer?

• How often is data sensed?

• How can you change the reach of your radio transmission in z1-websense?

Tuesday, March 8, 2011

Page 14: WSN Lab IPv6 on WSN

Let’s go!

• Outside, to the Miramare Park to sense temperature readings with IPv6.

Tuesday, March 8, 2011