Pages

Thursday, August 16, 2018

D-Link DIR-505 with OpenWRT, Huawei 8221 & Huawei e3276

I have been fascinated with OpenWRT and have been using it since 15.05. Have never tried building my owner firmware and wanted to get my hands dirty on this. Recently I attempted to build a firmware for D-Link DIR-505 router which have been taking rest for past 2 years. I love this cute little box as it has all it needs to be a full fledged Router, NAS device, Hotspot and much more..
D-Link DIR-505

Have made significant progress on this project now. Below write up is result of hours spent on reading the instruction about configuring 3G/4G dongles with OpenWRT from the web and result of trial and error process as well. Thanks to all the original authors of these instructions posted on the web.

Had a spare Hawaii 8221 lying around. This is more than a dongle and they call it a Wiggle. It has Wi-Fi integrated as well and all you need to make it work is just a USB power port.

Making it work with a Router as a WAN interface is a different story all together. Through the course I learnt that 3G and 4G dongles emulate LAN interfaces on USB for higher through puts. PPP has its own limitation on max bandwidth it can support. Huawei 8221 implements RNDIS protocol for this purpose. This is supported in OpenWRT through "kmod-usb-net-cdc-ether" driver.

Below are the steps to get this Wiggle working with OpenWRT 17.01-SNAPSHOT. 


  1. Connect the Wiggle to a PC and configure the APN using the HiLink interface. This is a WebUI and will open automatically once the device is detected on windows. Test if you are able to successfully connect to the internet. 
  2. Install below modules using opkg command in case you are using release version from OpenWRT portal. You can download these modules individually from OpenWRT portal in case you can't get your router connected to internet. 
    1. kmod-usb-core
    2. kmod-usb2
    3. kmod-mii
    4. kmod-nls-base
    5. kmod-usb-net
    6. kmod-usb-net-cdc-ether
    7. libblobmsg-json
    8. librt
    9. libubox
    10. libusb-1.0
    11. libc
    12. wwan
  3. Connect the Wiggle to the usb port of the router. 
  4. Now the Wiggle should be detected as a cdc_ether device and LAN interface will be assigned. In my setup it was eth2.
  5. Through LuCI configure this interface as WAN interface and use dhcp as protocol. 
  6. Add the newly created interface into WAN firewall group. 
  7. You have successfully configured Huawei 8221 as the WAN link for the router. 

Huawei 8221 is a 3G Wiggle and I wanted to upgrade it to 4G to better utilize the bandwidth provided by the operator. My search for a 4G dongle ended with Huawei e3276-920 .. 


Huawei 8221


Ordered and received Huawei e3276-920 dongle. This device has specifications which suit providers in India. After receipt of the dongle realized that e3276-601 supports LTE Band 3 & 40 while e3276-920 only supports LTE Band 40. But this won't be a show stopper at this point though. 


Huawei e3276-920

source:
 4G Band 38/40 (TDD 2300/2600MHz)
* 3G DC-HSPA+ 900/2100MHz
* GSM 850/900/1800/1900MHz

Have also verified the same in the device through AT commands. 

AT^SYSCFGEX?

^SYSCFGEX: ("00","01","02","03"),((2000000400380,"GSM900/GSM1800/WCDMA900/WCDMA2100"),(280000,"GSM850/GSM1900"),(3fffffff,"All bands")),(0-2),(0-4),((a000000000,"LTE_B38/LTE_B40"),(7fffffffffffffff,"All bands"))

Will discuss more about the options a bit later.

This device works on NCM protocol and requires below modules in addition to above. 

  • kmod-usb-net-cdc-ncm
  • kmod-usb-net-huawei-cdc-ncm
  • usb-modeswitch 
Have also installed kmod-usb-serial-options module to have access to the Modem and PCUI ports of the dongle.

After installing the modules the device will get detected and below messages can be found in dmesg.

