USB-Support

Aus Freifunk-Rheinbach Wiki
Zur Navigation springen Zur Suche springen

In den Gluon Images wird in der Regel kein USB-Support für die Freifunk-Router mit USB-Port mitgeliefert.

Der USB-Support für Router kann allerdings nachträglich installiert werden. Nicht alle Router mit USB-Port haben ausreichend Speicher, um einen vollständigen USB-Support zu bieten; mein TP-Link TL-MR3020 gehört leider zu dieser Sorte.

Voraussetzungen

Für die Installation des USB-Support sind folgende Voraussetzungen zu erfüllen:

  • Der Router benötigt einen USB-Port.
  • Während der Softwareinstallation muss der Router über den WAN-Port aus Internet angeschlossen sein.
  • In /etc/resolv.conf muss ein erreichbarer Nameserver (z.B. 8.8.8.8) eingetragen werden, damit die OpenWrt Pakete gefunden werden.

Als Nameserver nutze ich meinen lokalen Router. Beispile: /etc/resolv,conf

search lan
nameserver 192.168.20.1
nameserver 127.0.0.1

Nachträgliche Installation

Gluon verwendet einen eigenen, modifizierten Kernel. Daher müssen Kernel-Module für diesen Kernel kompiliert werden. Dies geschieht bei der Generierung der Firmware. Die Module befinden sich im Ordner /output/modules. Für die Installation der richtigen Module sollte in der Datei /etc/opkg/customfeed.conf der Pfad zu den Modulen eingetragen werden, die mit der Firmware generiert wurden.

Für meine Zwecke habe ich die Pakete auf einem Router mit USB-Stick geladen und den Ordner unter der Statusseite als /download abgelegt. Hier das Beispiel für mein Image vom 05.10.2016:

# add your custom package feeds here
#
# src/gz example_feed_name http://www.example.com/path/to/files
src/gz gluon http://[fda0:747e:ab29:2241:16cc:20ff:fecd:15bc]/download/modules/gluon-su-rhb-s2016.2-usb-20161005/ar71xx/generic 

In Images ab dem 10.10.2016 ist der korrekte Pfad in der Datei site.conf unter "opkg extra" angegeben.

Als erstes müssen die Paketlisten aktualisiert (opkg update) und dann die Pakete installiert (opkg install) werden. Mit den folgenden Befehlen wird eine minimale USB-Unterstützung installiert.

opkg update
opkg install \
 kmod-usb-core \
 kmod-usb2 \
 libusb-1.0 \
 usb-modeswitch \
 usbreset

Anschließend sollte der Router neu gestartet werden.

reboot ; exit

Nach einem Reboot muss natürlich die /etc/resolv.conf wieder angepasst werden, wenn weitere Software installiert werden soll.


Damit kann man im Grunde nicht viel anfangen. Wie einzeln Geräte genutzt und installiert werden ist jeweils getrennt für USB-Speicherstick oder USB-3G-Dongle für Mobilfunk beschrieben.

USB-Support im Image

Die notwendigen Module für einen USB-Support lassen sich auch im Image beim Build einbinden. Dazu müssen die notwendigen Packages in der site.mk angegeben werden. Dies ist etwas umfangreicher, da - wie oben erwähnt - nicht alle Router über ausreichend Speicher verfügen.

Hier eine passende site.mk für Freifunk Rheinbach mit möglichst umfassenden USB-Support:

Bis Gluon v2016.x

# FF-Rheinbach

GLUON_SITE_PACKAGES := \
gluon-mesh-batman-adv-15 \
gluon-alfred \
gluon-autoupdater \
gluon-authorized-keys \
gluon-config-mode-autoupdater \
gluon-config-mode-contact-info \
gluon-config-mode-core \
gluon-config-mode-geo-location \
gluon-config-mode-hostname \
gluon-config-mode-mesh-vpn \
gluon-ebtables-filter-multicast \
gluon-ebtables-filter-ra-dhcp \
gluon-luci-admin \
gluon-luci-autoupdater \
gluon-luci-mesh-vpn-fastd \
gluon-luci-node-role \
gluon-luci-portconfig \
gluon-luci-private-wifi \
gluon-luci-wifi-config \
gluon-mesh-vpn-fastd \
gluon-neighbour-info \
gluon-next-node \
gluon-radvd \
gluon-setup-mode \
gluon-status-page \
gluon-wan-dnsmasq \
haveged \
iptables \
iwinfo \


