Hello everyone, I’ve been trying to retrieve the device’s mac address. For instance, I’m using a standard
ESP8266 nodeMCU.
-
My goal is: Retrieve de device Mac address in a way I can use it further.
-
My actions are: I’ve pasted the sample code as follows:
let rpcMC = RPC.call(RPC.LOCAL, 'Sys.GetInfo', null, function(resposta, ud)
{
print('MAC address:', resposta.mac);
}, null);
Edit: When trying to put the function inside the below timer, I received a calling non-callable feedback.
Timer.set(1000, Timer.REPEAT, rpcMC())
{
};
This sample code works just fine, but I want to be able to use the Mac address further on (to create a thing name in AWS).
-
The result I see is: - This RPC call returns a bunch of information regarding the device, including the mac address, and the function prints it out, but since the ‘resposta’ variable does not exist outside the function, I’m trying to print it in a timer of just somewhere else.
-
My expectation & question is: I expect to be able to use this MAC address to create a thing name inside AWS further down the road.
Tks,