使用 wifi 进行 iPhone 接近检测
当我回到家并按下主按钮后,我的 iPhone 会自动加入我的家庭网络,我认为这可以用来触发我的一些家庭自动化想法, 例如,特别是解除警报系统。
我可以通过使用脚本 ping 广播地址来检测 iPhone,然后在 arp 缓存中查找它的 MAC 地址,但这必须每 15 秒左右完成一次 有任何用处。但这看起来确实不是最优雅的解决方案。
有人能想出更好的方法来实施这样的检查吗?我想人们可以根据我的 MAC 地址分配一个 IP 地址,然后我就会知道要 ping 的内容,然后可以检查 MAC 地址以确保安全。
假设我无法根据 MAC 地址分配 DHCP IP,因为问题 能够在网络上找到 MAC 地址是我真正感兴趣的部分。
其次,我通过 tcpdump 注意到 iPhone 似乎整夜都在自言自语,但只有某种以太网帧:
23:59:59.740097 00:26:08:ae:ed:eb > 00:26:08:ae:ed:eb,802.3,长度 70:LLC,dsap 空(0x00)个人,ssap 未知(0x20)命令,ctrl 0x33:未编号,23,标志 [轮询],长度 56
这种情况每次发生2分钟。
我如何使用程序监控此流量,以便我的“家”知道我仍然在那里?当我不在时自动向房子发出警报可能会很好......
As my iPhone automatically joins my home network once I get home and press the main button, I thought this could be used as a trigger for some home automation ideas I have,
especially disarming the alarm system for example.
I could detect the iPhone by pinging the broadcast address with a script and then look for it's MAC address in the arp cache, but this would have to be done every 15 seconds or so
to be of any use. This really doesn't seem like the most elegant solution though.
Can anyone think of a better way to implement a check like this? I suppose one could assign an IP address dependent on my MAC address, then I would know what to ping, and could thereafter check the MAC address to keep things secure.
Just suppose I cannot assign a DHCP IP based on MAC address, as the problem
of being able to find the MAC address on the network is the part that really interests me.
Secondly I noticed with tcpdump that the iPhone seems to talk to itself all night, but only some sort of Ethernet frames:
23:59:59.740097 00:26:08:ae:ed:eb > 00:26:08:ae:ed:eb, 802.3, length 70: LLC, dsap Null (0x00) Individual, ssap Unknown (0x20) Command, ctrl 0x33: Unnumbered, 23, Flags [Poll], length 56
This happens every 2 minutes.
How could I monitor this traffic so that my "home" knows I am still there using a program? Could be good to automatically alarm the house when I am no longer there...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这里的路由器应该是控制点...如果您可以记录登录到路由器的设备,您可以根据该信息禁用安全性。
如果您有 openWrt 兼容路由器 http://wiki.openwrt.org/toh/start 您当然可以扩展以获得您想要的功能。
这是 indigo 家庭自动化服务器的链接插件,它可以执行您想要执行的操作,从路由器记录信息。 http://www.perceptiveautomation.com/userforum/viewtopic.php?f=19&t=6876&sid=07a351fa04c2eadcd2d3813afc72ae5a
注意:欺骗 mac 地址真的很容易,所以可能是进行其他一些验证也很有趣:-)
I think your router here should be the point of control... If you can log the devices that are logged on to the router you can disable your security based on that info.
If you have an openWrt compatible router http://wiki.openwrt.org/toh/start you can certainly extend to get the functionality you want.
Here is a link plugin for the indigo home automation server that does what you want to do bij logging the info from his router. http://www.perceptiveautomation.com/userforum/viewtopic.php?f=19&t=6876&sid=07a351fa04c2eadcd2d3813afc72ae5a
Note: it's really easy to spoof a mac address so might be interesting to have some other verification too :-)