# basic support for USB stack
USB_PACKAGES_BASIC := \
	kmod-usb-core \
	kmod-usb2

# UMTS support for USB devices
USB_PACKAGES_UMTS := \
	libusb-1.0 \
	usb-modeswitch \
	usbreset \
	chat \
	comgt \
	kmod-ppp \
	kmod-pppoe \
	kmod-usb-serial \
	kmod-usb-serial-option \
	kmod-usb-serial-wwan \
	ppp \
	ppp-mod-pppoe
	
# storage support for USB devices
USB_PACKAGES_STORAGE := \
	block-mount \
	blkid \
	kmod-fs-ext4 \
	kmod-fs-vfat \
	kmod-usb-storage \
	kmod-usb-storage-extras \
	kmod-nls-cp1250 \
	kmod-nls-cp1251 \
	kmod-nls-cp437 \
	kmod-nls-cp775 \
	kmod-nls-cp850 \
	kmod-nls-cp852 \
	kmod-nls-cp866 \
	kmod-nls-iso8859-1 \
	kmod-nls-iso8859-13 \
	kmod-nls-iso8859-15 \
	kmod-nls-iso8859-2 \
	kmod-nls-koi8r \
	kmod-nls-utf8 \
	swap-utils

# network support for USB devices
USB_PACKAGES_NET := \
	kmod-ath9k-htc  \
	kmod-ath9k-common \
	kmod-ath \
	kmod-brcmfmac \
	kmod-carl9170 \
	kmod-mii \
	kmod-nls-base \
	kmod-rt73-usb \
	kmod-rtl8192cu \
	kmod-rtl8187 \
	kmod-usb-net \
	kmod-usb-net-asix \
	kmod-usb-net-asix-ax88179 \
	kmod-usb-net-cdc-eem \
	kmod-usb-net-cdc-ether \
	kmod-usb-net-cdc-mbim \
	kmod-usb-net-cdc-ncm \
	kmod-usb-net-cdc-subset \
	kmod-usb-net-dm9601-ether \
	kmod-usb-net-hso \
	kmod-usb-net-huawei-cdc-ncm \
	kmod-usb-net-ipheth \
	kmod-usb-net-kalmia \
	kmod-usb-net-kaweth \
	kmod-usb-net-mcs7830 \
	kmod-usb-net-pegasus \
	kmod-usb-net-qmi-wwan \
	kmod-usb-net-rndis \
	kmod-usb-net-rtl8152 \
	kmod-usb-net-sierrawireless \
	kmod-usb-net-smsc95xx

# network support for PCI devices
PCI_PACKAGES_NET := \
	kmod-3c59x \
	kmod-e100 \
	kmod-e1000 \
	kmod-e1000e \
	kmod-forcedeth \
	kmod-igb \
	kmod-natsemi \
	kmod-ne2k-pci \
	kmod-pcnet32 \
	kmod-r8169 \
	kmod-sis900 \
	kmod-sky2 \
	kmod-tg3 \
	kmod-tulip \
	kmod-via-rhine

# misc packages
MISC_PACKAGES := \
	kmod-usb-acm \
	kmod-usb-serial-simple

USB_PACKAGES_MR3020 := \
	kmod-nls-base \
	kmod-usb-core \
	kmod-mii \
	kmod-usb-net \
	kmod-usb-net-cdc-ether \
	kmod-usb-net-rndis \
	kmod-usb-uhci

#
# $(GLUON_TARGET) specific settings:
#

# x86-generic
ifeq ($(GLUON_TARGET),x86-generic)
# support the usb stack on x86 devices
# and add a few common USB and PCI NICs
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	$(PCI_PACKAGES_NET) \
	$(MISC_PACKAGES)
endif

# x86-64
ifeq ($(GLUON_TARGET),x86-64)
# support the usb stack on x86-64 devices
# and add a few common USB and PCI NICs
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	$(PCI_PACKAGES_NET) \
	$(MISC_PACKAGES)
endif

# Raspberry Pi A/B/B+
ifeq ($(GLUON_TARGET),brcm2708-bcm2708)
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	$(MISC_PACKAGES)
endif

