Link to home
Start Free TrialLog in
Avatar of Arman Khodabande
Arman KhodabandeFlag for Iran, Islamic Republic of

asked on

Embeded Linux on Router

I have a Router which I can communicate with it's OS through telnet.
This Router is able to connect to internet through both ADSL and 3G Card.
The web interface doesn't have any feature to send AT commands (USSD) to inquire my balance or other USSD commands.
There are some binaries with source codes out there for i386 platforms but not for MIPS platform.
I want to compile the code for my MIPS platform but the OS on the router doesn't have "make" binary/command.
I know that to compile for these platforms I have to use toolchains but I don't know how to use one or where to start. (I downloaded one toolchain for MIPS but I wasn't able to run any of them on that OS)

Please advice
Thanks
Avatar of noci
noci

Have you looked at the  OpenWRT / DDWRT projects? (and there are some spinoffs as well).
those have releases & install procedures for many ARM/MIPS and some others as well routers.
meant to replace the original firmware.

On the websites of those projects there also is a selector tool which shows if a particular routers is known and possibly supported.
Avatar of Arman Khodabande

ASKER

Yes, I know. But I wanna use the original firmware, because those projects don't have any firmware for my device. OpenWRT has a partial firmware which is unstable and lacks a lot of features.
My Router is Vodafone EchoLife  (Huawei HG556a).

Rather than that it has become a challenge for me to compile MIPS code for vendor firmware. Want to learn...

Thanks
Then it really depends on how the original firmware is capable of being modified.
The gnu tools are capable if being used for cross compilation.
qemu may be used to test (depends on exact CPU type, but it has MIPS emulators)

Here is more info on toolchains: http://elinux.org/Toolchains
I don't necessarily want to modify the firmware. I can easily side-load the binaries on a USB disk.
For example the router's version of Busybox is 1.00 but I downloaded and side-loaded the busybox for MIPS version 1.19 on the device successfully. On the other hand I'm able to customize the firmware myself. I already done many customizations to this vendor firmware, including Web interface changes.

And I I need detailed , step by step instructions. I've seen that page, no use.
I have Kali and Ubuntu installed on my laptop. Can I use either of them to cross-compile for MIPS?
How can I do that?
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you, I look at the stuff and report back.
Hey noci
I gave up building a separate app for AT command and came to think that it must be already implemented in the modem.
Do you have any idea where the scripts could be located on the router to connect to 3G modem?
The router seems to be loading the following driver in the init process :
USB Driver for GSM modems: v0.7.1
test -e /lib/modules/2.6.8.1/kernel/drivers/usb/serial/option.ko && insmod /lib/modules/2.6.8.1/kernel/drivers/usb/serial/option.ko

Open in new window

It also loads a driver (I don't know what it could be!) that usually is used for webcam!
test -e /lib/modules/kernel/drivers/usb/media/gspca.ko && insmod /lib/modules/kernel/drivers/usb/media/gspca.ko

Open in new window

Why webcam driver on the router?!

Anyway the question is how the modem connects to the internet through the 3G modem. It sure has something to communicate with the modem! because in the web interface I can see the signal strength and other 3G info. For this modem has to send AT commands to 3g modem (somehow!).

But I can't find anything on the file system for this! darn!
Searched for *99# in the whole file system and found it in 2 places (because it's the number that should be dialed for gsm connection):
1. Router Configuration file (which all modem/routers have and can be downloaded via web interface)
2. A file called pppd  in the /bin directory. Strange! It contains some AT commands inside! It's a n ELF file which is compiled with infamous UClib! (/lib/ld-uClibc.so.0)
When I open the file in notepad I can see this for example:

   main             -check_vendor    at_init     pppd_thread_at_dail pppd_thread_initialize     *99#    ATD%s

Open in new window


Any idea how I can use this executable to connect/disconnect the 3G modem manually?
Web interface also has 2 buttons to connect and disconnect the 3G modem but they use "Post" commands and something called CGI. Any ideas how to connect this two?

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the info.

I found out the way to communicate with the 3G modem and collect the responses on the embeded linux. There's no need for any application. It's done through echo command. However the sending process and how to collect the response from the modem is a little tricky!
I will write an article about it here as I didn't find anything directly about it on the net!