Piseth: Difference between revisions
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Implement WSN(Wireless Sensor Network) with different use cases and security mechanism/protocol. Analyze and Evaluate. | Implement WSN(Wireless Sensor Network) with different use cases and security mechanism/protocol. Analyze and Evaluate. | ||
[[File:passwords.png]][[File:Img_overview_test_upload_.jpg|300px|thumb|left|alt Test Alt]] | [[File:passwords.png]][[File:Img_overview_test_upload_.jpg|300px|thumb|left|alt Test Alt]] | ||
<!-- | |||
======================================================= | |||
Main Section header == | |||
Subsection === | |||
Start Idea of The list : underline <u></u> | |||
Main item: bullet * | |||
Steps : ordered item # | |||
Notice/Info : Bold | |||
Warning: Red | |||
======================================================== | |||
--> | |||
== Hardware == | == Hardware == | ||
Line 35: | Line 47: | ||
=== CC2538 EM === | === CC2538 EM === | ||
CC2538 Evaluation Module (EM) board is used to measure/evaluate RF performance. It operates on 2.4GHz frequency. In addition, CC2538 EM has pre-installed firmware that could be used to test send/receive packet. The hardware is not limited to the factory software, it's possible to flash other firmware to fit other purposes. | CC2538 Evaluation Module (EM) board is used to measure/evaluate RF performance. It operates on 2.4GHz frequency. In addition, CC2538 EM has pre-installed firmware that could be used to test send/receive packet. The hardware is not limited to the factory software, it's possible to flash other firmware to fit other purposes. | ||
CC2538 could be powered by: | <div id="cc2538_power"><u>CC2538 could be powered by:</u></div> | ||
* SmartRF06 EB | |||
# Connect to correct PIN on CC2538 [todo: image] | # Connect to correct PIN on CC2538 [todo: image] | ||
# Connect CC2538 EM to SmartRF06 [todo: image] | # Connect CC2538 EM to SmartRF06 [todo: image] | ||
# Power the SmartRF06 | # Power the SmartRF06 | ||
* USB port 3.3v ['''not tested'''] | |||
# Connect to correct PIN on CC2538 [todo: image] | # Connect to correct PIN on CC2538 [todo: image] | ||
# Connect to external source via usb | # Connect to external source via usb | ||
==== Compile Firmware ==== | ==== Compile Firmware ==== | ||
* | * First of all, Toolchain[dict] is required in order to compile firmware for specific platform. Instruction and the toolchain could be get from [https://launchpad.net/gcc-arm-embedded here]. | ||
* After Toolchain has been installed and properly configured, in source code folder, make sure there is <code>Makefile</code> that at least point to <code>Makefile.include</code> resided in contiki root folder. | |||
'''Example:''' source code reside in $CONTIKI_HOME/examples/hello-world/ , content of Makefile should look similar to this: | |||
CONTIKI_PROJECT = hello-world | |||
all: $(CONTIKI_PROJECT) | |||
CONTIKI = ../.. | |||
include $(CONTIKI)/Makefile.include | |||
Contiki is compiled with <code>make</code> command and it usually follows this format: | |||
make TARGET='''platform''' '''File-to-compile''' | |||
<br>'''Platforms''' to which source code could be compiled to, are stored as folders in <code>$CONTIKI_HOME/platforms</code> (Refer to contiki folder structure section for more detail) | |||
<br>'''File-to-compile''' could be omitted if Makefile is pointing to the file(s). Example: <code>all: hello-world</code> | |||
* To compile firmware for CC2538, go to folder source code, type: | |||
make TARGET=cc2538dk | |||
'''Example:''' From <code>$CONTIKI_HOME/examples/cc2538dk/</code> , type <code>make TARGET=cc2538dk</code> | |||
'''Note:''' '''TARGET=cc2538dk''' could also be excluded if Makefile.target file is pointing to cc2538dk platform. The file could be generated using command <code>make TARGET=cc2538dk savetarget</code>. | |||
==== Flash Firmware ==== | ==== Flash Firmware ==== | ||
* | * Make sure the CC2538 is properly connected to SmartRF06. ([[#cc2538_power|Refer to power section for detail]]). | ||
* CC2538-bsl | * Load CC2538 driver by following [https://github.com/contiki-os/contiki/tree/master/platform/cc2538dk this link] or run [https://drive.google.com/file/d/0ByMxntGV1RT4R2VKcnZ0RE1nNlU/view?usp=sharing this script] | ||
===== By CCS Uniflash (Linux, Window) ===== | |||
# Download and install uniflash from TI [http://processors.wiki.ti.com/index.php/Category:CCS_UniFlash Here] | |||
# Launch the app, select '''New Target Configuration''', then select these configuration: | |||
## Connection: '''Texas Instruments XD100v3 USB Debug Probe''' | |||
## Board or Device: '''CM2538SF53''' | |||
# Select '''Program''', then choose one of these two options: | |||
#* '''Load Program''' -> Click '''Browse''' -> Choose .hex file -> '''OK''' | |||
#* '''Load Binary''' -> Click Browser -> Choose .bin file -> '''Start Address''': 0x00200000 -> '''OK''' | |||
'''Note:''' (Refer to compile firmware section to get .bin or .hex file) | |||
===== By CC2538-bsl (Linux, Mac OS) ===== | |||
# Download cc2538-bsl: | |||
#* If contiki is cloned from github: In contiki folder, run <code>git submodule update --init</code> | |||
#* Or download cc2538-bsl from [https://github.com/JelmerT/cc2538-bsl github], then put it in <code>$CONTIKI_HOME/tools/</code> | |||
# Make device to go to bootloader mode, by press and hold on select button while press on Reset button. [todo: might need more clarification] | |||
# In contiki compile source code folder, type: | |||
make TARGET=cc2538dk '''[compiled-file]'''.upload | |||
'''[compiled-file]''' is the file that will be flash to the device | |||
===== By SmartRf Flash Programmer (Window)===== | |||
[Pending....] | |||
==== Restore Factory Firmware ==== | |||
# Download firmware from [https://drive.google.com/folderview?id=0ByMxntGV1RT4MEVZM0dPZk9ielk&usp=sharing here] | |||
# Flash firmware using CCS uniflash or SmartRF Flash Programmer (Refer to above section for detail) | |||
=== CC2650 Sensortag === | === CC2650 Sensortag === | ||
Line 123: | Line 177: | ||
== Issues faced == | == Issues faced == | ||
Sometimes, when the output filetype is not specified (Ex: <code>make TARGET=srf06-cc26xx BOARD=sensortag/cc2650</code>), the compilation returns error with: | Sometimes, when the output filetype is not specified (Ex: <code>make TARGET=srf06-cc26xx BOARD=sensortag/cc2650</code>), the compilation returns error with: | ||
[ | [[File:Error_compilation_miss_srec_cat.png|450px|thumb|center]] | ||
* Solution: | * Solution: | ||
The problem could be solved by specify the output file. For example | The problem could be solved by specify the output file. For example | ||
<code> make TARGET=srf06-cc26xx BOARD=sensortag/cc2650 udp-client.bin </code> | <code> make TARGET=srf06-cc26xx BOARD=sensortag/cc2650 udp-client.bin </code> | ||
---- | |||
[make space] | |||
== Pending to be Documented == | == Pending to be Documented == | ||
* [https://forge.cetic.be/issues/16288 flash usb dongle] | * [https://forge.cetic.be/issues/16288 flash usb dongle] |
Latest revision as of 21:45, 17 February 2016
Objectives of the internship
Implement WSN(Wireless Sensor Network) with different use cases and security mechanism/protocol. Analyze and Evaluate.
Hardware
SmartRF06 EB (Evaluation Board)
SmartRF06 EB is used to debug, flash, or it could act as power supply for other micro controllers like CC2538 EM or CC2650 sensortag.
SmartRF06 EB can be powered by several sources:
- Two 1.5v AAA batteries
- Switch to BAT on SOURCE switch [todo: image]
- Put batteries [todo: image]
- USB (1.5v via PC usb port or external usb source) [todo: image]
- Switch to USB on SOURCE switch [todo: image]
- Connect usb power source
- A 3-volt cell battery (CR2032) [not yet tested]
- Switch to BAT on SOURCE switch
- Insert the 3v battery [todo: image]
- External regulated source (3.6v) [not yet tested]
- pin used for external source (3.6v) [todo: image of the pin switch]
Reset Button:
When connect to a microcontroller, SmartRF06EB, to some extents, is able to:
- Reset(restart) the microcontroller firmware by clicking reset button [todo: image]
- Boot to bootloader(in case of CC2538) by holding select button while clicking reset button [todo: image]
Note: Have to have bootloader bit enable (link to cc2538 for more detail)
- Connect to other controller
- CC2538 [todo: Link to cc2538]
- Sensortag [todo: link to sensortag]
Note: SmartRF06 has a jumper that allow debugging and flashing on some microcontroller possible. (XDS100v3). [todo: add image , write more detail]
CC2538 EM
CC2538 Evaluation Module (EM) board is used to measure/evaluate RF performance. It operates on 2.4GHz frequency. In addition, CC2538 EM has pre-installed firmware that could be used to test send/receive packet. The hardware is not limited to the factory software, it's possible to flash other firmware to fit other purposes.
- SmartRF06 EB
- Connect to correct PIN on CC2538 [todo: image]
- Connect CC2538 EM to SmartRF06 [todo: image]
- Power the SmartRF06
- USB port 3.3v [not tested]
- Connect to correct PIN on CC2538 [todo: image]
- Connect to external source via usb
Compile Firmware
- First of all, Toolchain[dict] is required in order to compile firmware for specific platform. Instruction and the toolchain could be get from here.
- After Toolchain has been installed and properly configured, in source code folder, make sure there is
Makefile
that at least point toMakefile.include
resided in contiki root folder.
Example: source code reside in $CONTIKI_HOME/examples/hello-world/ , content of Makefile should look similar to this:
CONTIKI_PROJECT = hello-world all: $(CONTIKI_PROJECT) CONTIKI = ../.. include $(CONTIKI)/Makefile.include
Contiki is compiled with make
command and it usually follows this format:
make TARGET=platform File-to-compile
Platforms to which source code could be compiled to, are stored as folders in $CONTIKI_HOME/platforms
(Refer to contiki folder structure section for more detail)
File-to-compile could be omitted if Makefile is pointing to the file(s). Example: all: hello-world
- To compile firmware for CC2538, go to folder source code, type:
make TARGET=cc2538dk
Example: From $CONTIKI_HOME/examples/cc2538dk/
, type make TARGET=cc2538dk
Note: TARGET=cc2538dk could also be excluded if Makefile.target file is pointing to cc2538dk platform. The file could be generated using command make TARGET=cc2538dk savetarget
.
Flash Firmware
- Make sure the CC2538 is properly connected to SmartRF06. (Refer to power section for detail).
- Load CC2538 driver by following this link or run this script
By CCS Uniflash (Linux, Window)
- Download and install uniflash from TI Here
- Launch the app, select New Target Configuration, then select these configuration:
- Connection: Texas Instruments XD100v3 USB Debug Probe
- Board or Device: CM2538SF53
- Select Program, then choose one of these two options:
- Load Program -> Click Browse -> Choose .hex file -> OK
- Load Binary -> Click Browser -> Choose .bin file -> Start Address: 0x00200000 -> OK
Note: (Refer to compile firmware section to get .bin or .hex file)
By CC2538-bsl (Linux, Mac OS)
- Download cc2538-bsl:
- If contiki is cloned from github: In contiki folder, run
git submodule update --init
- Or download cc2538-bsl from github, then put it in
$CONTIKI_HOME/tools/
- If contiki is cloned from github: In contiki folder, run
- Make device to go to bootloader mode, by press and hold on select button while press on Reset button. [todo: might need more clarification]
- In contiki compile source code folder, type:
make TARGET=cc2538dk [compiled-file].upload
[compiled-file] is the file that will be flash to the device
By SmartRf Flash Programmer (Window)
[Pending....]
Restore Factory Firmware
- Download firmware from here
- Flash firmware using CCS uniflash or SmartRF Flash Programmer (Refer to above section for detail)
CC2650 Sensortag
CC2650 Sensortag is compact with dozen sensors (IR Temperature, Humidity, Movement,..). Moreover, it has pre-installed firmware in which it could pair with smartphone via Bluetooth to read sensor information. It's also possible to flash custom firmware to the sensortag to fit other requirement.
- Power Supply (Through Sensortag DevPack (note: some usb cable doesn't work), Battery, CC2538)
CC2650 sensortag could be powered by:
- Insert battery to Sensortag (Optional for REV.: 1.3.0) [more detail for sensortag version 1.2]
- Connect unpowered DevPack to Sensortag as per image (Note: There is only one way to connect it) [todo: image]
- Power DevPack by external source (usb 5v)
- Default function of buttons (Disconnect, Reset to factory)
Compile Firmware
- Make command (Could point to contiki project structure section)
ex: make TARGET=srf06-cc26xx BOARD=sensortag/cc2650 cc26xx-web-demo.bin
Flash Firmware
- Flash via OAD
- Flash Default Factory Firmware
- Uniflash (Linux)**
- SmartRF Flash Programmer**
//**Note: Could be moved to Tools sections
CC2531 Dongle
- What it can be used. (Sniffer, Mote, Slip-radio)
Compile Firmware
Flash Firmware
Software and Platform
Contiki OS
Features
Processes
File Structure and Compilation
Software (Tools)
Uniflash
- Note: install for all user vs for root only
cc2538-bsl
Sensniff
- cc2538 (project conf) : #define CC2538_RF_CONF_SNIFFER 1
#define CC2538_RF_CONF_CHANNEL 26
SmartRF Protocol Packet Sniffer
nvm tool
Components for Designed network
Motes
- What is motes
- What is it consist of and its functions
- What hardware can be used.
Network (WSN)
6lowpan
- Idea/why 6lowpan
- Basic function
Border Router
Function
Installation
Configurations
Security
- Protocol implementation
- Right/Trusted Motes?
- Probe message attack (make mote wake up all the time)
- Relay Message?
- Exchange data
- What use cases/scenario
Issues faced
Sometimes, when the output filetype is not specified (Ex: make TARGET=srf06-cc26xx BOARD=sensortag/cc2650
), the compilation returns error with:
- Solution:
The problem could be solved by specify the output file. For example
make TARGET=srf06-cc26xx BOARD=sensortag/cc2650 udp-client.bin
[make space]
Pending to be Documented
Glossary
- RDC:
- ContikiMac:
- NullRDC:
- slip-radio:
- PANID: