Contiki NG Cheat Sheet
Contiki NG Cheat Sheet
Installation Configuration
Include a module
Visit: https://github.com/contiki-ng/contiki-ng/wiki
In Makefile, add MODULES += <path>
Run make distclean
Build System Select network stack
Set current target and board to <x> and <y> In Makefile, set:
make TARGET=<x> BOARD=<y> savetarget MAKE_MAC = MAKE_MAC_CSMA CSMA MAC
Build firmware <z> MAKE_MAC = MAKE_MAC_TSCH TSCH MAC
make <z> MAKE_ROUTING = MAKE_ROUTING_RPL_LITE RPL-Lite routing
Flash firmware <z> on port <p> (e.g. /dev/ttyUSB0) MAKE_ROUTING = MAKE_ROUTING_RPL_CLASSIC RPL-Classic routing
make <z>.upload PORT=<p> MAKE_NET = MAKE_NET_NULLNET No IPv6
ake targets
Selected m MAKE_NET = MAKE_NET_IPV6 IPv6
viewconf Shows current config flags Then, run make distclean
targets Shows list of supported TARGET System configuration
boards Shows list of BOARD for current TARGET Add project-conf.h to your project directory
savetarget Saves current TARGET and BOARD Run make distclean
savedefines Saves current DEFINES flags
Check common configuration flags
%.o Produces object file
%.e Produces pre-processed file Run make viewconf
%.s Produces assembly file Check out os/contiki-default-conf.h
%.ramprof Shows RAM profile of a firmware
%.flashprof Shows ROM profile of a firmware
login View serial output on port PORT Logging System
motelist-all Shows list of connected devices Set log level
usage Shows a brief help For RPL Info logs, in project-conf.h, add:
#define LOG_CONF_LEVEL_IPV6 LOG_LEVEL_INFO
Shell Log levels
Enable shell LOG LEVEL NONE Logs disabled
In Makefile, add MODULES += os/services/shell LOG LEVEL ERR Errors
Run make distclean LOG LEVEL WARN Errors and warnings
Connect to shell on port <p> (e.g. /dev/ttyUSB0) LOG LEVEL INFO Errors, warnings, and information logs
make login PORT=<p> LOG_LEVEL_DBG All the above and debug messages
Selected commands Main log modules
ip-addr Shows all IPv6 addresses LOG_CONF_LEVEL_MAC MAC layer protocol
ip-nbr Shows all IPv6 neighbors LOG_CONF_LEVEL_IPV6 IPv6 stack
log module level Set log level (0--4) for a given module (or “all”) LOG_CONF_LEVEL_RPL RPL routing protocol
ping addr Pings the IPv6 address ‘addr’ All modules and options
rpl-set-root Sets node as root or not, sets prefix Check out os/sys/log-conf.h
rpl-status Shows a summary of the current RPL state
rpl-nbr Shows the RPL neighbor table
routes Shows the route entries Simulation
help Shows a brief help
Cooja: Start from tools/cooja by running ant run
Renode: Run renode