From 55bd6f0cd724ff64d5075d638e61ca8c912636ad Mon Sep 17 00:00:00 2001 From: test2 Date: Tue, 24 Mar 2020 00:53:14 +0200 Subject: [PATCH] info --- IoT-Wireless/Lab-I.adoc | 240 +++++++++++++++++++++++++++++++++++++++ IoT-Wireless/header.adoc | 5 + 2 files changed, 245 insertions(+) create mode 100644 IoT-Wireless/Lab-I.adoc create mode 100644 IoT-Wireless/header.adoc diff --git a/IoT-Wireless/Lab-I.adoc b/IoT-Wireless/Lab-I.adoc new file mode 100644 index 0000000..60a9c18 --- /dev/null +++ b/IoT-Wireless/Lab-I.adoc @@ -0,0 +1,240 @@ += IoT Wireless ! +Apostolos rootApostolos@swarmlab.io +// Metadata: +:description: IoT +:keywords: iot, swarm +:data-uri: +:toc: right +:toc-title: Πίνακας περιεχομένων +:toclevels: 4 +:source-highlighter: highlight +:icons: font +:sectnums: + +include::header.adoc[] + + +{empty} + + + + +== Contiki + +Contiki is a state-of-the-art, open +source operating system for sensor networks and other networked embedded +devices + + +More Info: +https://en.wikipedia.org/wiki/Contiki[^] + + +== Start Instant Contiki + + +.Start VMware and load Instant Contiki. +[source,bash] +---- +unzip InstantContiki2.7.zip +vmplayer +---- +Start image + +== Log In +When the login screen appears, log in to Instant Contiki: + +.Log In usermode +[source,bash] +---- +Username: user +Password: user +---- + +.Log In sudo +[source,bash] +---- +sudo apt update +Password: user +---- + +== Open a Terminal + +After logging in, click on the terminal icon to start a terminal window. + +== System test + + +.compile hello-world +[source,bash] +---- +cd contiki/examples/hello-world/ +make TARGET=native +---- + +.Run the Hello World program in Contiki: +[source,bash] +---- +./hello-world.native +---- + +The program should print the words *“Hello, world”* on the screen and then appear to hang. + +In reality, Contiki is still running correctly, but will not produce any output because the Hello World program has finished. +[source,bash] +---- +Press Ctrl+C on the keyboard to quit. +---- + + +== Simulating Contiki with COOJA + +=== Start COOJA + +.start +[source,bash] +---- +cd contiki/tools/cooja/ +ant run +---- + +[NOTE] +.INFO +==== +COOJA compiles, and after a few seconds the simulator appears. + +All COOJA simulations are controlled using plugins: small Java programs that interact with simulations and simulated nodes. + +When COOJA is started, no simulation is loaded and no plugins are started. +==== + +=== Create a simulation + +A new simulation is created via the menu. + +[source,bash] +---- +File > New > Simulation +---- + +- Enter a Simulation title, and click Create. + +We have now created our first simulation in COOJA. However, the simulation does not contain any nodes yet. + +To add nodes we need to first create a node type, and then add nodes to the simulation. + +=== Create a node type + +Any simulated node in COOJA belongs to a node type. + +The node type determines, among others, which Contiki applications to simulate. + + +Click menu item + +[source,bash] +---- +Motes > Add Motes > Create new mote type > Sky mote. +---- + +You have selected to emulate Tmote Sky nodes, and now need to select what Contiki program to simulate. + +- Enter a Description. +- *Click Browse*, and navigate to *contiki/examples/hello-world/hello-world.c* +- *Click Compile* to start compiling the Contiki program +- *Click Create* when complication finishes. + +You will be asked to enter the number of motes of your simulation. + +Once you are done, click the Start button in the Simulation control window to start the simulation. + + + +=== Save, Load and Reload in Cooja + +Cooja allows for saving and loading simulation configurations. +When a simulation is saved, all active plugins are also stored with the configuration. + +.save your current simulation +[source,bash] +---- +File > Save simulation +---- + +.Open simulation +[source,bash] +---- +File > Open simulation > Browse... +---- + +Select a simulation configuration. + +When a simulation is loaded, all simulated Contiki applications are recompiled. + + +.reload your current simulation: +[source,bash] +---- +File > Reload simulation +or press +Ctrl+R +---- + +.Reminder +[NOTE] +==== +Reloading can be used to reset the simulation – to restart all nodes. + +More importantly, reloading a simulation will recompile all Contiki code, useful while developing Contiki programs. +==== + + + +=== Add simulated nodes + +[source,bash] +---- +Motes > Add motes > [your type description] +---- + +Enter the number of nodes you want to simulate (e.g., 5), and press Add. + + +=== Show properties + +Go to the *“Network”* window, click the *view* menu, and choose the properties you want to show for the nodes. + + +==== Radio model in Cooja + +From the Network window, click on the + +[source,bash] +---- +View > Radio Environment (UDGM) +---- + + +If you now left-click on one of the nodes, you will see a green circle around the selected node. + +[NOTE] +==== +The green circle presents the transmission range of the node, i.e. the selected node can communicate with all other nodes within that circle. + +You may also see a grey circle around the green circle. +A node in the grey area cannot receive packets correctly +==== + + + + + + +:hardbreaks: + +{empty} + +{empty} + +{empty} + +:!hardbreaks: + +''' diff --git a/IoT-Wireless/header.adoc b/IoT-Wireless/header.adoc new file mode 100644 index 0000000..6caffd1 --- /dev/null +++ b/IoT-Wireless/header.adoc @@ -0,0 +1,5 @@ +[options="header"] +|======================= +|http://docs.swarmlab.io[Home] icon:home[link="http://docs.swarmlab.io", window="_self"]|http://docs.swarmlab.io/Howtos[HowTos] icon:wpbeginner[link="http://docs.swarmlab.io/Howtos", window="_self"]|http://docs.swarmlab.io/lab[Labs] icon:mixcloud[link="http://docs.swarmlab.io/lab", window="_self"] +|======================= +[.right.text-center]