178 | | |
179 | | |
180 | | |
181 | | |
182 | | |
183 | | |
184 | | |
185 | | |
186 | | |
| 178 | {{{ |
| 179 | $ svn --username [username] co https://svn-batch.grid.pub.ro/svn/Sensei-WP5/ |
| 180 | |
| 181 | [The above command if ask for some security certificate exchange; Accept it [yes]] |
| 182 | [otherwise it prompt for the password for svn access] |
| 183 | Enter your password. |
| 184 | }}} |
| 185 | If you have a working copy of Sensei-WP5/ already, you can just updated it: |
| 186 | * /Sensei-WP5$ svn up |
| 187 | |
| 188 | Copy the latest version of the gateway on your machine for experiment. |
| 189 | |
| 190 | * $ cp –r /Sensei-WP5/gateway/ ../ |
| 191 | |
| 192 | |
| 193 | == Program TmoteSky node with contiki-2.4 and sensei components == |
| 194 | |
| 195 | 1. Download and install Contiki-2.4 as instructed in Section 3.1 |
| 196 | |
| 197 | 2. Copy binaryws/ and sensei/ folders from svn (node-contiki/apps/) to contiki-2.4/apps/ |
| 198 | * /Sensei-WP5$ cp -r node-contiki/apps/sensei/ ../contiki2.4/apps/ |
| 199 | * /Sensei-WP5$ cp -r node-contiki/apps/binaryws ../contiki2.4/apps/ |
| 200 | |
| 201 | 3. Copy cxmac files in order to enable nodes mobility |
| 202 | * /Sensei-WP5$ cp node-contiki/core/net/mac/cxmac.* ../contiki2.4/core/net/mac/ |
| 203 | |
| 204 | 4. Copy sensei-example/ folder from svn (node-contiki/examples/sensei-example) to |
| 205 | contiki-2.4/examples/ |
| 206 | |
| 207 | * /Sensei-WP5$ cp -r node-contiki/examples/sensei-example ../contiki2.4/examples/ |
| 208 | |
| 209 | 5. Compile and program a node |
| 210 | * contiki-2.4/examples/sensei$ make sensei.upload |
| 211 | |
| 212 | 6. In case you want to put debug prints into the code, you can see them in serial dump |
| 213 | * contiki-2.4/examples/sensei$ ../../tools/sky/serialdump-linux -b115200 /dev/ttyUSB0 |
| 214 | |
| 215 | |
| 216 | === Link files in Contiki using Makefiles === |
| 217 | |
| 218 | This section describes the steps how to link multiple files in Contiki OS using Makefiles. |
| 219 | |
| 220 | ==== contiki-2.4/examples/sensei-example/ ==== |
| 221 | |
| 222 | There are at least two files in /examples/sensei-example/ : sensei.c and Makefile |
| 223 | |
| 224 | Makefile should include following lines: |
| 225 | {{{ |
| 226 | all: sensei |
| 227 | APPS = binaryws sensei #folders that you want to include from contiki-2.4/apps/ |
| 228 | DEFAULT_TARGET=sky |
| 229 | CONTIKI = ../.. |
| 230 | include $(CONTIKI)/Makefile.include |
| 231 | }}} |
| 232 | |
| 233 | ==== /apps/binaryws ==== |
| 234 | |
| 235 | If the binaryws folder already exists, you can skip the following steps: |
| 236 | |
| 237 | 1. Create a directory in /apps/binaryws |
| 238 | 2. The binaryws directory should contains libBWS.c and libBWS.h file. |
| 239 | 3. If there is no Makefile.binaryws in the /binaryws folder, create a file “Makefile.binaryws” in the binaryws folder. |
| 240 | 4. Then into /apps/binaryws/Makefile.binaryws file write your source file as follows: |
| 241 | |
| 242 | binaryws_src = libBWS.c |
| 243 | |
| 244 | **Note that libBWS.c should have a line: #include "libBWS.h" |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |