zephyr/samples/net/wpan_serial
Robert Lubos 1fb418df4c net: ieee802154_radio: Allow to specify TX mode
Even though radio driver can report in its capabilities that it does
support CSMA CA, there's no way in the driver to select how the frame
should be transmitted (with CSMA or without). As layers above radio
driver (Thread, Zigbee) can expect that both TX modes are available, we
need to extend the API to allow either of these modes.

This commits extends the API `tx` function with an extra parameter,
`ieee802154_tx_mode`, which informs the driver how the packet should be
transmitted. Currently, the following modes are specified:
* direct (regular tx, no cca, just how it worked so far),
* CCA before transmission,
* CSMA CA before transmission,
* delayed TX,
* delayed TX with CCA

Assume that radios that reported CSMA CA capability transmit in CSMA CA
mode by default, all others will support direct mode.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-03 14:07:41 +03:00
..
src net: ieee802154_radio: Allow to specify TX mode 2020-04-03 14:07:41 +03:00
CMakeLists.txt cmake: use find_package to locate Zephyr 2020-03-27 16:23:46 +01:00
README.rst samples: wpan_serial: Update doc with build instructions 2020-01-18 12:28:24 +02:00
overlay-cc2520.conf samples: wpan_serial: Create cc2520 overlay 2019-12-20 23:02:42 -05:00
overlay-rf2xx.conf samples: wpan_serial: Add rf2xx transceiver overlay 2020-01-18 12:28:24 +02:00
prj.conf samples: wpan_serial: Refactor wpan_serial 2019-12-20 23:02:42 -05:00
sample.yaml samples: wpan_serial: Allow to build for more boards 2019-12-20 23:02:42 -05:00

README.rst

.. _wpan_serial-sample:

802.15.4 "serial-radio" sample
##############################

Overview
********

The wpan_serial sample shows how to use hardware with 802.15.4 radio and USB
controller as a "serial-radio" device for Contiki-based border routers.

Requirements
************

The sample assumes that 802.15.4 radio and USB controller are supported on
a board. You can pick, for example, a transceiver such as a CC2520 or RF2xx
using overlays, or by using an SoC with a built-in radio, such as a kw41z,
nrf5, or samr21.

Building and Running
********************

#. Before building and running this sample, be sure your Linux system's
   ModemManager is disabled, otherwise, it can interfere with serial
   port communication:

   .. code-block:: console

     $ sudo systemctl disable ModemManager.service

#. Build the sample Zephyr application to a board with a 802.15.4 radio
   and USB controller. There are configuration files for various setups
   in the ``samples/net/wpan_serial`` directory:

   - :file:`prj.conf`
     This is the standard default config. This can be used by itself for
     hardware which has native 802.15.4 support.

   - :file:`overlay-cc2520.conf`
     This overlay enables support for CC2520 transceiver

   - :file:`overlay-rf2xx.conf`
     This overlay enables support for RF2XX transceiver

   To build the wpan_serial sample:

   .. zephyr-app-commands::
     :zephyr-app: samples/net/wpan_serial
     :board: <board name>
     :conf: "prj.conf [overlay-<RADIO>.conf]"
     :goals: build
     :compact:

   Here's how to build and flash the sample for the Atmel SAM R21
   Xplained Pro Development Kit. Note that for this SoC, you don't
   need to include ``overlay-rf2xx.conf``.

   .. zephyr-app-commands::
     :zephyr-app: samples/net/wpan_serial
     :board: atsamr21_xpro
     :goals: build flash
     :compact:

#. Connect board to Linux PC, /dev/ttyACM[number] should appear.
#. Run Contiki-based native border router (6lbr, native-router, etc)
   Example for Contiki:

   .. code-block:: console

     $ cd examples/ipv6/native-border-router
     $ make
     $ sudo ./border-router.native -v5 -s ttyACM0 fd01::1/64

Now you have a Contiki native board router.  You can access its web-based
interface with your browser using the server address printed in the
border-router output.

.. code-block:: console

  ...
  Server IPv6 addresses:
   0x62c5c0: =>fd01::212:4b00:531f:113a
  ...

Use your browser to access ``http://[fd01::212:4b00:531f:113a]/`` and you'll
see available neighbors and routes.