This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3200-LAUNCHXL: cc3200launchxlrev4.1

Part Number: CC3200-LAUNCHXL
Other Parts Discussed in Thread: CC3200, CC3100SDK

In advance, I apologize for asking what is going to sound like a really stupid question.

I'm working on a project where an android app communicates with a cc3200 over p2p with udp packets. So far I can connect, communicate both directions on both the android and the cc3200 and am pretty happy with the progress. There is however one hurdle I can't get over and that is getting the cc3200 to get an IP address from the android.

The android is always the Group Owner and  its IP is 192.168.49.1

When the cc3200 connects its IP is192.168.49.153.  I don't think this IP is a product of DHCP because when I sign a tablet onto the android it gets IP 192.168.49.10 which I think is more plausible.

I'm using many of the routines from the example apps including this one from the p2p example.

static long ConfigureSimpleLinkToDefaultState()

As best I can understand, the following is responsible for setting how the cc3200 gets the IP address.

// Enable DHCP client

lRetVal = sl_NetCfgSet(SL_IPV4_STA_P2P_CL_DHCP_ENABLE,IPCONFIG_MODE_ENABLE_IPV4,1,&ucVal);

ASSERT_ON_ERROR(lRetVal);

So my first question is,  am I reading this right? Is this configuring the cc3200 to get its IP via DHCP? If so it doesn't seem to do it.

Second question, am I off base assuming that the 192.168.49.153 address is not coming from the android?

Third question, Documentation on the NetCfg module says, "In order to disable the static IP and get the address from DHCP one should use SL_STA_P2P_IPV4_DHCP_SET" but that option does not exist. I assume the only options for the first parameter are,

SL_MAC_ADDRESS_SET

SL_IPV4_STA_P2P_CL_DHCP_ENABLE

SL_IPV4_STA_P2P_CL_STATIC_ENABLE

SL_IPV4_AP_P2P_GO_STATIC_ENABLE

SL_IPV4_DHCP_CLIENT

SL_IPV4_DNS_CLIENT

SL_IPV4_ARP_FLUSH

Yet I can't get the desired result from any of them.

So where should I go from here? Is this a multistep setup or am I missing something minor?

Thanks in advance.

  • Hi Greg,

    I believe you're on the right track. Your phone is assigning an IP address to the CC3200 when it is the GO. In this DHCP mode the phone is acting as a DHCP server.

    The sl_NetCfgSet function will set how the device acquires its IP, whether it be static or set by DHCP.

    I think a lot of your questions can be answered in the CC3200 Programmer's Guide: http://www.ti.com/lit/swru368

    Also, the Netcfg html within the CC3200 SDK has some good code examples and information as well for NetCfg functions:

    file:///C:/ti/CC3100SDK_1.2.0/cc3100-sdk/docs/simplelink_api/html/group__netcfg.html

    Hope this helps,
    Kevin
  • Thanks for weighing in Kevin. I'm beginning to think that the IP is coming from the phone, I just don't understand the odd numbering assignment. I guess I expected it to sequence off of the gateway IP (or GO in this case, same thing I suppose) like with the tablet.

    Your link to the programmers guide is an updated version of the one I've been working with so that's a bonus and the html in the SDK has been a source of good information.

    At this point I'm going to assume that a break point firing on this line of code,
    g_ulDeviceIp = pNetAppEvent->EventData.ipAcquiredV4.ip;
    in the SimpleLinkNetAppEventHandler of a sample program, is a pretty clear indication that the IP is a product of a DHCP server and will mark this resolved. But if anyone can explain the odd numbering sequence I would appreciate a little clarity.

    Thanks again and cheers.