Skip to content
maniacbug edited this page Aug 15, 2011 · 4 revisions

Navigation: Home | Scenarios | Installing | Using | Future

Using:Setup | Using:Troubleshooting | Using:Shell | Using:Sensors | Using:Actuation | Using:SLIP | Using:Webserver | Using:HTTP | Using:RPL

The shell is a very powerful feature of Contiki. Within this OS lies a fully-featured command shell. The shell in the avr-zigduino platform is a subset of the full Contiki shell, including only the shell modules which have been proven to work on this platform.

Table of Contents

Building

$ cd tests/shell
$ make upload
$ make login

Running

If successful, you'll see this:

connecting to /dev/ttyUSB1 (57600) [OK]

Power-on reset.
External reset!

*******Booting Contiki 2.5*******
MAC address 2:11:22:ff:fe:33:44:1
nullmac sicslowmac, channel 26
Contiki command shell 
Type '?' and return for help 
2.17: Contiki> 
IP addresses [4 max]
fdfd::1
fe80::11:22ff:fe33:4401

help

Now, try some of the commands, like 'help':

Available commands: 
?: shows this help 
binprint: print binary data in decimal format 
blink [num]: blink LEDs ([num] times) 
echo <text>: print <text> 
exit: exit shell 
hd: print binary data in hexadecimal format 
help: shows this help 
kill <command>: stop a specific command 
killall: stop all running commands 
netstat: show UDP and TCP connections 
null: discard input 
ping <host>: ping an IP host 
ps: list all running processes 
quit: exit shell 
randwait <maxtime> <command>: wait for a random time before running a command 
repeat <num> <time> <command>: run a command every <time> seconds 
size: print the size of the input 
time [seconds]: output time in binary format, or set time in seconds since 1970 
timestamp: prepend a timestamp to data 
2.17: Contiki> 

blink & kill

Try "blink 100 &" to start blinking the LED's for 100 times. Notice the '&' at the end of that! You should now see all 3 LED's on Zigduino flash on and off repeatedly.

Then type "kill blink" when you're done admiring your blinking lights.

ping

We can also ping from within the shell!

2.17: Contiki> ping fdfd::3
SEND 13 bytes
ping fdfd::3
Sending Echo Request to fdfd:0000:0000:0000:0000:0000:0000:0003 from fdfd:0000:0000:0000:0000:0000:0000:0001 
Other ICMP6 message received.
Echo reply received.
Clone this wiki locally