miércoles, 4 de junio de 2008

EVDO CDU-680 MOVILNET

Guia de instalación de modem EVDO CDU-680 en Debian ETCH.

1. Instalar los paquetes pppconfig y wvdial
aptitude install pppconfig wvdial

2. Cargar los módulos sg y usbserial
modprobe usbserial
modprobe sg

Para que los módulos se carguen en el inicio del sistema se deben introducir en el archivo /etc/modules

3। Compilar el siguiente código con gcc.
#include

#include

#include

#include

#include


/* Returns the line number and the line itself for the line in inputfile that begins with inputstring
Returns 0 if there is no such line
Returns -1 and prints an error message if the inputfile can't be opened*/

int find_line(char *inputfile, char *outputline, char *inputstring, int inputlength){
FILE *fp;
int linenumber = 0;

if((fp = fopen(inputfile,"r"))==NULL){
printf("Unable to open %s.\n", inputfile);
return -1;
}
do{
if(fgets(outputline, 128, fp)==NULL) return 0;
linenumber++;
} while(strncmp(outputline,inputstring,inputlength));
fclose(fp);

return linenumber;
}

int main(int argc) {
char file[26];
char string[20];
char devicename[9];
char line[128];
int fd;
struct {
unsigned int inputlength;
unsigned int outputlength;
char data[10];
} ifchg;

sprintf(devicename,"/dev/sda");
sprintf(string,"RDEVCHG1");
ifchg.inputlength = 9;
ifchg.outputlength = 0;
ifchg.data[0] = 0xff;
memcpy(ifchg.data + 1,string,strlen(string));

//Check if the device is plugged in and recognized, if so, get the /dev/sd? value.
sprintf(file,"/proc/scsi/sg/device_strs");
sprintf(string,"CMOTECH");
devicename[7] += find_line(file,line,string,strlen(string)) - 1;
if(devicename[7] < 'a'){ printf("Modem not found.\n"); return 1; } else printf("Modem found at %s\n", devicename); //Check if the device is mounted, if so, unmount it. sprintf(file,"/etc/mtab"); sprintf(string,"/media/CDU680_UMSD"); if(find_line(file,line,devicename,strlen(devicename)) > 0) umount2(string ,1);
//Change the mode.
if((fd = open(devicename,O_RDWR)) <= 0) {
printf("Unable to open %s , fd = %d.\n", devicename, fd);
return 2;
}
usleep(800);
ioctl(fd,FIBMAP,&ifchg);
close(fd);
return 0;
}

4. Despues de obtener el binario se debe ejecutar
./nombre_binario
el dira donde lo esta el moden y lo volvera

5.configuramos pppconfig
dns dinamico
6.conectamos con :

pon evdo

desconectar poff evdo

6 comentarios:

Anónimo dijo...

Creo que es más sencillo aplicar etos pasos:

1. Al montarse como memoria USB copiar el directorio llamado Linux/ al Escritorio.

2. Luego ejecutar desde una consola el comando itfchg (Que está en /home/NOMBRE_DEL_USUARIO/Desktop/Linux/itfchg) pasandole como parametro el nombre dem dispositivo (/dev/sda).

3. Luego con pppconfig crear la conexión (y anexando el parametro nodeflate la configuración).

ALGOLIUS dijo...

eso es para debian lenny amigo apostols en etch entra en conflicto con glibc

nagui dijo...

Ja, que bueno, ya pille tu blog.

Besitos!.

EAMS dijo...

Buenas, amigo he segido los pasos pero al momento de ejecutar el ./changemode y hacer un tail -f /var/log/messages deberia ver una liea + o - así /dev/ttyACM pero nada de nada, que crees que estara pasando

ALGOLIUS dijo...

eams que distro usas??? si quieres dame tu correo para ayudarte

EAMS dijo...

ALGOLIUS dijo...

eams que distro usas??? si quieres dame tu correo para ayudarte

SALUDOS ALGOLIUS uso debian Lenny mi correo es leon_oscuro@yahoo.es como te comento no he podido hasta la fecha configurar el bendito modem en Gnu/Linux ya quiero salir de windows