【问题标题】:Raspberry Pi and Edimax 7811UN incompatibility in ad-hoc modeRaspberry Pi 和 Edimax 7811UN 在 ad-hoc 模式下不兼容
【发布时间】:2016-12-22 21:27:43
【问题描述】:

我正在使用带有 1 GB RAM 的 Raspberry Pi Model 2 BEDIMAX nano USB 适配器。起初我在 Rapsberry Pi 上使用 NOOBS,想在两个这样的 Pi 之间建立一个 ad-hoc 网络。

我尝试使用与下面提到的相同配置来配置其中一个 RPi:

#etc/network/interfaces for pi-1 
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.50.1
    netmask 255.255.255.0
    wireless-channel 12
    wireless-essid pi-adhoc
    wireless-mode ad-hoc

#etc/network/interfaces for pi-2
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.50.2
    netmask 255.255.255.0
    wireless-channel 12
    wireless-essid pi-adhoc
    wireless-mode ad-hoc

我已将 Pi-1 设置为 DHCP 服务器(使用 ISC-DHCP-Server 守护程序),以便我可以通过 SSH 连接到 Pi 的 Ad-hoc 网络,以便通过我的笔记本电脑。 DHCP服务器配置如下:

ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;

option subnet-mask 255.255.255.0;
option domain-name "pi-adhoc";
subnet 192.168.50.0 netmask 255.255.255.0 {
range 192.168.50.3 192.168.50.150;  
}

然后运行守护进程 pi-1 ~$ sudo service isc-dhcp-server start

我还强制 Pi 加入 ad-hoc 网络,方法是在它们两个上配置 rc.local 文件,如下所示:

#! /bin/bash
# For Pi-1 /etc/rc.local
adhocNetwork(){
    echo "connecting to ad hoc network"
    ifconfig wlan0 down
    iwconfig wlan0 mode ad-hoc
    iwconfig wlan0 essid pi-adhoc
    iwconfig wlan0 channel 12
    ifconfig wlan0 192.168.50.1 netmask 255.255.255.0 up
    echo "connected to ad hoc network"
}
adhocNetwork
exit 0

#! /bin/bash
# For Pi-2 /etc/rc.local
adhocNetwork(){
    echo "connecting to ad hoc network"
    ifconfig wlan0 down
    iwconfig wlan0 mode ad-hoc
    iwconfig wlan0 essid pi-adhoc
    iwconfig wlan0 channel 1
    ifconfig wlan0 192.168.50.2 netmask 255.255.255.0 up
    echo "connected to ad hoc network"
}
adhocNetwork
exit 0

推论

当我在笔记本电脑上使用 WiFi 并连接到由 Pi 创建的 pi-adhoc 网络时,我从 Pi-1 的池中获取 DHCP 服务器的 IP 地址,并且可以 ssh 进入Pi-1 并且只是为了检查连接性,我可以将笔记本电脑从 RPi ping 到笔记本电脑,反之亦然。

当我尝试从 Pi-1 ping Pi-2 时,它无法访问,反之亦然。但我可以从笔记本电脑连接到 Pi-2,反之亦然。

场景:PI-1 笔记本电脑和 PI-2 笔记本电脑 但 PI-1 没有连接 PI-2 我无法将 Pis 连接在一起。

我还使用以下方法将 NOOBS 升级为 Wheezy: sudo apt-get 更新 sudo apt-get dist-upgrade

但问题依然存在。

任何帮助将不胜感激。谢谢。

【问题讨论】:

    标签: networking adhoc


    【解决方案1】:

    因此,如果不使用 Edimax EW7811UN 无线加密狗,连接问题终于得到解决。该问题与超过 3.9 版本的 Linux 内核不支持的驱动程序有关。该驱动程序具体称为802nl11 驱动程序

    解决连接问题的另一种解决方案是使用 WiFi 加密狗,其中包含 Ralink RTL5370 驱动程序。我目前正在使用 LogiLink WL0145 无线 N USB 适配器

    当 USB 加密狗连接到 RPi 时,可以使用 lsusbcommand 很好地检查驱动程序。现在使用相同的配置,我可以 ping 两个 Raspberry Pi。

    推理

    在使用 Edimax 加密狗时,特别是在 Ad-Hoc 模式 下,适用于 Raspberry Pi 的 Model B+ 存在驱动程序兼容性问题。因此,建议在 Ad-Hoc 模式下使用 RPis 时切换到其他 WiFi 加密狗,尤其是带有 Ralink Technology RT5370 无线适配器的无线加密狗。

    与杰西核实

    JessieJessie Lite 8.0

    的 Ad Hoc 模式仍然不支持 Edimax 7811UN

    【讨论】:

      【解决方案2】:

      问题在于,出于某种原因,至少在 Debian Jessie 4.1.13-v7+ 中。 RTL8192cu 驱动程序不支持在 ad-hoc 模式下对 Edimax EW7811UN 无线加密狗进行广播。

      但是,如果 Raspberry Pi 之间的 ssh-ing 是您需要的所有功能。您可以在 ARP 表中插入手动 arp 条目,以防止需要执行 ARP 广播来将 MAC 地址解析为 IP 地址关联。

      在 IP 地址为 192.168.50.1 的 Raspberry Pi 中执行以下操作:

      arp -s 192.168.50.2 [MAC Address of Wireless Dongle on other Raspberry Pi]

      在 IP 地址为 192.168.50.2 的 Raspberry Pi 中执行以下操作:

      arp -s 192.168.50.1 [MAC Address of Wireless Dongle on other Raspberry Pi]

      完成此操作后,您应该能够通过 ssh 连接到 Raspberry Pi 并 ping Raspberry Pi。但请注意,对于任何需要广播的协议,它都不适用于处于 ad-hoc 模式的 Edimax EW7811UN 无线加密狗。

      或者,如果您想要在 ad-hoc 模式下开箱即用的无线加密狗。我强烈推荐 TP-Link TL-WN722N。我已经尝试过了,它有效。

      【讨论】:

      • 感谢@renlord 我肯定会调查此案并查看 TP-Link 加密狗。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-18
      • 2014-10-03
      • 2013-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多