Raspberry pi 使用RaspberryPi型号B 1(Broadcom BCM2835)和USB OTG作为从以太网
我正在尝试使用Broadcom BCM2835 OTG功能,将RPi用作以太网小工具,以便与主机建立网络连接(我发现它与RPi Zero一起使用)。 正如您可以在中看到的,OTG在RPi B1中受支持 我尝试用模块重新编译内核:Raspberry pi 使用RaspberryPi型号B 1(Broadcom BCM2835)和USB OTG作为从以太网,raspberry-pi,usb-otg,Raspberry Pi,Usb Otg,我正在尝试使用Broadcom BCM2835 OTG功能,将RPi用作以太网小工具,以便与主机建立网络连接(我发现它与RPi Zero一起使用)。 正如您可以在中看到的,OTG在RPi B1中受支持 我尝试用模块重新编译内核: Device Drivers > USB support > OTG support CONFIG_USB_OTG: The most notable feature of USB OTG is support for a "Dual-Role" dev
Device Drivers > USB support > OTG support
CONFIG_USB_OTG:
The most notable feature of USB OTG is support for a
"Dual-Role" device, which can act as either a device
or a host. The initial role is decided by the type of
plug inserted and can be changed later when two dual
role devices talk to each other.
Select this only if your board has Mini-AB/Micro-AB
connector.
Symbol: USB_OTG [=y]
Type : boolean
Prompt: OTG support
Location:
-> Device Drivers
-> USB support (USB_SUPPORT [=y])
-> Support for Host-side USB (USB [=y])
Defined at drivers/usb/core/Kconfig:44
Depends on: USB_SUPPORT [=y] && USB [=y] && PM [=y]
我将usb0接口配置添加到/etc/network/interfaces
allow-hotplug usb0
mapping hotplug
script grep
map usb0
iface usb0 inet static
address 192.168.2.1
netmask 255.255.255.0
broadcast 192.168.2.255
我在/boot/config.tx
文件中添加了行dtoverlay=dwc2
我在/etc/modules
中添加了dwc2
和g_-ether
allow-hotplug usb0
mapping hotplug
script grep
map usb0
iface usb0 inet static
address 192.168.2.1
netmask 255.255.255.0
broadcast 192.168.2.255
什么都没用。ifconfig usb0
的输出为:
usb0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255
ether ba:b9:a5:2a:b2:04 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb0:flags=4099 mtu 1500
inet 192.168.2.1网络掩码255.255.255.0广播192.168.2.255
乙醚ba:b9:a5:2a:b2:04 txqueuelen 1000(以太网)
接收数据包0字节0(0.0B)
接收错误0丢弃0超出0帧0
发送数据包0字节0(0.0B)
发送错误0丢弃0溢出0载波0冲突0
插入时,主机无法识别任何USB设备
可以使用USB A作为从机吗?有办法解决吗