6 years, 10 months ago.

WNC library cannot find MAC ADDRESS

Hi,

I am using the AT&T IoT Starter Kit from AVNet. I using the HelloMQTT project as a base for my own code and using the AVNET extension to easy-connect , https://os.mbed.com/teams/Avnet/code/easy-connect-wnc/.

I have updated all easy-connect libraries. I tested out the code using the ethernet controller and all works fine.

When I change to use the WNC14A2A connection and restart I get :

[EasyConnect] No mac address

I can recode to return a value and the program works. Does anyone have an idea of the real issue and fix?

Geoff

The relevant code:

const char *WNC14A2AInterface::get_mac_address()
{
    string mac, str;
    debugOutput(_debugUart,(char*)"+ENTER get_mac_address()\n");

    if( _pwnc->getICCID(&str) ) {
        CHK_WNCFE((_pwnc->getWncStatus()==FATAL_FLAG), null);
        mac = str.substr(3,20);
        mac[2]=mac[5]=mac[8]=mac[11]=mac[14]=':';
        strncpy(_mac_address, mac.c_str(), mac.length());
        return _mac_address;
    }
    return NULL;
}

Geoff, sorry I didn't respond earlier, I didn't see the post until today. The MAC is created from the ICCID of the SIM that is being used. So if no SIM/ICCID, no MAC.

posted by Jim Flynn 14 Sep 2018
Be the first to answer this question.