From today I would like to start a new series (挖坑) called “Dissecting OpenWRT” (深入浅出 OpenWRT). Unlike other tutorials about OpenWRT, this new series will try to dissect OpenWRT from a developer’s point of view. It will focus on the implementation of OpenWRT core components, such as ubus, procd, netifd and luci. I hope that with the help of this new series, people will not only understand the insider but also know how to extend OpenWRT.
netifd is an RPC-capable daemon written in C for better access to kernel APIs with the ability to listen on netlink events. Netifd has replaced the old OpenWrt-network configuration scripts, the actual scripts that configured the network e.g.,
The WPAN support is now a simple clone of 802.11 support which include C code for netifd and Ash scripts to handle wpan interface.
The hardware platform I use is ci40 from Imagination, which has ca2810 802.15.4 radio chip. For most router without 802.15.4 hardware chips, fakelb is a good choice for testing. here is a simple tutorial how to setup a 6lowpan test network.
The OpenWRT source code is here
This article will briefly introduse the WiFi startup process of OpenWRT/LEDE system.
The analysis will start from boot script which is located in /etc/initi.d/
During last few days I have worked on a new project called iwpaninfo. It is a “clone” project from iwinfo and designed for 802.15.4 protocol. It is a wrap program like wpan-tools but it only read 802.15.4 device information via nl802154 interface. It also provides Lua bindings.
WIth the help of this project the intergration of 802.15.4 into OpenWRT/LEDE project will become easier.
This post will briefly introduces how to add support of BEE click board for IMG ci40 board.
BEE Click is an accessory board in mikroBUS form factor. It features 2.4 GHz IEEE 802.15.4 radio transceiver module MRF24J40MA. This module includes an integrated PCB antenna and matching circuitry and is connected to the microcontroller via a SPI interface. As such, this module is an ideal solution for wireless networks, smart home automation, building automation and other electronic applications that need wireless communication. Board is designed to use 3.3V power supply only.
ci40 Linux kernel (4.4.14) has already driver support for MRF24J40. What we should do is adding device tree config for it, like
compatible = "microchip,mrf24j40ma", "microchip,mrf24j40";
spi-max-frequency = <4000000>;
reg = <2>;
interrupt-parent = <&gpio1>;
interrupts = <5 GPIO_ACTIVE_HIGH>;
Or you can find the patch here.
It is noted that current driver has no support for reset and wake pin. And a pending patch is not merged. Since ci40 board has already 802.15.4 support via ca8210. mrf24j40 driver will be not automatically activated but explicitly loaded mrf24j40 driver via modprobe or insmod.
The MCR20A expands the NXP® portfolio of wireless connectivity products by delivering a new generation of 2.4 GHz transceiver for the IEEE® 802.15.4 standard. The MCR20A provides a world-class link budget of 110 dB that ensures the longest range of communication. At the same time, the MCR20A is able to receive and transmit at significantly lower peak currents than other competitive devices. This enables mesh networks to run on the same battery for a much longer period. The Dual PAN support allows the system to concurrently participate in two 802.15.4 networks, eliminating the need for multiple radios.
- High-performance 2.4 GHz IEEE 802.15.4 RF transceiver
- 802.15.4 PHY/MAC support
- -102 dBm sensitivity +8 dBm maximum output power reducing the need for external power amplifiers
- Low-power receive mode (LPPS)
- TX 17 mA @ 0 dBm and RX 19 mA typical
- TX 18 mA @ 0 dBm and RX 19.5 mA max
- Dual PAN support
- Supports single-ended and fast diversity antenna options: single 50 ohm antenna uses single balun to reduce component count and cost
- Packet processor for hardware acceleration
- 128-bit random number generator
- 1.8-3.6 V operating range
- Small footprint: 5×5 LGA 32 pin
- –40 ˚C to +105 ˚C operational temperature range
- Supports SMAC, Thread Networking Protocol and ZigBee stacks
The MCR20A Linux driver is coming
* Support only one PAN network
This is a deprecated cc2420 driver for Linux 802.15.4 and it is developed based on Imote2 platform.
Because I do not have any Imote2 or cc2420 boards. I can not continue maintain this driver.
Any Donation of cc2420 or Imote2 boards are welcome, thus I could try to push this driver to mainline.