Skip to content

linux802154 serialdev

Mariano Alvira edited this page Jan 29, 2013 · 3 revisions

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)

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.

This page is maintained by Mariano Alvira. Please email me at mar@devl.org with patches, suggestions and comments.