Kernel module to create a fake 6LoWPAN interface that connects to a character device for sending a receiving frames.
Tested with 4.x.y Linux Kernel releases.
Even though 6LoWPAN is mostly used for IEEE 802.15.4 devices, other devices/radios can also benefit from the defined compression mechanisms.
The goal of this project was to demonstrate 6LoWPAN over a resource-constrained VHF link under the scope of the H2020 MSCA IF SINet project
This kernel module registers a character device that can be read or written into, which in turn reads and writes 802.15.4 frames from and to the created wpan interface.
More details on why and how available on https://sinet.item.ntnu.no
Simply compile the kernel module with make
and run ./load_module
.
This should create a new lowpan interface with a random short address in the pan_id 0xbeef.
The load_module script loads the compiled kernel module and searches the last 5 lines for the path of the registered character device that will used for communication with the 802.15.4 stack. After creating the character device a new lowpan interface is added to wpan0.
-
The script "assumes" that no other wpan0 device already exists and should be adapted otherwise.
-
Sometimes the Kernel never creates an initial address to the lowpan interface and the cause is unknown. In this event an error will be returned by iproute when running
./load_module
. In this case, the only solution is to unload and load the module again. -
Caveat number 2 is only relevant when full IPHC is desired, otherwise it works fine despite the error.
To connect the newly created interface to a radio or even an application reading and writing IEEE 802.15.4 frames, in the folder utils a connector example can be found and used as inspiration.
Specifically, this example provides the option to connect to the OWL radio, using the NGHAM-SPP protocol in the serial port /dev/ttyUSB0, if completed with a parser for NGHAM-SPP frames.
Apart from a better organisation of some structures, the character device creation follows an outdated method, and should be changed.