Clone this wiki locally
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
$ cd tests/shell<br/> $ make upload<br/> $ make login<br/>
If successful, you'll see this:
connecting to /dev/ttyUSB1 (57600) [OK]<br/> <br/> Power-on reset.<br/> External reset!<br/> <br/> *******Booting Contiki 2.5*******<br/> MAC address 2:11:22:ff:fe:33:44:1<br/> nullmac sicslowmac, channel 26<br/> Contiki command shell <br/> Type '?' and return for help <br/> 68.1: Contiki> <br/> IP addresses [4 max]<br/> fdfd::1<br/> fe80::11:22ff:fe33:4401<br/>
Now, try some of the commands, like 'help':
Available commands: <br/> ?: shows this help <br/> binprint: print binary data in decimal format <br/> blink [num]: blink LEDs ([num] times) <br/> echo <text>: print <text> <br/> exit: exit shell <br/> hd: print binary data in hexadecimal format <br/> help: shows this help <br/> kill <command>: stop a specific command <br/> killall: stop all running commands <br/> netstat: show UDP and TCP connections <br/> null: discard input <br/> ping <host>: ping an IP host <br/> ps: list all running processes <br/> quit: exit shell <br/> randwait <maxtime> <command>: wait for a random time before running a command <br/> repeat <num> <time> <command>: run a command every <time> seconds <br/> size: print the size of the input <br/> time [seconds]: output time in binary format, or set time in seconds since 1970 <br/> timestamp: prepend a timestamp to data <br/> 68.1: Contiki> <br/>
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.
We can also ping from within the shell!
68.1: Contiki> ping fdfd::3<br/> SEND 13 bytes<br/> ping fdfd::3<br/> Sending Echo Request to fdfd:0000:0000:0000:0000:0000:0000:0003 from fdfd:0000:0000:0000:0000:0000:0000:0001 <br/> Other ICMP6 message received.<br/> Echo reply received.<br/>