# Raspberry Pi 2
ifeq ($(GLUON_TARGET),brcm2708-bcm2709)
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	$(MISC_PACKAGES)
endif

# ar71xx-generic
GLUON_ARCHERC7_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_DIR505A1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_GLINET_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_TLWR842_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_TLWR1043_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_TLWR2543_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_TLWDR4300_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_WNDR3700_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_WRT160NL_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_WZRHPAG300H_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_WZRHPG450H_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_TLMR3020_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_MR3020) -gluon-status-page

# mpc85xx-generic
GLUON_TLWDR4900_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)

DEFAULT_GLUON_RELEASE := s2016.2-usb-$(shell date '+%Y%m%d')

# Allow overriding the release number from the command line
GLUON_RELEASE ?= $(DEFAULT_GLUON_RELEASE)
GLUON_PRIORITY ?= 0
GLUON_LANGS ?= en de
GLUON_ATH10K_MESH ?= 11s

Ab gluon v2017.x

# FF-Rheinbach

GLUON_SITE_PACKAGES := \
gluon-mesh-batman-adv-15 \
gluon-alfred \
gluon-authorized-keys \
gluon-autoupdater \
gluon-client-bridge \
gluon-config-mode-autoupdater \
gluon-config-mode-contact-info \
gluon-config-mode-core \
gluon-config-mode-geo-location \
gluon-config-mode-hostname \
gluon-config-mode-mesh-vpn \
gluon-core \
gluon-ebtables \
gluon-ebtables-filter-multicast \
gluon-ebtables-filter-ra-dhcp \
gluon-ebtables-segment-mld \
gluon-ebtables-source-filter \
gluon-mesh-vpn-core \
gluon-mesh-vpn-fastd \
gluon-neighbour-info \
gluon-radvd \
gluon-respondd \
gluon-setup-mode \
gluon-site \
gluon-status-page \
gluon-status-page-api \
gluon-wan-dnsmasq \
gluon-web \
gluon-web-admin \
gluon-web-autoupdater \
gluon-web-mesh-vpn-fastd \
gluon-web-network \
gluon-web-node-role \
gluon-web-private-wifi \
gluon-web-theme \
gluon-web-wifi-config \
haveged \
iptables \
iwinfo \

## Für Tunneldigger vpn
## gluon-mesh-vpn-tunneldigger \

# basic support for USB stack
USB_PACKAGES_BASIC := \
	kmod-usb-core \
	kmod-usb2

# UMTS support for USB devices
USB_PACKAGES_UMTS := \
	libusb-1.0 \
	usb-modeswitch \
	usbreset \
	chat \
	comgt \
	kmod-ppp \
	kmod-pppoe \
	kmod-usb-serial \
	kmod-usb-serial-option \
	kmod-usb-serial-wwan \
	ppp \
	ppp-mod-pppoe
	
# storage support for USB devices
USB_PACKAGES_STORAGE := \
	block-mount \
	blkid \
	kmod-fs-ext4 \
	kmod-fs-vfat \
	kmod-usb-storage \
	kmod-usb-storage-extras \
	kmod-nls-cp1250 \
	kmod-nls-cp1251 \
	kmod-nls-cp437 \
	kmod-nls-cp775 \
	kmod-nls-cp850 \
	kmod-nls-cp852 \
	kmod-nls-cp866 \
	kmod-nls-iso8859-1 \
	kmod-nls-iso8859-13 \
	kmod-nls-iso8859-15 \
	kmod-nls-iso8859-2 \
	kmod-nls-koi8r \
	kmod-nls-utf8 \
	swap-utils

# network support for USB devices
USB_PACKAGES_NET := \
	kmod-ath9k-htc  \
	kmod-ath9k-common \
	kmod-ath \
	kmod-brcmfmac \
	kmod-carl9170 \
	kmod-mii \
	kmod-nls-base \
	kmod-rt73-usb \
	kmod-rtl8192cu \
	kmod-rtl8187 \
	kmod-usb-net \
	kmod-usb-net-asix \
	kmod-usb-net-asix-ax88179 \
	kmod-usb-net-cdc-eem \
	kmod-usb-net-cdc-ether \
	kmod-usb-net-cdc-mbim \
	kmod-usb-net-cdc-ncm \
	kmod-usb-net-cdc-subset \
	kmod-usb-net-dm9601-ether \
	kmod-usb-net-hso \
	kmod-usb-net-huawei-cdc-ncm \
	kmod-usb-net-ipheth \
	kmod-usb-net-kalmia \
	kmod-usb-net-kaweth \
	kmod-usb-net-mcs7830 \
	kmod-usb-net-pegasus \
	kmod-usb-net-qmi-wwan \
	kmod-usb-net-rndis \
	kmod-usb-net-rtl8152 \
	kmod-usb-net-sierrawireless \
	kmod-usb-net-smsc95xx

