x200t - 3g + gps
Grande nouvelle (dont tout le monde se fout en fait) : j'ai réussi à faire marcher le modem 3G et la puce GPS de mon x200t !
Après m'être battu quelques temps avec, j'ai fini par me rappeler l'existance de http://www.thinkwiki.org. Après une rapide recherche et deux clics sur des liens, je suis tombé ici.
Autant dire que c'est exactement ce dont j'avais besoin.
Après 2-3 lectures rapides, un peu de réflexion (sisi), et pas mal de tests, voici ce que j'ai fini par faire :
Certes, c'est long. Certes, c'est du bash. Mais devoir faire un simple "sudo wwan start-wwan" pour se retrouver connecter, c'est juste le pied, non? ;)
Bref. Là, ça marche. Et bien.
J'en connais en tous cas un qui sera heureux de l'apprendre :)
A+
Tengu
Après m'être battu quelques temps avec, j'ai fini par me rappeler l'existance de http://www.thinkwiki.org. Après une rapide recherche et deux clics sur des liens, je suis tombé ici.
Autant dire que c'est exactement ce dont j'avais besoin.
Après 2-3 lectures rapides, un peu de réflexion (sisi), et pas mal de tests, voici ce que j'ai fini par faire :
GPSDPID="/var/run/gpsd.pid" CONTROL_DEVICE="/dev/ttyACM1" GPS_DEVICE="/dev/ttyACM2" PIN="" APN="gprs.swisscom.ch" powerup_F3507g () { echo -n "Powering up F3507g card.." echo 1 > /sys/devices/platform/thinkpad_acpi/wwan_enable while [ ! -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done echo "done" echo -n "Turning on F3507g card..." sleep 3 if [ -n "$PIN" ]; then /usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE fi /usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP0" "AT" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE echo "done" } powerdown_F3507g () { echo -n "Turning off F3507g card..." /usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE echo "done" echo -n "Powering down F3507g card.." echo 0 > /sys/devices/platform/thinkpad_acpi/wwan_enable while [ -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done echo "done" } configure_GPS () { /usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE } turnon_GPS () { echo -n "Starting NMEA stream on $GPS_DEVICE..." configure_GPS 1 1 1 sleep 1 /usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $GPS_DEVICE < $GPS_DEVICE start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $GPS_DEVICE echo "done" } turnoff_GPS () { echo -n "Stopping NMEA stream on $GPS_DEVICE..." start-stop-daemon --stop --pidfile $GPSDPID configure_GPS 0 1 0 echo "done" turnoff_F3507g } turnon_usbnet () { echo -n "Starting usbnet connection..." /usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE echo "done" } turnoff_usbnet () { echo -n "Stopping usbnet connection..." /usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE echo "done" turnoff_F3507g } turnoff_F3507g () { ifdown_F3507g } ifdown_F3507g () { powerdown_F3507g } usage () { echo "$0 <action>" echo " start-wwan: start your modem" echo " stop-wwan: stop your modem" echo " start-gps: start your GPS and gpsd" echo " stop-gps: stop xour GPS and gpsd" } if [ $# -eq 1 ]; then case $1 in 'start-wwan') powerup_F3507g turnon_usbnet dhclient usb0 &>/dev/null ;; 'start-gps') powerup_F3507g turnon_GPS ;; 'stop-wwan') turnoff_usbnet ;; 'stop-gps') turnoff_GPS ;; *) usage ;; esac else usage fi exit 0
Certes, c'est long. Certes, c'est du bash. Mais devoir faire un simple "sudo wwan start-wwan" pour se retrouver connecter, c'est juste le pied, non? ;)
Bref. Là, ça marche. Et bien.
J'en connais en tous cas un qui sera heureux de l'apprendre :)
A+
Tengu