edgeman:
Hi All, I am working on a home automation project and have come across the Arduino Yún. I've been tinkering with Arduino devices for a while but not with wi-fi yet.
I was wondering if it were possible for the Arduino Yún to react when my mobile (for example) came within range?
One scenario is turning an internal light on if my device is spotted at a certain time of the day.
It would be mac address based I guess, I don't want to have to associate / authenticate the phone with the Yún, it would associate with my home router.
Is this possible?
Thanks!
@edgeman,
Yes, it is possible - if we ignore that the wifi is power-hungry. FWIW, you could do similar with BLE (bluetooth low energy) - if you had a phone with such capabilities (iPhone, Android Nexus).
All iPhones since iPhone4 (i believe) have supported BLE. Only a handful of Android phone support BLE. (related article)
However, doing it with wifi would be much easier.
- You'd have to get a list of devices connect to Yun.
- You'd have to get a list of devices connect to Yun as an AP(Access Point).
- You'd have to get a list of devices advertising as an AP (your phone would advertise as a hotspot).
- You then could get the MAC address or the SSID of the device and do what you need.
As it works out your in luck, I just happen to post a related article just a few days ago.
Some WiFi tricks and a scripts
http://forum.arduino.cc/index.php?topic=320773.0
At the top is Get a list of AP (Access Points) as seen by the Arduino Yun
To see who is connect Openwrt suggests(but I could not check as my Yun is not an AP):
How to get a list of connected clients?
http://wiki.openwrt.org/doc/faq/faq.wireless#how.to.get.a.list.of.connected.clients
In addition, OpenWrt has a bunch of script that could be useful
You can also try
Linux Wireless
http://linuxwireless.org/en/users/Documentation/iw/
This another place to look
Google: linux show connected wifi clients
Also, if you need additional software packages. Here is a partial list.
Yún Software Packages
http://codesnippets.altervista.org/documentation/yun/packages/packages.html
Lastly, if you get something working, it would be nice if you posted code or documentation that could help others.
Jesse