Skip to content

Firefly as a Sniffer

Javier Sanchez edited this page Feb 27, 2017 · 1 revision

What do I get with this?

This application is used to have a look of all the information about packets sent between devices.

In this case is used for IEEE 802.15.4 2.4GHz band

What do I need?

To build the application you will need:

Install Wireshark.

Install the Zolertia toolchains and tools if you don't have it.

Create a folders for contiki e.g. on Desktop/Desktop$ mkdir contikiOS

Now clone the contikiOS repository, update using/contikiOS$ git submodule update --init

Once downloaded, go to the directory: /contiki/examples/sensniff$

Edit the project-conf.h, adding this lines. Remember to change the PANID and the channel to the ones you have configured previously.

#undef IEEE802154_CONF_PANID
#define IEEE802154_CONF_PANID      0xABCD

/* The following are Zoul (RE-Mote, etc) specific */
#undef CC2538_RF_CONF_CHANNEL
#define CC2538_RF_CONF_CHANNEL     26

Now we burn the program on Firefly /contiki/examples/sensniff$ make TARGET=zoul BOARD=firefly sensniff.upload

After this, we need to open the Python script that convert the Firefly serial to a wireshark format: /contiki/tools/sensniff$

We execute the python and the terminal will be similar to:

/contiki/tools/sensniff$ python sensniff.py -d /dev/ttyUSB0
Commands:
c: Print current RF Channel
m: Print Min RF Channel
M: Print Max RF Channel
n: Trigger new pcap header before the next frame
h,?: Print this message
<number>: Change RF channel.
q: Quit
Sniffing in channel: 26

Execute Wireshark: sudo wireshark -i /tmp/sensniff and inicialialice /tmp/sensniff

Configure the protocol IEEE 802.15.4

If any device transmit over radio with parameter configured previously Firefly will captured it and transferred to Wireshark like this.

Clone this wiki locally