0

I have a Pi Zero W, and want to use it to broadcast the status of a door (open / closed) to people (working on laptops) near-by.

I got it working by setting up an access point (with hostapd) that contains the relevant information in the SSID but the problem is that laptops seem to "remember" the past SSIDs so that if the door is opened and closed often enough, both will always appear. Is there some way to prevent that?

xavierm02
  • 447
  • Are these linux laptops the people are working on? How are they configured to see the SSID? You've given us NO technical detail to work with. – 0xSheepdog Mar 28 '18 at 04:20
  • @0xSheepdog The people's laptop can be under Linux, Windows or Mac OS. I was hopping there was some way for the Pi to say "forget me after 30s", or some other solution that only involves doing things on the Pi. – xavierm02 Mar 28 '18 at 17:09
  • Nope, highly doubtful the 802.11 protocol allows the AP to set anything like that. It's almost certainly a client config thing, which varies by each kind of client. I think its doable, but how much effort it takes to get each client to work how you want it too is the real question. – 0xSheepdog Mar 28 '18 at 18:00
  • @0xSheepdog Then maybe some way of customising the text of a password prompt / welcome message / error message? – xavierm02 Mar 28 '18 at 18:04

1 Answers1

2

So, two things.

  1. This isn't really a UNIX & Linux question, except for the fact that you are using an Pi-Z-W with some *Nix installed on it (I assume, based on use of hostapd).
  2. You are making it a bit more complex than strictly necessary. The state of the door is a boolean: open or closed. true or false. 0 or 1. yes or no.

Instead of trying to broadcast two different SSIDs to convey the state of the boolean, use the presence of the broadcast itself as the indicator.

SSID = TheDoorIsOpen!

When the Pi detects the door is open, it starts the hostapd service and the signal is visible/available/seen by the computers in the vicinity. When the door is closed, the Pi stops the service and the 802.11 signal is gone and the SSID is not visible as an active/available network.

0xSheepdog
  • 2,750
  • Good idea! And since in my case, people want to know that the door is open before getting up and walking to it, if the ssid is "door closed", it won't make anyone angry because they walked and the door was closed. Ideally, I would still like to have more control on the delay between the door being opened and the information being received but this is already good enough for the system to be useful. Thank you! – xavierm02 Mar 28 '18 at 18:28