Giter VIP home page Giter VIP logo

wpanusb's Introduction

WPANUSB

Overview

wpanusb is a Linux kernel driver for 802.15.4 USB dongle. The big picture is shown below:

graph TB
    subgraph Linux
        direction TB
        Applications-->IPv6
        IPv6-->6LoWPAN
        6LoWPAN-->lmac[802.15.4 MAC]
        lmac-->driver[wpanusb driver]
    end

    subgraph Zephyr
        direction TB
        app[Zephyr wpanusb]-->zmac[802.15.4 driver]
        zmac-->radio[802.15.4 radio]

    end

    Linux-->|USB| Zephyr
Loading

Please note that there are 2 wpanusbs in the picture:

  • Linux kernel driver (driver) which is described here
  • Zephyr application (firmware) which is described in Zephyr samples/net/wpanusb

For more information please see my presentation at Embedded Linux Conference Europe, 2019. Writing Your Own Gadget.

Prerequisites

  • a hardware board with 802.15.4 radio and USB controller supported by Zephyr.
  • Zephyr wpanusb application (firmware) is flashed to the board
  • the board is connected to Linux via USB cable

Building Linux kernel wpanusb driver

  1. Make sure you have Linux kernel headers installed
$ ls /lib/modules/`uname -r`/build
  1. Type make, below is output for the latest Ubuntu
$ make
make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-38-generic'
  CC [M]  /usr/local/src/ieee802154/wpanusb/wpanusb.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /usr/local/src/ieee802154/wpanusb/wpanusb.mod.o
  LD [M]  /usr/local/src/ieee802154/wpanusb/wpanusb.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-38-generic'

Loading wpanusb

You can load driver with insmod given that all dependency are loaded, otherwise use provided modprobe.sh script

$ sudo scripts/modprobe.sh

wpan0 device should appear in the network devices list

Configuring 6lowpan address

There is a script helping to configure 6lowpan address

$ sudo scripts/lowpan.sh

lowpan0 network device should appear and IPv6 address can be checked with

$ ip addr show dev lowpan0
59: lowpan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1
    link/[825] 92:05:91:9b:5a:2c:34:41 brd ff:ff:ff:ff:ff:ff:ff:ff
    inet6 fe80::9005:919b:5a2c:3441/64 scope link
       valid_lft forever preferred_lft forever

There is link local IPv6 address which can be used for ping6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.