2

I am aware that Raspberry Pi's are able to be set up as Bluetooth beacons to broadcast data (such as URLs) by following protocols like Eddystone or iBeacon, however I am wondering if it is possible to create a beacon using WiFi? I have a new RPI 3 Model B with inbuilt WiFi and would like to use that over Bluetooth.

The data I want to broadcast is a 'code' only several characters long and ultimately I want to be able to detect this code on an Android device, say by an Android application's background service running and listening for the exact code. I would then use the detection of the code to kick off an action within the Android application, thereby making a 'proximity beacon' out of the RPI.

I'd like to however, achieve this in a connection-less way so that the Android device is not required to connect to the RPI before being able to detect the code. Therefore setting up the RPI as a WiFi Access Point, or just detecting a WiFi network name (SSID) is not preferred.

Any tips or suggestions on if this is possible would be greatly appreciated, thanks.

  • Why is setting up the RPi as an access point (which the Android device could detect) not preferred, please? I don't understand how that follows from your previous sentence - that seems to me like it would do exactly what you want. What have I misunderstood, please? – Mark Smith Oct 7 '16 at 12:54
  • Background to what I'm doing (that I suppose I could've mentioned) is that I'm wanting to do this as a method of 'roll call' in a classroom, i.e. each classroom would have an RPI somehow linked to the classroom and a phone being nearby it would perceived as 'being present'. The first issue of very little importance is AP/SSID spam of lots of RPIs if classrooms are close. The main issue is however 'hiding' the communication so that you can't replicate the RPI elsewhere e.g. if it was AP based I could set up an AP with the name of the classroom I want and trick my Android app that I am in class. – Huddo7794 Oct 7 '16 at 13:28
  • Interesting context. I'm still not convinced "therefore" is the right word there, but I've got some ideas about how you can do it, which I'll write as soon as I'm on a proper keyboard. – Mark Smith Oct 8 '16 at 8:59
  • Yeah sorry I think you're right. Thanks for you help. – Huddo7794 Oct 8 '16 at 10:17
1

Assuming you want the phones to detect the Pi (not the Pi to detect the phones - which would also be a possibility).

Short answer: I can't think of any way you can do this within your constraints (Android device does not connect to the access point) which CANNOT be spoofed, but here are a couple of ideas which are probably hard enough to spoof that nobody will bother.

As I see it, you're limited to information you can convey in the Pi's SSID. I can't think of any other way to get information to the Android device, if you don't want it to connect to the Pi. So, how can you make this slightly harder for people to spoof? Here's my idea.

Set the Pi to change its SSID every minute, to include a fixed "stem" and a new random number. For example, you could call it Class10_xxxx with xxxx changing every minute to a new random (unpredictable!) number. Class10_4292, Class10_2956 and so on. Store the random number and the times it was applied in a big list.

The Android app looks for WiFi access points with names starting with Class10_ and then stores it and two successive numbers. It reports this back, along with the times they were recorded and some information identifying the phone (and the owner), to some server. This proves* that the phone was in that location for (at least) three minutes.

*It doesn't really prove it. You could still spoof this, BUT you'd have to go to quite a lot of work (rewriting the application on the phone, or set up some sort of relay to distribute the numbers live and set up slave access points), because it reports the random numbers AND the times, so the server can verify that the numbers match the times.


If you wanted the Pi to detect the phones, you could have an app on the phones which looked out for a suitable SSID and connected to it for just a moment. The Pi would record the MAC address of the devices which connected, and the time. Then you have a list of people's MAC addresses and you're done.

MAC addresses are spoofable, but not easily (depending on your definition of easy) on most devices.

  • Thanks, I'll have a think about if I can be flexible and try what you've mentioned. Out of curiosity though, you said at the beginning having the Pi detect the phones would also be a possibility. Just quickly, how would the Pi do this and what about the phone could it detect? – Huddo7794 Oct 8 '16 at 12:52
  • I've added an answer to that into my answer above. – Mark Smith Oct 8 '16 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.