User Tools

Site Tools


proiecte:temp

This is an old revision of the document!


Temp

Introduction

TODO

Network Topology

The system consists of 2 interconnected networks: the first network, formed by the Sparrow nodes, is connected to an external network through a border router. Once data reaches the external network, it can be stored in a database and/or sent to user devices.

 Network Topology

One of the Sparrow nodes is chosen to be the border router that communicates with a host using a tool called tunslip6. Tunslip6 creates a virtual network interface(tun0) and uses SLIP (Serial Line Internet Protocol) to encapsulate the traffic on the serial line. The border router will receive the address aaaa::1 and it will form a network with the other Sparrow nodes, by passing the prefix received from the host to all nodes.

The other Sparrow nodes will run Contiki with a CoAP server as the main application. Those nodes will acquire data using different sensors and will pass the data to the CoAP client in the external network.

TODO - Title

Sensor nodes are devices capable of acquiring information from the environment using different types of sensors attached to them. Those sensors perform measurements and return information such as the value of the temperature, the quality of air, the value of the humidity in the air, etc. The microcontroller communicates with the sensors and retrieves the data gathered by them to process/analyze/send it further. The transmission of the data from the sensors to the microcontroller is done using a common language (communication protocol) that enforces a set of communication rules to allow the exchange of information. Similarly, to transmit the data from the sensor node to a different device (a laptop, a phone, a different node, etc.) a protocol must be established between the entities that wish to communicate. Actually, multiple protocols are usually used to allow communication between devices, each one of them governing a different communication level/layer. The scheme of protocols for sensor nodes communication used in this project is depicted in the following diagram.

 Communication Protocols

CoAP is an application layer protocol used for message transfer on devices with very strict memory constraints. Since CoAP is based on the REST model, obtaining data from the nodes using CoAP is similar to performing HTTP requests. For each sensor attached to the Sparrow nodes a resource object can be created, to store information about the data provided by the sensor and to associate a handler for each request that can be made on that sensor. For example, if a GET operation is possible for a sensor, a “get” handler will be linked to the resource. The CoAP client will perform a GET operation on the path at which the resource is found. The CoAP server is responsible for associating a path with the object that represents that resource.

coapclient -o REQUEST -p PATH

where “REQUEST” can be one of the following: GET|PUT|POST|DELETE|DISCOVER|OBSERVE and PATH is the path where the resource is found on the server. For example, here is a command that requests the temperature value from the server:

coapclient -o GET -p coap://[aaaa::11:22:33:44]:5683/sensors/temperature

In the above command, aaaa::11:22:33:44 is the ip address of the CoAP server running on the Sparrow node and 5683 is the port. “/sensors/temperature” is the path at which the resource can be found.

Setup

The components needed to setup the system are:

  1. One Sparrow node that will play the role of the border router.
  2. One or more Sparrow nodes that will run CoAP servers and will gather data.
  3. A device(e.g. laptop) that will run a CoAP client that will make requests to the CoAP server. Optionally, this device can also send the data received form the CoAP server in cloud.

The following steps need to be followed to setup the system:

git clone https://github.com/narcisaam/contiki-sparrow
git checkout sparrow

To make and upload the border-router application to the Sparrow node

cd examples/ipv6/rpl-border-router
make TARGET=sparrow savetarget
make upload WITH_SLIP=1 WITH_WEBSERVER=0 AVRDUDE_PORT=/dev/ttyUSB0

WITH_SLIP=1 enables SLIP communication between the Sparrow node and the host that will run the CoAP client(the laptop). The border-router can optionally host a mini webserver which can be disabled using WITH_WEBSERVER=0 option. /dev/ttyUSB0 should be replaced with the corresponding path on which the Sparrow node is connected.

To bridge the Sparrow nodes network and the host's network through the border router, the tunslip6 tool is used. To

cd tools
make tunslip6
cd examples/ipv6/rpl-border-router
sudo ../../../tools/tunslip6 aaaa::1/64 -s /dev/ttyUSB0 -B 38400 -v6
proiecte/temp.1537782168.txt.gz · Last modified: 2018/09/24 12:42 by narcisa_ana.vasile