This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
lab7 [2018/01/25 18:51] narcisa_ana.vasile [UDP] |
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: | ||
| - | < | + | < |
| $ git clone https:// | $ git clone https:// | ||
| - | $ cd contiki/ | + | $ cd contiki-sparrow/ |
| Line 22: | Line 22: | ||
| Open a Terminal, and type these: | Open a Terminal, and type these: | ||
| - | < | + | < |
| $ sed -i '/ | $ sed -i '/ | ||
| $ sudo aptitude update | $ sudo aptitude update | ||
| - | $ sudo apt-get install avr-libc gcc-avr binutils-avr avrdude git</ | + | $ sudo apt-get install avr-libc gcc-avr binutils-avr avrdude git libc6-i386</ |
| Then log out of the machine and back in again (or restart it). | Then log out of the machine and back in again (or restart it). | ||
| Line 33: | Line 33: | ||
| ==== Default avrdude port ==== | ==== Default avrdude port ==== | ||
| - | Edit Makefile.sparrow, | + | 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 /// |
| - | < | + | < |
| ==== MAC Address / Node Number ==== | ==== MAC Address / Node Number ==== | ||
| Line 41: | Line 41: | ||
| Each node needs a unique MAC address. The sparrow platform expects to find the MAC address as the first 8 bytes in EEPROM. | Each node needs a unique MAC address. The sparrow platform expects to find the MAC address as the first 8 bytes in EEPROM. | ||
| - | There is a special program just to program the MAC address. | + | There is a special program just to program the MAC address. |
| <code C> | <code C> | ||
| 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" | 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" | ||
| - | < | + | < |
| $ make NODE=3 AVRDUDE_PORT=/ | $ make NODE=3 AVRDUDE_PORT=/ | ||
| Line 57: | Line 57: | ||
| ===== Hello World ===== | ===== Hello World ===== | ||
| - | From a terminal, type... | + | Go back in your terminal |
| - | < | + | < |
| $make upload | $make upload | ||
| $make login </ | $make login </ | ||
| Line 65: | Line 65: | ||
| Working correctly, you should see this: | Working correctly, you should see this: | ||
| - | < | + | < |
| - | Power-on reset. External reset! | + | MAC address 2: |
| - | *******Booting Contiki 2.5******* | + | nullmac sicslowmac, channel 26, check rate 65535 Hz |
| - | MAC address 2: | + | Routing Enabled |
| - | IP addresses [4] fdfd::3 fe80:: | + | Autostart other processes |
| - | Hello, world </ | + | |
| + | IP addresses [4 max] | ||
| + | fdfd::3 | ||
| + | fe80:: | ||
| + | Hello, world | ||
| + | </ | ||
| ==== Ping ==== | ==== 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. | 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 / | + | 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 /// |
| + | |||
| + | We'll connect a second node to the computer, and presume it's connected to /// | ||
| - | < | + | < |
| $ make upload AVRDUDE_PORT=/ | $ make upload AVRDUDE_PORT=/ | ||
| $ make login AVRDUDE_PORT=/ | $ make login AVRDUDE_PORT=/ | ||
| Line 135: | Line 141: | ||
| ===== The Shell ===== | ===== The Shell ===== | ||
| - | The shell is a very powerful feature of Contiki. Within this OS lies a fully-featured command shell. The shell in the avr-zigduino | + | The shell is a very powerful feature of Contiki. Within this OS lies a fully-featured command shell. The shell in the sparrow |
| ==== Building ==== | ==== Building ==== | ||
| Line 185: | Line 191: | ||
| === blink & kill === | === blink & kill === | ||
| - | Try "blink 100 &" to start blinking the LED's for 100 times. Notice the '&' | + | Try "blink 100 &" to start blinking the LED's for 100 times. Notice the '&' |
| Then type "kill blink" when you're done admiring your blinking lights. | Then type "kill blink" when you're done admiring your blinking lights. | ||