Hello,
Anyone know if it is possible to get the MAC address for my WiFi device (of the phone, not router)?
Mac Address
Moderator: Martin
Re: Mac Address
Hi
You can use action "Execute command" and use one of the commands:
ifconfig wlan0 | grep HWaddr | awk -F" " '{ print $5}'
ip link show wlan0 | grep eth | awk -F" " '{ print $2}'
Maybe there are better solutions
You can use action "Execute command" and use one of the commands:
ifconfig wlan0 | grep HWaddr | awk -F" " '{ print $5}'
ip link show wlan0 | grep eth | awk -F" " '{ print $2}'
Maybe there are better solutions

Regards, piskor
Re: Mac Address
Thanks for the info. Grep does not work for me when using Execute Command, and "ip link show wlan0" gives me a permission denied error.
Here is what I did in case anyone has the same problem:
Get the result of "ip link" (using Execute Command block) into a variable (in this case "iplink").
Then process result:
start=indexOf(iplink, "wlan");
pos1=indexOf(iplink, "ether", start)+6;
pos2=indexOf(iplink, "brd", start)-1;
mac=substring(iplink, pos1, pos2);
//do whatever you want with your mac after this to process as needed
global_mac=replace(mac, ":", "");
Regards,
Sam.
Here is what I did in case anyone has the same problem:
Get the result of "ip link" (using Execute Command block) into a variable (in this case "iplink").
Then process result:
start=indexOf(iplink, "wlan");
pos1=indexOf(iplink, "ether", start)+6;
pos2=indexOf(iplink, "brd", start)-1;
mac=substring(iplink, pos1, pos2);
//do whatever you want with your mac after this to process as needed
global_mac=replace(mac, ":", "");
Regards,
Sam.