How to run wifi direct function with 43012

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Leo_Liu2
Level 2
Level 2
Distributor - Zenitron(GC)
25 sign-ins 10 sign-ins 5 replies posted

Hi  Sir,

We are evaluating how much ROM,RAM that 43012 P2P will use,I check P2P function in test.console demo firstly,it works fine . So I attempt to port just P2P function to a new demo such as p2p_go_start(),but it always remind me that MAC address is wrong as below:

Error: MAC address is locally administered. Modify MAC address in generated_mac_address.txt file to be globally
administered, e.g. if first byte of MAC address is 0x02 change it to 0x00. If testing multiple Wiced p2p devices ensure that they have unique MAC addresses.

I have checked generated_mac_address.txt , the first byte of macaddr is already 0x00,because of this problem,P2P will not initialize.My WICED version is 6.4, because console demo can't perform P2P with 43012 in 6.2 and 6.6.Please give me some advice ,thanks.

BR,

Leo

 

0 Likes
1 Solution
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

The error you saw comes from multiple files: wifi_cert_commands.c, command_console_p2p.c or connection_manager.c.

The code is similar. See below:

 

int sta_get_p2p_dev_address( int argc, char *argv[] )
{
    wiced_mac_t mac;

    /* Create P2P MAC address */
    wiced_wifi_get_mac_address( &mac );

    if ( mac.octet[0] & MAC_ADDRESS_LOCALLY_ADMINISTERED_BIT )
    {
        printf( "Error: MAC address is locally administered. Modify MAC address in generated_mac_address.txt file to be globally\n" );
        printf( "administered, e.g. if first byte of MAC address is 0x02 change it to 0x00. If testing multiple Wiced p2p devices\n" );
        printf( "ensure that they have unique MAC addresses.\n" );
        return WICED_ERROR;
    }
    mac.octet[0] |= 0x2;

    printf( "status,COMPLETE,DevID,%02X:%02X:%02X:%02X:%02X:%02X\n", mac.octet[0], mac.octet[1], mac.octet[2], mac.octet[3], mac.octet[4], mac.octet[5] );

    return 0;
}

 

You see, though you confirmed that you have ensured generated_mac_address.txt to be set correctly, in fact it didn't work as expected. The mac address was actually not the same as you specified in generated_mac_address.txt.

You can firstly try to call wiced_wifi_get_mac_address() yourself and output the mac address to log to verify the MAC address.

Then, refer to the following links for modifying MAC address:

How to add MAC address to your WICED APP? - Cypress Developer Community

Wifi mac address modification in WICED - Cypress Developer Community

如何在WICED中设置wifi的MAC 地址 - Cypress Developer Community

 

Best regards

View solution in original post

2 Replies
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

The error you saw comes from multiple files: wifi_cert_commands.c, command_console_p2p.c or connection_manager.c.

The code is similar. See below:

 

int sta_get_p2p_dev_address( int argc, char *argv[] )
{
    wiced_mac_t mac;

    /* Create P2P MAC address */
    wiced_wifi_get_mac_address( &mac );

    if ( mac.octet[0] & MAC_ADDRESS_LOCALLY_ADMINISTERED_BIT )
    {
        printf( "Error: MAC address is locally administered. Modify MAC address in generated_mac_address.txt file to be globally\n" );
        printf( "administered, e.g. if first byte of MAC address is 0x02 change it to 0x00. If testing multiple Wiced p2p devices\n" );
        printf( "ensure that they have unique MAC addresses.\n" );
        return WICED_ERROR;
    }
    mac.octet[0] |= 0x2;

    printf( "status,COMPLETE,DevID,%02X:%02X:%02X:%02X:%02X:%02X\n", mac.octet[0], mac.octet[1], mac.octet[2], mac.octet[3], mac.octet[4], mac.octet[5] );

    return 0;
}

 

You see, though you confirmed that you have ensured generated_mac_address.txt to be set correctly, in fact it didn't work as expected. The mac address was actually not the same as you specified in generated_mac_address.txt.

You can firstly try to call wiced_wifi_get_mac_address() yourself and output the mac address to log to verify the MAC address.

Then, refer to the following links for modifying MAC address:

How to add MAC address to your WICED APP? - Cypress Developer Community

Wifi mac address modification in WICED - Cypress Developer Community

如何在WICED中设置wifi的MAC 地址 - Cypress Developer Community

 

Best regards

Leo_Liu2
Level 2
Level 2
Distributor - Zenitron(GC)
25 sign-ins 10 sign-ins 5 replies posted

Hi Charles,

Thanks for your help .I made  a mistake in app.mk,now, it works fine.

 

Best regards

Leo

0 Likes