-1

I've created a c++ server who broacast a packet every second.

The binary is working and the packet is correctly send when i'm connected on the wifi.

I've put the working binary on a raspberry and have successfully configure an access point (cf this tutorial : https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=54946)

I successfully connect on the ap with my android phone. But when i launch the binary who broadcast, my phone get nothing. He did not receive the packet.

I think hostapd is blocking the broadcast packet but I don't know why and, more than that, I don't know how to enable it.

wlan0     Link encap:Ethernet  HWaddr c4:e9:84:17:59:d1
      inet addr:192.168.42.1  Bcast:192.168.42.255  Mask:255.255.255.0
      inet6 addr: fe80::c6e9:84ff:fe17:59d1/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1243 errors:0 dropped:1 overruns:0 frame:0
      TX packets:746 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:85351 (85.3 KB)  TX bytes:61162 (61.1 KB)

Either 192.168.42.255 or 255.255.255.255 aren't transmiting the packet.

Little help will be thankfull

1 Answers1

0

In most situation your broadcast traffic will be suppressed. I suggest you to make a routine in order to send the packet one by one in contemporary threads. It's the best choice i think. I hope it helps!

Francesco P
  • 321
  • 1
  • 7
  • you mean sending the packet from ip 192.168.42.2 to 192.168.42.254? I can try this, but I think it will generate a big flood on the network – Thomas Grockowiak Nov 13 '15 at 15:33
  • It depends from what you have to do. If you need to shot just some packets or if you have to make a long stream. – Francesco P Nov 13 '15 at 15:35
  • every second the server broadcast is ip so android phone who connect on the same network can make a direct connection to it – Thomas Grockowiak Nov 13 '15 at 15:36
  • I don't know the application's workflow and I think that your problem it's just for handshaking otherwise, you are agree with me that also if you find a solution to produce an acceptable broadcast packet your application ever works only in LAN. – Francesco P Nov 13 '15 at 15:46