element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum ad hoc Netzwerk mit Raspberry Pi Model B
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 17 replies
  • Subscribers 664 subscribers
  • Views 1945 views
  • Users 0 members are here
  • adhoc
  • raspberry
  • arp
  • routing
  • manet
Related

ad hoc Netzwerk mit Raspberry Pi Model B

Former Member
Former Member over 10 years ago

Hallo

 

Ich versuche ein Ad-hoc Meshnetz mittels 4 Raspberry Pi's Model B aufzubauen. Hier sind die Hardware Eigenschaften:

  • 4x Raspberry Pi Model B ( Raspbian Debian Wheezy 3.18)
  • 4x Edimax EW-7811Un USB WiFi Adapter (RTL8188cus)
  • 1x Laptop mit Win 8.1 um auf die RPi's über SSH (PuTTY) zuzugreifen

 

 

ich habe die RPi Netzwerkeinstellungen wie folgend konfiguriert:

/etc/network/interfaces

RPi1

auto lo
iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.1.21
  netmask 255.255.255.0
  wireless-channel 1
  wireless-essid RPiAdHocNetwork
  wireless-mode ad-hoc

 

RPi2

auto lo
iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.1.22
  netmask 255.255.255.0
  wireless-channel 1
  wireless-essid RPiAdHocNetwork
  wireless-mode ad-hoc

 

RPi3

auto lo
iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.1.23
  netmask 255.255.255.0
  wireless-channel 1
  wireless-essid RPiAdHocNetwork
  wireless-mode ad-hoc

 

RPi4

auto lo
iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.1.24
  netmask 255.255.255.0
  wireless-channel 1
  wireless-essid RPiAdHocNetwork
  wireless-mode ad-hoc

 

Laptop

IP: 192.168.1.20
Subnet: 255.255.255.0
Mode: Ad-hoc

 


Das pingen vom Laptop --> RPi's funktioniert

C:\> ping 192.168.1.21

Ping wird ausgeführt für 192.168.1.21 mit 32 Bytes Daten:
Antwort von 192.168.1.21: Bytes=32 Zeit=1ms TTL=64
Antwort von 192.168.1.21: Bytes=32 Zeit=1ms TTL=64
Antwort von 192.168.1.21: Bytes=32 Zeit=2ms TTL=64
Antwort von 192.168.1.21: Bytes=32 Zeit=1ms TTL=64

Ping-Statistik für 192.168.1.21:
    Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0
    (0% Verlust),
Ca. Zeitangaben in Millisek.:
    Minimum = 1ms, Maximum = 2ms, Mittelwert = 1ms

 

das Pingen vom RPi --> Laptop funktioniert auch

pi@rpi1 ~ $ ping 192.168.1.20
PING 192.168.1.20 (192.168.1.20) 56(84) bytes of data.
64 bytes from 192.168.1.20: icmp_req=1 ttl=128 time=1.37 ms
64 bytes from 192.168.1.20: icmp_req=2 ttl=128 time=1.24 ms
64 bytes from 192.168.1.20: icmp_req=3 ttl=128 time=1.25 ms
64 bytes from 192.168.1.20: icmp_req=4 ttl=128 time=15.6 ms
64 bytes from 192.168.1.20: icmp_req=5 ttl=128 time=1.42 ms
64 bytes from 192.168.1.20: icmp_req=6 ttl=128 time=1.28 ms
^C
--- 192.168.1.20 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 1.242/3.710/15.683/5.354 ms

 

Das Problem ist, dass ich von einem RPi zum anderen nicht direkt pingen kann.

pi@rpi1 ~ $ ping 192.168.1.22
PING 192.168.1.22 (192.168.1.22) 56(84) bytes of data.
From 192.168.1.21 icmp_seq=1 Destination Host Unreachable
From 192.168.1.21 icmp_seq=2 Destination Host Unreachable
From 192.168.1.21 icmp_seq=3 Destination Host Unreachable
From 192.168.1.21 icmp_seq=4 Destination Host Unreachable
From 192.168.1.21 icmp_seq=5 Destination Host Unreachable
From 192.168.1.21 icmp_seq=6 Destination Host Unreachable
^C
--- 192.168.1.22 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6004ms
pipe 3

 

Hat jemand vielleicht eine Idee wie ich die RPi's mit einander zu kommunizieren bringen könnte? vielen dank im voraus


Attachments:
image
  • Sign in to reply
  • Cancel
  • rew
    rew over 10 years ago in reply to Former Member

    What you should have mentioned is that the "host unreachable" messages come three at a time. This is a clear indication that the computer is doing ARP, but not getting a response.

     

    The ARP broadcasts from pi1 are not reaching pi2 (or the other way around). I would have expected this to work.

     

    The remaining problem is that your packets from pi1 are not reaching pi2. This is a wlan problem above my paygrade. :-) I'm good at TCPIP, but not so much at WLAN. Sorry.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to rew

    So I assume it could be a hardware or driver issue. 

     

    but thanks alot for the clear explanation image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to rew

    I tried to add the MAC address of Pi2 in arp of Pi1 and the other way , and it worked ! now I can ping from Pi ot Pi, but I still can't understand the reason why the Pi can't find each other automatically.

     

    anyone hardware experts out there?  image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • rew
    rew over 10 years ago in reply to Former Member

    That's weird! 

    This would mean that the BROADCAST arp does not work, while a directed packet does work. What ethernet addresses do you see on the ARP packets in the tcpdump if you add the "-e" option on the commandline?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to rew

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • clem57
    clem57 over 10 years ago in reply to Former Member

    I recall that wireless 2.4Ghz topology has something known as a hidden node effect. A radio can reach radios in the area but not some that are located farther away. But a central node can reach all. If two nodes are close to a central node but too far from each other can have this happen. Walls and other things can exasperate the issue.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • rew
    rew over 10 years ago in reply to clem57

    Yes Clem, but in this case the nodes can reach each other, but only the "broadcast" packets from one pi are not reaching the others. As if the wifi sticks are ignoring (some) broadcast packets.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube