Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mihini-dev] mihini-dev Digest, Vol 11, Issue 2

Thanks Laurent.

I modified the code in platform.lua to use Arduino Yun's mac as the unique ID:

function M.getdeviceid()
-- Use the Hardware MAC address of the ethernet adapter
-- on Arduino Yún as unique ID for device
    local io = require "io"
    local f = io.popen('ifconfig | grep eth')
    local t = f:read()
    f:close()
    local mac = t:match("HWaddr ([%:%x]*)")
    mac = mac:gsub('%W','')
    log("agent.platform", "INFO", "getdeviceid: deviceId set [%s]", deviceId);
    return mac
end

Will try out the rest of your advice soon!

Back to the top