: Home | MC1322x-OE's Gitweb | libmc1322x's Gitweb | Contiki-MC1322x's Gitweb| Linux Serial Gitweb

Getting and Building the MC13224 Linux 802.15.4 Serial Driver Firmware

Getting Started

Clone linux802154-serialdev.git:

$ git clone git://git.devl.org/git/malvira/linux802154-serialdev.git

cd into the clone and run make

$ cd linux802154-serialdev
$ make

The Makefile will initialize the libmc1322x submodule.

Now connect some Redbees (or other mc13224 hardware) and program them.

Linux

Then go through the Linux 802.15.4 Getting Started page.

You need a new kernel and a set of userspace utils. Then you'll be able to make 802.15.4 network devices:

$  iz list
wpan0
    link: IEEE 802.15.4 MAC interface
    phy wpan-phy2
    hw de:ad:be:af:ca:fe:ba:be pan 0xffff short 0xffff
wpan1
    link: IEEE 802.15.4 MAC interface
    phy wpan-phy4
    hw ca:fe:ca:fe:ca:fe:ca:fe pan 0xffff short 0xffff
wpan2
    link: IEEE 802.15.4 MAC interface
    phy wpan-phy6
    hw be:be:be:be:be:be:be:be pan 0x0777 short 0x8002

$ ifconfig
wpan0     Link encap:UNSPEC  HWaddr DE-AD-BE-AF-CA-FE-BA-BE-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING NOARP  MTU:127  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:389 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:0 (0.0 B)  TX bytes:6713 (6.5 KiB)

wpan1     Link encap:UNSPEC  HWaddr CA-FE-CA-FE-CA-FE-CA-FE-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING NOARP  MTU:127  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2027 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:0 (0.0 B)  TX bytes:36826 (35.9 KiB)

wpan2     Link encap:UNSPEC  HWaddr BE-BE-BE-BE-BE-BE-BE-BE-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING NOARP  MTU:127  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10 
          RX bytes:0 (0.0 B)  TX bytes:682 (682.0 B)

Wireshark

You need to apply some patches to get wireshark dissecting correctly.

The first patch (libpcap-1.0.0-ieee80215-arphrd.patch) is to libpcap and it applies cleanly to the source in debian:

$ apt-get source libpcap0.8
$ cd libpcap0.8
$ wget http://mc1322x.devl.org/files/libpcap-1.0.0-ieee80215-arphrd.patch
$ patch -p1 < libpcap-1.0.0-ieee80215-arphrd.patch
$ sudo apt-get build-dep libpcap0.8
$ dpkg-buildpackage 
$ cd ..
$ dpkg -i libpcap0.8_1.0.0-6_i386.deb

with only the pcap patch you'll be able to decode 802.15.4 correctly, but the checksums will be incorrect. To fix those you need to apply a patch (wireshark-1.0.5-ieee80215.4.patch) to wireshark. This patch did not apply cleanly for me, but it's simple enough that you can do it by hand. I haven't tested yet myself though because my system is hopelessly out of date and I can't install the builddeps without wrecking the place.

--- wireshark-1.0.5.orig/epan/dissectors/packet-ieee802154.c
+++ wireshark-1.0.5/epan/dissectors/packet-ieee802154.c
@@ -1696,7 +1696,7 @@
     dissector_handle_t  ieee802154_handle;
 
     /* Get the dissector handles. */
-    ieee802154_handle   = find_dissector("wpan");
+    ieee802154_handle   = find_dissector("wpan_nofcs");
     data_handle         = find_dissector("data");

For more details see the following discussion: http://article.gmane.org/gmane.linux.network.zigbee.devel/229

See the Wireshare Wiki page for IEEE 802.15.4 for more information and a pretty screenshot.

6LowPAN

6LowPAN support is new to wireshark 1.3.1 --- this is pretty fresh; you'll probably have to build it yourself.

http://www.wireshark.org/lists/wireshark-dev/200912/msg00050.html

Receiving EVERYTHING

If you want to use the linux 802.15.4 stack as a sniffer then you just need to add the wpan-phy device as a monitor:


# iz listphy
wpan-phy0  IEEE 802.15.4 PHY object
    page: 0  channel: n/a
    channels on page 0: 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
# iz monitor wpan-phy0
Registered new monitor ('wpanmon0') on phy wpan-phy0
# ifconfig wpanmon0 up

Then you can use wireshark on wpanmon0 to see all all of the 802.15.4 data.