Blame view

RIOT/examples/default/README.md 4.74 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  examples/default
  ================
  This application is a showcase for RIOT's hardware support. Using it
  for your board, you should be able to interactively use any hardware
  that is supported.
  
  To do this, the application uses the `shell` and `shell_commands`
  modules and all the driver modules each board supports.
  
  `shell` is a very simple interactive command interpreter that can be
  used to call functions.  Many of RIOT's modules define some generic
  shell commands. These are included via the `shell_commands` module.
  
  Additionally, the `ps` module which provides the `ps` shell command is
  included.
  
  Usage
  =====
  
  Build, flash and start the application:
  ```
  export BOARD=your_board
  make
  make flash
  make term
  ```
  
  The `term` make target starts a terminal emulator for your board. It
  connects to a default port so you can interact with the shell, usually
  that is `/dev/ttyUSB0`. If your port is named differently, the
  `PORT=/dev/yourport` variable can be used to override this.
  
  
  Example output
  ==============
  
  The shell commands come with online help. Call `help` to see which commands
  exist and what they do.
  
  Running the `help` command on an iotlab-m3:
  ```
  2015-09-16 16:57:17,723 - INFO # help
  2015-09-16 16:57:17,725 - INFO # Command              Description
  2015-09-16 16:57:17,726 - INFO # ---------------------------------------
  2015-09-16 16:57:17,727 - INFO # reboot               Reboot the node
  2015-09-16 16:57:17,729 - INFO # ps                   Prints information about running threads.
  2015-09-16 16:57:17,731 - INFO # isl29020_init        Initializes the isl29020 sensor driver.
  2015-09-16 16:57:17,733 - INFO # isl29020_read        Prints data from the isl29020 sensor.
  2015-09-16 16:57:17,735 - INFO # lps331ap_init        Initializes the lps331ap sensor driver.
  2015-09-16 16:57:17,737 - INFO # lps331ap_read        Prints data from the lps331ap sensor.
  2015-09-16 16:57:17,739 - INFO # l3g4200d_init        Initializes the l3g4200d sensor driver.
  2015-09-16 16:57:17,740 - INFO # l3g4200d_read        Prints data from the l3g4200d sensor.
  2015-09-16 16:57:17,742 - INFO # lsm303dlhc_init      Initializes the lsm303dlhc sensor driver.
  2015-09-16 16:57:17,744 - INFO # lsm303dlhc_read      Prints data from the lsm303dlhc sensor.
  2015-09-16 16:57:17,746 - INFO # ifconfig             Configure network interfaces
  2015-09-16 16:57:17,747 - INFO # txtsnd               Sends a custom string as is over the link layer
  ```
  
  Running the `ps` command on an iotlab-m3:
  
  ```
  2015-09-16 16:57:57,634 - INFO # ps
  2015-09-16 16:57:57,637 - INFO #    pid | name                 | state    Q | pri | stack ( used) | location
  2015-09-16 16:57:57,640 - INFO #      1 | idle                 | pending  Q |  15 |   256 (  140) | 0x20000200
  2015-09-16 16:57:57,642 - INFO #      2 | main                 | pending  Q |   7 |  1536 (  640) | 0x20000300
  2015-09-16 16:57:57,645 - INFO #      3 | pktdump              | bl rx    _ |   6 |  1536 (  544) | 0x200025e0
  2015-09-16 16:57:57,647 - INFO #      4 | at86rfxx             | bl rx    _ |   3 |  1024 (  360) | 0x2000099c
  2015-09-16 16:57:57,649 - INFO #        | SUM                  |            |     |  4352 ( 1684)
  ```
  
  RIOT specific
  =============
  
  The `ps` command is used to analyze the thread's state and memory
  status.
  
  
  Networking
  ==========
  
  The `ifconfig` command will help you to configure all available network
  interfaces. On an iolab-m3 it will print something like:
  ```
  2015-09-16 16:58:37,762 - INFO # ifconfig
  2015-09-16 16:58:37,766 - INFO # Iface  4   HWaddr: 9e:72  Channel: 26  NID: 0x23  TX-Power: 0dBm  State: IDLE CSMA Retries: 4
  2015-09-16 16:58:37,768 - INFO #            Long HWaddr: 36:32:48:33:46:da:9e:72
  2015-09-16 16:58:37,769 - INFO #            AUTOACK  CSMA
  2015-09-16 16:58:37,770 - INFO #            Source address length: 2
  ```
  
  Type `ifconfig help` to get an online help for all available options (e.g.
  setting the radio channel via `ifconfig 4 set chan 12`).
  
  The `txtsnd` command allows you to send a simple string directly over the link
  layer using unicast or broadcast. The application will also automatically print
  information about any received packet over the serial. This will look like:
  ```
  2015-09-16 16:59:29,187 - INFO # PKTDUMP: data received:
  2015-09-16 16:59:29,189 - INFO # ~~ SNIP  0 - size:  28 byte, type:
  NETTYPE_UNDEF (0)
  2015-09-16 16:59:29,190 - INFO # 000000 7b 3b 3a 02 85 00 e7 fb 00 00 00 00 01
  02 5a 55
  2015-09-16 16:59:29,192 - INFO # 000010 40 42 3e 62 f2 1a 00 00 00 00 00 00
  2015-09-16 16:59:29,194 - INFO # ~~ SNIP  1 - size:  18 byte, type:
  NETTYPE_NETIF (-1)
  2015-09-16 16:59:29,195 - INFO # if_pid: 4  rssi: 49  lqi: 78
  2015-09-16 16:59:29,196 - INFO # src_l2addr: 5a:55:40:42:3e:62:f2:1a
  2015-09-16 16:59:29,197 - INFO # dst_l2addr: ff:ff
  2015-09-16 16:59:29,198 - INFO # ~~ PKT    -  2 snips, total size:  46 byte
  ```