How can I send raw packets over Wi-Fi without a network?

I am trying to send some data between two raspberry pi over wifi without connecting them to the network.

I want it to work in a similar way to how beacons and probe requests work, where the broadcast can be sent over the wireless interface.

the data I want to send will be the hostname of the device and the time the packet was sent.

I've been trying to figure this out for the past few days, but I can't seem to get anything to work unless they are on the same network.

Can anyone point me in the right direction? I didn't fuss too much about which language I am using. I am trying python and C with little success.

+3


source to share


1 answer


Note. This is not really an answer, just some ideas to explore, so feel free to edit or comment with corrections.


There are 6 modes in which the Wi-Fi adapter can work. From wikipedia :

Master (acting as an access point), Managed (a client, also known as a station), Ad hoc, Mesh, Repeater, and Monitor.

But I believe that not all wifi adapters support all modes, so make sure you have the right hardware.



I would suggest an adhoc or mesh would be the most appropriate for your purpose. In adhoc mode, at least devices must be preconfigured to use the same SSID and channel. This may not apply to grid mode.

A quick search gives several links to using the Raspberry Pis on a mesh network:

I would also look at using the Dot11 * family of packages in the excellent Python Scapy (not to be confused with Sc t apy). You should be able to create custom packages and pass them if the interface is in the correct mode. Here's a project that creates fake hotspots that probably contain good information: https://github.com/rpp0/scapy-fakeap

+2


source







All Articles