I'm working on a project based on Intel Edison(Running Debian based Ubilinux).I need Edison to execute some code whenever,my android phone(running CM11) connects to the same WiFi as the Edison.How can I detect the presence of my phone in Edison? I have tried the following.
1.Pinging: But the problem is that router assigns different IP's every time because of DHCP.So,I will not be knowing the IP address of my phone. Is there any way to ping based on device's MAC address?
2. I thought of broadcasting a special discovery packet from my phone,whenever it gets connected to the WiFi.But,I don't know where to start with this approach.
Finding the mac-address would probably work. Basically you can run the arp
command to see what mac-address matches which IP. There's a question on doing that here:
Obtain MAC Address from Devices using Python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With