[   13.890047] usbcore: registered new interface driver cdc_ncm
[   13.946463] huawei_cdc_ncm 1-1:1.2: MAC-Address: 0c:5b:8f:27:9a:64
[   13.951207] huawei_cdc_ncm 1-1:1.2: setting rx_max = 16384
[   13.957079] huawei_cdc_ncm 1-1:1.2: setting tx_max = 16384
[   13.962448] huawei_cdc_ncm 1-1:1.2: NDP will be placed at end of frame for this device.
[   13.970508] huawei_cdc_ncm 1-1:1.2: cdc-wdm0: USB WDM device
[   13.977421] huawei_cdc_ncm 1-1:1.2 wwan0: register 'huawei_cdc_ncm' at usb-ehci-platform-1, Huawei CDC NCM device, 0c:5b:8f:27:9a:64
.
.
.
[   14.272584] usbcore: registered new interface driver option
[   14.276946] usbserial: USB Serial support registered for GSM modem (1-port)
[   14.284122] option 1-1:1.0: GSM modem (1-port) converter detected
[   14.290134] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   14.296735] option 1-1:1.1: GSM modem (1-port) converter detected
[   14.303071] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1


Below is the content from /sys/kernel/debug/usb/devices file of OpenWRT post installing all the necessary drivers.

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=1506 Rev= 1.02
S:  Manufacturer=HUAWEI Technology
S:  Product=HUAWEI Mobile
C:* #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=10 Driver=option
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=02 Prot=12 Driver=option
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:  If#= 2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=02 Prot=16 Driver=huawei_cdc_ncm
E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
I:* If#= 2 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=16 Driver=huawei_cdc_ncm
E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

LuCI on 17.01.5 doesn't support NCM protocol, interestingly its supported on 17.01 Master branch and also on 18.06. Tried compiling it from 17.01 Master source but wasn't successful and felt that's not a requirement as of now. Manual configuration is always handy here. 

Below is the configuration entries made in /etc/config/network file to get this module working. 

config interface 'wan_e3276'
        option ifname 'wwan0'
        option proto 'ncm'
        option device '/dev/cdc-wdm0'
        option apn 'airtelgprs.com'
        option delay '10'
        option auto '0'

Have set the auto option as '0', I am currently controlling the dongle connect and disconnect to internet through a shell script. 

Trouble-shooting: Speedtest upload failed with error - A socket error occurred during the Upload test.

Narrowed down the problem to the interference on the WiFi network. Moved the router and laptop to the same room and the issue got resolved.  Configured the dongle with LTE preferred mode as below. 


AT^SYSCFGEX?

^SYSCFGEX:"0302",2000000400380,1,2,A000000000

Just wanted to clean all the changes and hence opted for a fresh installation from release version of OpenWRT. This way I can download the ipk files from openwrt site directly rather than me compiling them each time.  Interestingly there was 17.01.6 release and went ahead in installing the same. By error I found that comgt & comgt-ncm are not actually required to have a ncm based dongle to work with OpenWRT as mentioned in may howto documentation on the web. Without these packages the only thing I missed was the AT commands logged into the logger. 

Will discuss about the scripts which I wrote for controlling the Internet connection and useful AT command set for Huawei e3276-920 in upcoming blogs. 

Thursday, December 11, 2014

Honda Gold Wing now in India

Ever since I have heard about this Bike ( Machine or Monstor ) in 2003, I have fallen in love with it. Let it be the Technology, Comfort, Looks and Innovation by Honda on this product line. Now happy to hear that its available in India. May be its beyond my reach but still feeling excited about the launch. To more details visit the page from NDTV.


Honda Gold Wing GL1800 Launched in India

Tuesday, September 24, 2013

Annamalai University Distance Education (DDE) Resutlts May 2013

Annamalai University have published results DDE for May 2013 exams. Currently the results have been published for below subjects

  • 019 M.SC. PHYSICS
  • 021 M.SC. ZOOLOGY
  • 022 M.SC. BOTANY
  • 055 BACHELOR OF LIBRARY AND INFORMATION SCIENCE
  • 056 MASTER OF LIBRARY AND INFORMATION SCIENCE
  • 070 M.A. POPULATION STUDIES
  • 118 M.A. PUBLIC ADMINISTRATION
  • 119 M.COM. CO-OPERATIVE MANAGEMENT
  • 126 M.COM. BANKING & INSURANCE MANAGEMENT
  • 020 M.SC. CHEMISTRY
  • 139 M.SC. INFORMATION TECHNOLOGY
  • 152 M.COM. COMPUTER APPLICATIONS
  • 158 M.SC. ELECTRONIC SCIENCE
  • 192 M.A. TRANSLATION STUDIES
  • 471 M.A. HUMAN RIGHTS
  • 176 M.SC. INFORMATION TECHNOLOGY (LATERAL-II)
  • 186 M.A. HISTORY AND HERITAGE MANAGEMENT
  • 187 M.A. HISTORY AND TOURISM MANAGEMENT
  • 189 M.A. POLICE ADMINISTRATION
  • 195 M.SC. GEO-INFORMATICS
  • 620 M.SC. CHEMISTRY (LATERAL-II)
  • 621 M.SC. ZOOLOGY (LATERAL-II)
  • 619 M.SC. PHYSICS (LATERAL-II)
  • 822 MASTER OF DANCE
  • 469 M.A. SOCIAL WELFARE ADMINISTRATION
  • 259 M.A. RURAL MANAGEMENT
  • 263 M.A. PHILOSOPHY, RELIGION & CULTURE
  • 831 MASTER IN BHARATHANATTIYAM
  • 947 M.SC. GRAPHICS & ANIMATION
  • 749 M.A. EXTENSION MANAGEMENT
  • 750 M.A. N.G.O. MANAGEMENT

  • To know your results please visit this site with your enrollment/Registeration Number

    Friday, September 20, 2013

    Motorola Defy has GPU clock control now

    Motorola has rightly names this Phone as "Defy", the phone was launched with Eclair (Android 2.1) by Motorola and later upgraded to Froyo (Android 2.2) officially. Since then xda community has been keeping this phone alive with all updates from GingerBread (Android 2.3 ) to JellyBean+ (Android 4.3). Hate's off to the XDA team specifically Quarx. The latest addition to these updates is Clock Control of the GPU. 



    What does this mean?

    Similar to CPUs GPU ( Graphics Processing Unit ) is another processor which is responsible for driving display related stuff. It runs on a predefined clock speed. If you can control the clock you can directly control the performance and power consumption of the chip. In real world scenario it means increase/decreased refresh rates of the screen and increase/decrease in the battery consumption of the device. 

    Currently its still in Beta stage. If you want to have a try check out the builds on or after 17-Sep-2013 here.

    Wednesday, September 18, 2013

    TVS Jupiter could be a threat to Honda Activa

    TVS Jupiter which was launched earlier this week is a male oriented scooter. With smashing features it could be a real thread to Honda Activa, who leads the Scooter market today. 



    Continue reading more about the comparision at motorbeam here.

    Tuesday, September 17, 2013

    TVS Motors unveils new Scooter Jupiter

    TVS Motors have unveiled their new scooter Jupiter yesterday.



    Jupiter is a 110cc scooter priced at Rs, 44,200 /- ex-showroom Delphi. Jupiter adds to their product line of Scooty Pep and Wego targetting male buyers. Its fuel efficiency is expected to be at 62kmpl. 

    Explore the official site for more details...

    Friday, September 13, 2013

    Ambassador Encore Launched...

    The oldest production vehicle of India gets a new heart. Hindustan Motors Ambassador have been upgraded to BSIV standards and have been launched as Ambassador Encore at a shocking price of 4.97Lakhs (Ex Showroom).