# network support for PCI devices
PCI_PACKAGES_NET := \
	kmod-3c59x \
	kmod-e100 \
	kmod-e1000 \
	kmod-e1000e \
	kmod-forcedeth \
	kmod-igb \
	kmod-natsemi \
	kmod-ne2k-pci \
	kmod-pcnet32 \
	kmod-r8169 \
	kmod-sis900 \
	kmod-sky2 \
	kmod-tg3 \
	kmod-tulip \
	kmod-via-rhine

# misc packages
MISC_PACKAGES := \
	kmod-usb-acm \
	kmod-usb-serial-simple

USB_PACKAGES_MR3020 := \
	kmod-nls-base \
	kmod-usb-core \
	kmod-mii \
	kmod-usb-net \
	kmod-usb-net-cdc-ether \
	kmod-usb-net-rndis \
	kmod-usb-uhci

#
# $(GLUON_TARGET) specific settings:
#

# x86-generic
ifeq ($(GLUON_TARGET),x86-generic)
# support the usb stack on x86 devices
# and add a few common USB and PCI NICs
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	$(PCI_PACKAGES_NET) \
	
endif

# x86-64
ifeq ($(GLUON_TARGET),x86-64)
# support the usb stack on x86-64 devices
# and add a few common USB and PCI NICs
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	$(PCI_PACKAGES_NET) \
	
endif

# Raspberry Pi A/B/B+
ifeq ($(GLUON_TARGET),brcm2708-bcm2708)
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	
endif

# Raspberry Pi 2
ifeq ($(GLUON_TARGET),brcm2708-bcm2709)
GLUON_SITE_PACKAGES += \
	kmod-usb-hid \
	kmod-hid-generic \
	$(USB_PACKAGES_BASIC) \
	$(USB_PACKAGES_STORAGE) \
	$(USB_PACKAGES_NET) \
	
endif

# ar71xx-generic / tiny
GLUON_tp-link-archer-c7-v2_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_tp-link-archer-c7-v4_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)

# 842 can't install a full featured usb image, we don't need network and UMTS on our 842 devices

GLUON_tp-link-tl-wr842n-nd-v1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE)
GLUON_tp-link-tl-wr842n-nd-v2_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE)
GLUON_tp-link-tl-wr842n-nd-v3_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE)

GLUON_tp-link-tl-wr1043n-nd-v1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_tp-link-tl-wr1043n-nd-v2_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_tp-link-tl-wr1043n-nd-v3_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_tp-link-tl-wr1043n-nd-v4_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)

GLUON_tp-link-tl-wdr3500-v1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_tp-link-tl-wdr3600-v1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)
GLUON_tp-link-tl-wdr4300-v1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_UMTS) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)

GLUON_tp-link-tl-mr3020-v1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_MR3020) -gluon-status-page

# mpc85xx-generic
GLUON_tp-link-tl-wdr4900-v1_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE) $(USB_PACKAGES_NET) $(MISC_PACKAGES)

DEFAULT_GLUON_RELEASE := v2017.1.4-$(shell date '+%Y%m%d')-stable-usb

# Allow overriding the release number from the command line
GLUON_RELEASE ?= $(DEFAULT_GLUON_RELEASE)
GLUON_PRIORITY ?= 0
GLUON_LANGS ?= en de
GLUON_ATH10K_MESH ?= 11s

Besonderheiten

TP-Link TL-MR3020

Mit den normalen Gluon 2016.x (vorherige Versionen habe ich nicht ausprobiert) hat der Router TP-Link TL-MR3020 zu wenig freien Speicher für den USB-Support eines USB-3G-Dongle. Abhilfe schafft eine abgespecktre Firmware. Es reicht, auf die Status-Page zu verzichten um USB-Tethering zu unterstützen.