jueves, 23 de abril de 2009

Sony Ericsson MD300 Andando en el NetworkManager

Sinceramente, lo encontre por ahi, no puedo tomar credito. Hay que bajar el paquete pyserial y crear dos archivos con los siguientes contenidos:

[ncorrare@corrare ~]$ cat /etc/udev/rules.d/50-md300.rules
ACTION!="add", GOTO="3G_End"
BUS=="usb", SYSFS{idProduct}=="d0cf", SYSFS{idVendor}=="0fce", NAME="modem", PROGRAM="/bin/sh -c 'echo 3 > /sys/%p/device/bConfigurationValue'", RUN+="/usr/local/bin/md300-ethernet"
LABEL="3G_End"

[ncorrare@corrare ~]$ cat /usr/local/bin/md300-ethernet
#! /usr/bin/python
import time;
time.sleep(5);
import serial;
s=serial.Serial("/dev/ttyACM0");
s.write("AT+CFUN=6\r");
time.sleep(10);
s.write("AT*ENAP=1,1\r")

(A este ultimo permisos de ejecucion por favor!!)
Nota:
s.write("AT+CFUN=6\r"); ES PARA SOLO 3G
s.write("AT+CFUN=5\r"); ES PARA SOLO GPRS
s.write("AT+CFUN=1\r"); AUTOMATICO