Z-Connector for Asus RT-N16 with Oleg's firmware compilation
Posted: 20 Sep 2011 23:08
The manual below is not complete and contains just preliminary steps.In order to execute commands listed below, you should connect to the router using Terminal or by SSH/Telnet (on Windows use PuTTY). You will also need to have /opt folder created and ipkg installed (last two links are in Russian!).Install packages required for Z-connector compilation:ipkg install libuclibc++
ipkg install buildroot
ipkg install coreutils
ipkg install makeInstall libraries needed for Z-Connector:ipkg install openssl-dev
ipkg install zlibWe also need to compile argtable library needed for Z-ConnectorInstall packages needed for argtable library compilation:ipkg install perl
ipkg install findutils
ipkg install grepdownload argtable sources (version 2.13 has been used in my case) and unpack thatgo to argtable directory (use your path) and configure it:cd /opt/argtable
GREP=/opt/bin/grep ./configure --target=mipsel-linux --build=mipsel-linux(GREP=/opt/bin/grep was used to define path to correct grep installed in /opt. May be you will not need this.)Make it and install:make
make installVerify that argtable libraries appeared at lib directory:ls -la /usr/local/lib/libargtable*(only libargtable2.so.0 is needed)In order to make these libraries visible to our Z-Connector program, run:export LD_LIBRARY_PATH=/usr/local/libAdd this folder to ld.so.conf file, so Z-Connector program will always know where to find them:echo /usr/local/lib >> /etc/ld.so.confZ-Connector compilationDownload Z-Connector archive and unpack in /opt/z-connectorGo to Z-Connector folder and delete Windows directory:rm -r WindowsModify Makefile by adding -L/usr/local/lib to EXTRA_LIBS line, so it will look like:EXTRA_LIBS = -L/usr/local/lib -lssl -largtable2 -lcryptoCompile:makeEnable automatic start (NOT COMPLETED SECTION!):echo /opt/z-connector/Run_Z-Agent.sh >> /usr/local/sbin/post-mountDrivers installation:Download modules package from ftp://core.dumped.ru/rt-n/ (choose the version in accordance with your firmware version). Note that driver name depends on the Z-Wave USB dongle hardware!Extract needed cp2101.ko fileInstall it:insmod /opt/kernel/drivers/usb/serial/cp2101.koenable automatic start (NOT COMPLETED SECTION!):echo "insmod /opt/kernel/drivers/usb/serial/cp2101.ko" >> /usr/local/sbin/post-mountVerify that everything works (run z-agent manually):CERT_DIR=/opt/z-connector/CertificatesDEVICE=/dev/ttyUSB0
./z-agent -d $DEVICE -s z-cloud.z-wave.me --cert=$CERT_DIR/cert.pem --key=$CERT_DIR/cert.key --cacert=$CERT_DIR/cacert.pemSave changes you've made (and files you've compiled) using:echo /etc/ld.so.conf >> /usr/local.filesflashfs save && flashfs commitReboot router :reboot
ipkg install buildroot
ipkg install coreutils
ipkg install makeInstall libraries needed for Z-Connector:ipkg install openssl-dev
ipkg install zlibWe also need to compile argtable library needed for Z-ConnectorInstall packages needed for argtable library compilation:ipkg install perl
ipkg install findutils
ipkg install grepdownload argtable sources (version 2.13 has been used in my case) and unpack thatgo to argtable directory (use your path) and configure it:cd /opt/argtable
GREP=/opt/bin/grep ./configure --target=mipsel-linux --build=mipsel-linux(GREP=/opt/bin/grep was used to define path to correct grep installed in /opt. May be you will not need this.)Make it and install:make
make installVerify that argtable libraries appeared at lib directory:ls -la /usr/local/lib/libargtable*(only libargtable2.so.0 is needed)In order to make these libraries visible to our Z-Connector program, run:export LD_LIBRARY_PATH=/usr/local/libAdd this folder to ld.so.conf file, so Z-Connector program will always know where to find them:echo /usr/local/lib >> /etc/ld.so.confZ-Connector compilationDownload Z-Connector archive and unpack in /opt/z-connectorGo to Z-Connector folder and delete Windows directory:rm -r WindowsModify Makefile by adding -L/usr/local/lib to EXTRA_LIBS line, so it will look like:EXTRA_LIBS = -L/usr/local/lib -lssl -largtable2 -lcryptoCompile:makeEnable automatic start (NOT COMPLETED SECTION!):echo /opt/z-connector/Run_Z-Agent.sh >> /usr/local/sbin/post-mountDrivers installation:Download modules package from ftp://core.dumped.ru/rt-n/ (choose the version in accordance with your firmware version). Note that driver name depends on the Z-Wave USB dongle hardware!Extract needed cp2101.ko fileInstall it:insmod /opt/kernel/drivers/usb/serial/cp2101.koenable automatic start (NOT COMPLETED SECTION!):echo "insmod /opt/kernel/drivers/usb/serial/cp2101.ko" >> /usr/local/sbin/post-mountVerify that everything works (run z-agent manually):CERT_DIR=/opt/z-connector/CertificatesDEVICE=/dev/ttyUSB0
./z-agent -d $DEVICE -s z-cloud.z-wave.me --cert=$CERT_DIR/cert.pem --key=$CERT_DIR/cert.key --cacert=$CERT_DIR/cacert.pemSave changes you've made (and files you've compiled) using:echo /etc/ld.so.conf >> /usr/local.filesflashfs save && flashfs commitReboot router :reboot