User Tools

Site Tools


lab7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lab7 [2018/12/23 15:13]
dan.tudose [Hello World]
lab7 [2018/12/23 15:19] (current)
dan.tudose [Ping]
Line 13: Line 13:
 You need to download a special fork of Contiki to try these changes out. Open a Terminal, and then: You need to download a special fork of Contiki to try these changes out. Open a Terminal, and then:
  
-<code>$ cd ~ +<code bash>$ cd ~ 
 $ git clone https://github.com/narcisaam/contiki-sparrow.git -b sparrow  $ git clone https://github.com/narcisaam/contiki-sparrow.git -b sparrow 
 $ cd contiki-sparrow/platform/sparrow</code>  $ cd contiki-sparrow/platform/sparrow</code> 
Line 22: Line 22:
 Open a Terminal, and type these: Open a Terminal, and type these:
  
-<code>+<code bash>
 $ sed -i '/avr/d' /home/user/.profile  $ sed -i '/avr/d' /home/user/.profile 
 $ sudo aptitude update  $ sudo aptitude update 
Line 35: Line 35:
 Connect the Sparrow board to your computer through USB. Once this is done, you'll likely see a new //ttyUSB// port appear in ///dev//. In the folder ///contiki-sparrow/platform/sparrow// edit Makefile.sparrow, and change the default avrdude port to match your local settings. This only needs to be done once ever. From now on in this tutorial we'll assume the board is connected to //ttyUSB0//, but you can modify according to your local settings. Connect the Sparrow board to your computer through USB. Once this is done, you'll likely see a new //ttyUSB// port appear in ///dev//. In the folder ///contiki-sparrow/platform/sparrow// edit Makefile.sparrow, and change the default avrdude port to match your local settings. This only needs to be done once ever. From now on in this tutorial we'll assume the board is connected to //ttyUSB0//, but you can modify according to your local settings.
  
- <code> AVRDUDE_PORT ?= /dev/ttyUSB0 </code>+ <code bash> AVRDUDE_PORT ?= /dev/ttyUSB0 </code>
  
 ==== MAC Address / Node Number ==== ==== MAC Address / Node Number ====
Line 51: Line 51:
 It uses the same first 7 bytes, and lets you choose a different number for the last. From this point forward, we will refer to that last digit of the MAC address as the "Node number". To assign a node number to your node: It uses the same first 7 bytes, and lets you choose a different number for the last. From this point forward, we will refer to that last digit of the MAC address as the "Node number". To assign a node number to your node:
  
-<code>$ cd tools/set-eeprom +<code bash>$ cd tools/set-eeprom 
 $ make NODE=3 AVRDUDE_PORT=/dev/ttyUSB0 </code> $ make NODE=3 AVRDUDE_PORT=/dev/ttyUSB0 </code>
  
Line 80: Line 80:
 Now that we know the node itself is working and printing OK, we want to make sure two nodes can talk. The best way to do this is with a ping. Now that we know the node itself is working and printing OK, we want to make sure two nodes can talk. The best way to do this is with a ping.
  
-This requires two nodes. If you already have hello-world on one node, the easiest thing to do is to put ping-ipv6 on a second node, and ping the other. So for this example, say we already have hello-world working on node 3 on /dev/ttyUSB0.+This requires two nodes. If you already have hello-world on one node, the easiest thing to do is to put //ping-ipv6// on a second node, and ping the other. So for this example, say we already have //hello-world// working on node 3 on ///dev/ttyUSB0//.
  
-<code>$ cd tests/ping-ipv6 +We'll connect a second node to the computer, and presume it's connected to ///dev/ttyUSB1// and it's already been configured with node address 1. For this node, we'll need to compile and upload the //ping-ipv6// app and specify the node we'll want to ping.  
 + 
 +<code bash>$ cd tests/ping-ipv6 
 $ make upload AVRDUDE_PORT=/dev/ttyUSB1 NODE=3  $ make upload AVRDUDE_PORT=/dev/ttyUSB1 NODE=3 
 $ make login AVRDUDE_PORT=/dev/ttyUSB1 </code> $ make login AVRDUDE_PORT=/dev/ttyUSB1 </code>
lab7.1545570837.txt.gz · Last modified: 2018/12/23 15:13 by dan.tudose