Sunday, January 19, 2014

ZTE H108NS & telnet

Some issues you may encounter when trying to telnet ZTE H108NS modem:

1. You cannot connect at all

In that case from the Web UI go to Access Management -> ACL and edit or create a rule for the LAN interface which allows telnet connections from your subnet.

2. Password is not accepted

The web ui password may differ from the console password but there is a way... Go to Maintainance -> Firmware and press the ROMFILE BACKUP button to download a copy of the configuration parameters. View the (xml) file with any text editor and locate the admin user entry under Account:

<entry0 br="" username="admin" web_passwd="yourwebuipasswd">console_passwd="telnetpasswdhere" display_mask="FF FF FF FF FF FF FF FF FF" />
  ....... more entries which hopefully are not the same in all modems but I doubt it ....... </entry0> </account>

The telnet password is stored in the console_passwd attribute.

Thursday, January 16, 2014

Compiling Grive on Centos with unsupported Boost/CMake version.

In the absence of a Google Drive client version for linux, I tried to compile grive (0.3.0-pre) which is an open source client using the Google APIs:

Install all dependencies first, try yum install gcc-c++ expat-devel json-c-devel libgcrypt-devel curl-devel

If the CMake version is old, get the appropriate version of CMake and do not install it:

#cd /usr/local/src
#./ .
That's for i386, it seems for x64 you need to compile it from source. 

If the Boost version is older and cmake complains about it:

1. Download the appropriate version of boost (most current right now is 1.55) and extract it to /usr/local/src:

#tar -xvf boost_1_55_0.tar.bz2
#cd boost_1_55_0
#./ --prefix=/usr/local/src/boost_1_55_0/lib/
#./b2  --build-dir=/usr/local/src/boost_1_55_0/lib/ --with-system --with-filesystem --with-program_options --with-test

2. Download and compile yajl. (./configure && make). Assuming that it's located at /usr/local/src/yajl

3. Back to the Grive directory. I should mention that I removed bgrive from CMakeLists.txt because I did not need it. You must add the following commands in CMakeLists.txt
Then run:
#../cmake- -D BOOST_ROOT:FILEPATH="/usr/local/src/boost_1_55_0"  -D Boost_LIBRARY_DIRS:FILEPATH="/usr/local/src/boost_1_55_0/stage/lib" .
 (There is a dot as the very last argument).

Try to run make.

If you get any errors about ambiguous log entries, do the following:

Assuming you have vim, edit grive/src/ and type as an editor command: %s/log::/gr::log::/

If you don't have vim what you need to do is to change all instances of log:: to gr::log::

Finally if you still get errors like "undefined reference to `gr::Json::Json(long const&)" make the trivial edits to libgrive/src/drive/ as described here.

After thoughts:

To install to another binary compatible machine without rebuilding, you need to copy the compiled libraries and install the dependencies as well:  

Install depedencies: #yum install expat json-c libgcrypt curl

Copy all compiled libraries to /usr/local/lib[64]:

  1.  From /usr/local/src/boost_1_55_0/stage/lib/
    • All *.so.1.55.0
  2.  From /usr/local/src/yajl/build/yajl-2.0.5/lib/

Create symbolic links for all the libraries you've copies and use the library name without the appended version as the link name, eg:

#ln -s

Copy the grive binary to /usr/local/bin or any convenient location

Finally run ldconfig /usr/local/lib[64]