1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Handling of USB tethering (Android phone) improved

This commit is contained in:
Christian Zeitnitz 2021-03-18 18:20:52 +01:00
parent 159e3674e5
commit ac16d67609
3 changed files with 16 additions and 5 deletions

View File

@ -11,10 +11,18 @@
"name_prefix": "eth",
"udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", ATTR{address}==\"$MAC$\", NAME=\"$DEVNAME$\" "
},
{
"type": "usb",
"type_info": "usb network interface",
"clientid": 1,
"comment": "network interface - e.g. USB tethering of an Android phone ",
"name_prefix": "usb",
"udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"$IDVENDOR$\", ATTRS{idProduct}==\"$IDPRODUCT$\", NAME=\"$DEVNAME$\" "
},
{
"type": "wlan",
"type_info": "wireless adapter",
"clientid": 1,
"clientid": 2,
"comment": "standard wireless interface",
"name_prefix": "wlan",
"udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", ATTR{address}==\"$MAC$\", NAME=\"$DEVNAME$\" "
@ -22,7 +30,7 @@
{
"type": "ppp",
"type_info": "mobile data modem",
"clientid": 2,
"clientid": 3,
"name_prefix": "ppp",
"comment": "recognized mobile data modems are automatically named as ppp0-9. Renaming is not possible. Dialin service relies on the name",
"udev_rule": "SUBSYSTEM==\"tty\", KERNEL==\"ttyUSB0\", TAG+=\"systemd\", ENV{SYSTEMD_WANTS}=\"start start_ppp0_device.service\" "
@ -30,7 +38,7 @@
{
"type": "hilink",
"type_info": "Huawei Hilink",
"clientid": 3,
"clientid": 4,
"comment": "Huawei mobile data device in router mode. Control via HTTP",
"name_prefix": "hilink",
"default_ip": "192.168.8.1",
@ -39,10 +47,10 @@
{
"type": "phone",
"type_info": "USB tethered phone",
"clientid": 4,
"clientid": 5,
"comment": "ethernet access provided by tethering from phone via USB",
"name_prefix": "phone",
"udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", ATTR{address}==\"$MAC$\", NAME=\"$DEVNAME$\" "
"udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"$IDVENDOR$\", ATTRS{idProduct}==\"$IDPRODUCT$\", NAME=\"$DEVNAME$\" "
}
]
}

View File

@ -154,6 +154,7 @@ function DisplayDashboard(&$extraFooterScripts)
$ifaceStatus = $clientinfo["connected"]=="y" ? "up" : "down";
switch($clientinfo["type"]) {
case "eth":
case "usb":
$client_title = "Client: Ethernet cable";
$type_name = "Ethernet";
break;

View File

@ -137,6 +137,8 @@ function getClients($simple=true) {
$cl["device"][$i]["operator"] = $res[0];
break;
case "phone":
case "usb":
$cl["device"][$i]["connected"] = "y";
break;
default:
}