title: is it possible to send UDP broadcasts over wifi without being connected to a network?
body: <p>I am trying to get the time of flight for a packet between 2 Raspberry pis that are set up as access points.</p>
  
  <p>Right now I can transmit a broadcast between them as long as they are connected to the same network.</p>
  
  <p>My thought was that I could send out UDP broadcasts without them being connected to a network, similar to how beacon packets and probe requests are sent.</p>
  
  <p>this is my server code, I am using wireshark to receive packets on the otherside.</p>
  
  <pre><code>import sys, time
  import socket, IN
  
  port = 22222
  interface = "wlan0"
  broadcast = "255.255.255.255"
  
  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
  s.setsockopt(socket.SOL_SOCKET, IN.SO_BINDTODEVICE, interface + "\0")
  
  while 1:
      s.sendto("test data", (broadcast, port))
      time.sleep(2)
  </code></pre>
  
  <p>does anybody know if this is possible? a point in the right direction would be appreciated :) </p>