jorge_costa_cv
(usa Outra)
Enviado em 27/01/2012 - 12:07h
Boa tarde pessoal gostaria de pedir ajuda no pessoal que entende mais de linux a fazer a configuracao do dreambox 800 hd que posui o lunix a funcionar com uma pen 3g wireless. ele devera reconhecer a pen usb 3g e ter um menu para fazer o dial up ou fazer esss automaticamento .
tenho um uns dados que tirei de um site onsd epoderiam ter uma ideia como funciona
**********************************
Well, it’s a bit late, but hey, late better than never…
As soon as I moved from Duabi-UAE to Cairo-Egypt, I had absolotly no internet access except via a 3G USB stick that I borrowed from my friend, that 3G USB Stick model was Huawei E1550…
So i had that wacky idea, why not stick this stick to the back of my DM7025 and make it share the internet access, I’ve always used that set top box as a NAS server (via Samba), torrent download station (using Transmission), and it did pretty well, so let’s add “Internet router” to the pile, this shouldn’t be hard right??
Well, think again…
We need to
Build kernel modules for PPP, IPTables, usb-serial dongles
Flip the USB stick to the serial interface mode (Huh!!!!!!)
Load the proper modules and create needed /dev files
Get a tool to run pppd, to dial, and connect
Enable IPTables and IP-Forwarding
The E1550 is one of those "dual mode" devices which upon insertion are identified as a CD-ROM drive, and switch to a serial device (modem) when prodded with a particular control sequence. The CD-ROM includes some software by the operator and a driver. I didn’t even try to install this stuff, believing that it would be much better to rely only on standard Linux components.
To start with, I already have Debian 4.0 MIPS installed on that compact flash, and I can easily chroot to it and do all the cool linux stuff I like, I got gcc installed in no time using apt-get install gcc, see, easy!
So, here’s what needed to be done
1.Compile kernel modules for kernel 2.6.12.6 (which seems to be only version released by Dream Multimedia)
•That seemed a bit challenging, I have GCC installed, but the CPU power in that box is just to compile the entire kernel tree, I estimated this to take around 4 hours just to finish “make modules”, and guess what, it just did
•I also choose to build it on my Ubuntu VBOX VM using a tool chain and compare the time/size/compatibility of the generated code
•The tool chain configuration itself was a bit challenging, however crosstools-NG really helped alot; however building the entire tool chain took over 2 hours, I had to build a few tool chains to test with which one will generate kernel modules that will be loadable by the DM
•I could have used the tool chains provided by DM development guys everywhere on the planet, but I just wanted to get my hand dirty
•Eventually I got all kernel modules for 2.6.12.6 compiled and can load properly
2.Get the USB stick to expose it’s 3G serial ports VID/PID
•That was done with the tool called usb_modeswitch that tool needed a few dependencies
•libusb1.0, I grabbed 1.06 from here
•libusb-compat-0.1.2 from here
•There has been a slight catch here, the usb_modeswitch needed usb.h, i thought it needed that from the kernel tree, but I was wrong, it needed the usb.h you can find in libusb-compat-0.1.2/libusb/usb.h
3.Get kernel modules to load and recognize the VID/PID
•After running mod_switch, the USB stick shows VID/PID : 0x12d1/0×1001
•On my ubuntu, it’s being handled by the option.ko module (kernel 2.6.23), but that wasn’t yet supported when 2.6.12.6 was release, so now I need to make some effort to back-port option.c
•Luckily I tried something really really stupid but it totally worked fine, I just added the VID/PID into the kernel module like this:
/* Vendor and product IDs */
#define HUAWEI_VENDOR_ID 0x12D1
#define HUAWEI_PRODUCT_E1550 0×1001
..
..
static struct usb_device_id option_ids[] = {
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },
{ USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1550) },
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_WLAN) },
{ } /* Terminating entry */
•Now the kernel can recognize the new serial device
4.Create new /dev files
•The following few commands got that, that was the easiest part so far
mknod /dev/ttyUSB0 c 188 0
mknod /dev/ttyUSB1 c 188 1
mknod /dev/ttyUSB2 c 188 2
mknod /dev/ttyUSB3 c 188 3
•Now I can cat from those device files, which means they’re properly attached to the actual device, and minicom worked just as fine, and now I can write AT commands and talk to the device, YAAAAAY!!!!!
5.Use those new /dev files to connect to the serial port and initiate PPPd
•apt-get install wvdial did all the job, yet we still need to enable the ppp module, “modprobe ppp_async” would do the job
•Thanks to a few posts (i’ll put the links below) I knew what needed to sent to the device to get to connect, here’s my /etc/wvdial.conf
[Dialer Defaults]
Dial Command = ATD
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","etisalat"
Init4 = AT+CGATT=1
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
Phone = *99#
Password = internet
Username = internet
6.Enable forwarding and NAT
•On normal linux that would be a snap, but here we still need to enable IPTABLES nat module as well MASQUERADE modules to get iptables to work, and enable kernel forwarding
modprobe iptable_nat
modprobe ipt_MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A POSTROUTING -t nat -s 192.168.180.0/24 -j MASQUERADE
See, easy, right??? hell yeah
Of course these has been several bumps along the road, for example when I messed up with the QOS of the 3G stick using AT+CGQREQ and AT+CGQMIN, that technically rendered the USB stick unable to connect at all, even when I tried to re-plug it, and even tried it on my windows machine, the SIM working just fine though as I tested it with my laptop’s internal 3G module, got it only fixed by the following, that type of setting is stored somewhere within either the SIM or the 3G stick itself…
ATCGEQMIN=1,0,0,0,0,0
ATCGEQREQ=1,0,0,0,0,0
Should anybody need assistance or would like to have a copy of the files esp. the kernel modules, please let me know…
Thanks to all who made the real effort of coding, discovering, who eventually all helped the entire community and me to realize and actually do this…
http://www.woggledog.com/index.asp?subject=GPRS
http://www.santinoli.com/open/e1692-howto.html
http://cc.jlab.org/docs/services/linux/linux-ppp.html
Thanks you all guys…
Now I can close all those tabs in FireFox that I kept open for over 2 months just to make sure I don’t lose those references
**********************************
Obrigado de ja isso seria de otima ajuda a toda as pessoa que usam o dm800 e que possuem uma conexecao usb 3g wirelesss
Jorge costa