Temat: Wsparcia dla modemów GSM w OpenWrt
Witam,
Bardzo cieszę się, że projekt prężnie się rozwija i pojawia się wsparcie dla coraz większej liczby modemów.
Jako że miałem okazję używać kilku modeli opisywanych w projekcie chciałbym dodać kilka uwag.
1. Novatel MC990D może być przełączony w tryb modemu za pomocą usb_modeswitch. Wystarczy tylko zmodyfikować plik konfiguracyjny 1410_5020:
DefaultVendor= 0x1410
DefaultProduct=0x5020
MessageContent="5553424312345678000000000000061b000000020000000000000000000000"2. Porty modemów Option pracujących pod kontrolą HSO mogą być rozpoznane i automatycznie ustawione. Skrypt ze źródeł (ports.sh):
#!/bin/sh
#################################################################################################
# Script: Ports.sh
# Purpose: Shows application or all ports for the hso driver
# This script checks the sys folder (for newer driver versions) and the proc folder (for older driver versions)
# Parameter all Shows all ports
# Parameter app Shows application port
# Author: J. Bellavia, D. Barow
#################################################################################################
# checking for root
USERID=`id -u`
if [ "$USERID" != "0" ]
then
echo "Need root permissions to run this script"
exit
fi
#################################################################################################
# METHOD: application
# PURPOSE:shows application interface
#################################################################################################
application()
{
###########################################################
#searching for application port in the sys filesystem
###########################################################
echo searching the application port in sys filesystem
TTYS=`find /sys/class/tty -name "ttyHS*"`
APP_PORT=""
for i in $TTYS; do
if [ `grep Application $i/hsotype` ]
then
APP_PORT=$i
found=1
break
#else
# echo The application port is not $i.
fi
done
####################
#Found the app port?
####################
if [ -z "$APP_PORT" ]
then
echo Did not find the the app port in sys
else
DEVICE=/dev/`echo $APP_PORT | cut -d/ -f5`
echo The application port is $DEVICE.
fi
###########################################################
#searching for application port in the proc filesystem
###########################################################
if [ -z "$found" ]
then
echo searching in proc filesystem
TTYS=`find /proc/hso/devices -name "ttyHS*"`
APP_PORT=""
for i in $TTYS; do
if [ `grep Application $i/hsotype` ]
then
APP_PORT=$i
found=1
break
#else
# echo The application port is not $i.
fi
done
####################
#Found the app port?
####################
if [ -z "$APP_PORT" ]
then
echo Did not find the the app port in proc
else
DEVICE=/dev/`echo $APP_PORT | cut -d/ -f5`
echo The application port is $DEVICE.
fi
fi
###############################################################################
#it can be that hso driver is not installed or that the device is not inserted
###############################################################################
if [ -z "$found" ]
then
echo Please check whether your device is installed and connected to the PC
fi
}
#################################################################################################
# METHOD: all
# PURPOSE:Shows portname for all ports
#################################################################################################
all()
{
###########################################################
#searching for ports in the sys filesystem first
##########################################################
echo searching in sys filesystem
TTYS=`find /sys/class/tty -name "ttyHS*"`
PORT=""
for i in $TTYS; do
CatType=`cat $i/hsotype`
#echo Catype is $CatType
PORT=$i
DEVICE=/dev/`echo $PORT | cut -d/ -f5`
if [ -n "$CatType" ]
then
echo The Device $DEVICE is the $CatType port.
found=1
#else
fi
done
#####################################################################
#searching for ports in the proc filesystem when device is not found
#####################################################################
if [ -z "$found" ]
then
echo searching in proc filesystem
TTYS=`find /proc/hso/devices/ -name "ttyHS*"`
PORT=""
for i in $TTYS; do
CatType=`cat $i/hsotype`
#echo Catype is $CatType
PORT=$i
DEVICE=/dev/`echo $PORT | cut -d/ -f5`
if [ -n "$CatType" ]
then
echo The Device $DEVICE is the $CatType port.
found=1
#else
fi
done
fi
###############################################################################
#it can be that hso driver is not installed or that the device is not inserted
###############################################################################
if [ -z "$found" ]
then
echo Please check whether your device is installed and connected to the PC
fi
}
#################################################################################################
# METHOD: usage
# PURPOSE:
#################################################################################################
usage()
{
echo Usage: $0 \(app\|all\)
}
#################################################################################################
# Choose your action
#################################################################################################
case "$1" in
app)
application
;;
all)
all
;;
*)
usage
;;
esac3. Podłączając modemy Sierry poprzez moduł DirectIP żaden z interfejsów nie jest zajęty i może być wykorzystany do odczytywania informacji o modemie/połączeniu.
4. Problem z pojawieniem się modemu Vodafone K3760 można rozwiązać dodając sleep'a do skryptu /etc/hotplug.d/usb/20-modeswitch:
...
# If a candidate is remaining, start usb-modeswitch
[ -n "$configs" ] && {
sleep 1
log "$DEVICENAME: Selecting ${configs%% *} for mode switching"
$modeswitch -c "${configs%% *}"
}
}
fi5. Moduły usb-storage oraz usb-serial mają ten sam "priorytet" podczas ładowania (60) i jeśli ładujemy moduł usb-serial z parametrami vendor, product to interfejs storage jest niepoprawnie załadowany poprzez moduł usb-serial. W takim przypadku moduł usb-storage powinien być załadowany wcześniej niż usb-serial (lub usb-serial załadowany później niż usb-storage).
6. Nie wiem czy to kogoś zainteresuje ale istnieje możliwość wgrania dowolnej zawartości na wirtualny napęd modemu (nie dla wszystkich modemów: http://www.bez-kabli.pl/viewtopic.php?t=25692). Można by to wykorzystać w przypadku routerów z małą pamięcią jeśli bazowy obraz miałby wsparcie dla usb oraz systemu plików na wirtualnym napędzie.
frutis