IzoT U60 DIN Network Interface User’s Guide
18
Porting the Linux U60 Driver
The Linux U60 driver creates a Linux network device that applications can use to
send and receive classic LON and LonTalk/IP packets using a U60 network interface.
The driver provides an open, close, read, write interface and can be used as either a
network device or a character device. The Linux U60 driver is included with the IzoT
SDK images for the Raspberry Pi and BeagleBone Black and is also included in the
IzoT Router. Source code for a Linux driver for the U60 is included with the IzoT
SDK Premium Edition and is also available for free download from the
Resources
www.echelon.com/products/izot-u60-ft-din-network-interface
. You can port
the driver source to other platforms, other versions of Linux, and other operating
systems.
The U60 driver requires a unique and valid network device line discipline number.
By default, the U60 driver uses line discipline number 28 since 28 is a valid but
unassigned line discipline number for Linux kernel 3.8 as used in the IzoT Router.
You can use a different line discipline number if 28 is not available or valid for your
version of the Linux kernel. The maximum line discipline number is typically
defined by the
NR_LDISCS
constant. For Linux kernel 3.8,
NR_LDISCS
is defined
as 30.
To compile the U60 driver, you first need a compiled kernel source tree, including
standard Linux support for a USB CDC/ACM class interface. The IzoT Router uses
the BeagleBone kernel source tree available at
https://github.com/RobertCNelson/linux-dev/releases
.
Once you have compiled a kernel tree, run the
make modules
command in the
kernel source tree and pass in the directory containing the U50Module source in the
SUBDIRS
environment variable and the directory of the kernel source in the
KDIR
environment variable. Following are example Linux commands to build the driver:
KERN=/src/3.8.13-bone47/linux-dev-3.8.13-bone47/KERNEL
U50_DIR=/src/U50Module/
make -C $KERN KDIR=$KERN SUBDIRS=$U50_DIR ARCH=arm CROSS_COMPILE=arm-
linux-gnueabihf- modules
The example builds the module as
u50.ko
to your driver directory. For the IzoT
Device Stack EX running on a BeagleBone Black, the driver directory is the
following:
/lib/modules/3.8.13-bone47/kernel/drivers/lon/
A udev rule file is required to install the driver. For example, you can create a udev
rule file named
90-liftd.rules
in the
/etc/udev/rules.d
directory. Following is an
example rule for the U60 (concatenate the two lines):
SUBSYSTEM=="tty", ATTRS{idVendor}=="0920", ATTRS{idProduct}=="5550",
RUN+="/usr/bin/lonifd -d /dev/%k"
If you modified the line discipline number, you must specify the non-default line
discipline number in the rule using the
-l
parameter.
Summary of Contents for IzoT U60 DIN
Page 5: ......
Page 18: ...IzoT U60 DIN Network Interface User s Guide 16...
Page 30: ...IzoT U60 DIN Network Interface User s Guide 28...
Page 34: ......