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.

CC3120MOD: Is it in AP mode we need to set gateway ip same as device ip

Part Number: CC3120MOD
Other Parts Discussed in Thread: CC3120

Hi,

Can anyone update on this that limitation of AP mode in CC3120MOD resolve or not?

That in AP mode gateway ip should be same as device ip.

Because by this internet packet on laptop will also route by device only which is not good or will decrease performance of CC3120MOD.

Regards,

Mahendra Rana

  • If not possible to set other gateway ip then device ip address then is it there is a way to then not push gateway in DHCP lease?

  • Hi,

    It should be possible to configure the device in AP mode with static IP address setting and different device IP vs. gateway IP address. See section 4.4.3 of the NWP programmer's guide:

    http://www.ti.com/lit/swru455

    However, I'm not sure that is solving the problem you have with a client connected to the CC3120 AP being able to route its packets over a different interface.

    What is the use-case you are trying to support where the CC3120 needs to be in AP mode with a connected laptop and the laptop needs to access the internet?

    Thanks,

    Ben M

  • Hi,

    Yes device ip in ap mode we can configured static but as we have faced issue earlier while connecting in AP mode with mobile so on TI forum my colleague got replied that we need to keep gateway ip same as device static ip. Then only we can able to connect in AP mode with mobile.

    Please find below link on which we got reply on forum: -

    https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/t/778819

    So its a limitation of CC3120MODA that we need to keep gateway ip same as device ip. Is it in latest service pack version it is resolve by TI?

    Our application in AP mode is that mobile will connect with CC3120MOD and mobile app will read data from module which behaves as TCP server.

    While communicating mobile app with CC3120MOD it also fetch data from internet server.

    So right now while mobile communicating with CC3120MOD in AP mode, mobile internet get stopped working as gateway ip was same as device ip of CC3120MOD only. As internet packet also route by mobile to CC3120MOD. And if we keep gateway ip different from CC3120MOD device ip then internet packet will be route by 4G modem of mobile not to CC3120MOD.

    Waiting for solution of our issue.

    Regards,

    Mahendra Rana

  • Hi Ben M,

    Waiting for your comments and reply..

    Regards,

    Mahendra Rana

  • Hi Mahendra, 
    I haven't been able to go through all of your comments yet because we had the long weekend in the US. I'll review and plan to provide an update by end of day tomorrow.

    Best,

    Ben M

  • Hi Mahendra,

    Just to clarify the post you are linking, the response means that by default our device will use the same address for device IP and gateway IP in AP mode. It is possible to set them to different addresses when using static IPv4 parameters.

    I believe the behavior you observe when the device IP/gateway IP are different is dependent on the mobile device and how it decides to route packets (i.e. how it sets priority for transmitting over its various active interfaces and use the gateway IP specified by the Wi-Fi device). I don't think there is a specific limitation on our device in this situation.

    Please let me know if you have information to the contrary that I may be missing.

    Best Regards,

    Ben M

  • Hi,

    Sorry but we have tried earlier with different device ip and gateway ip and that time found issue that we can able to connect with laptop but unable to connect with mobile.

    So "" replied on forum that " If you are using our device in AP mode, then yes the device IP should be the Gateway IP"

    Please review last same query by my colleague on forum 

    https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/t/778819

    Is it this is resolved in latest service pack/host driver? Can you test same at your end on CC3120MOD?

    Please reply as soon as possible.

    Regards,

    Mahendra Rana

  • Hi Mahendra,

    Again, to clarify Vince's response, he was stating what the default is. I think there was miscommunication previously. The default for AP mode is static IP with device IP and default gateway. See Address line in table 4-6 from the Network Processor Programmer's guide below:

    Do you have any additional information on the failed connection from the mobile device? I don't think this is an issue with how our device works/is implemented.

    Please provide additional data such as sniffer capture of connection.

    Best Regards,

    Ben M

  • Dear Ben M,

    Is it possible to not include Gateway lease in DHCP server of CC3120MOD . As in AP mode, CC3120MOD also lease default gateway to client/mobile so if I am using internet then internet packet are route to CC3120MOD by its default gateway and not route by mobile modem gateway.

    So that's why I am not able to access internet in mobile when it is connect with CC3120MOD in AP mode. And if CC3120MOD not lease default gateway to client/mobile then internet packet will get route by mobile modem gateway only and then I am able to access internet and also CC3120MOD which is connect in local network with mobile.

    waiting for your reply...

    Regards,

    Mahendra Rana

  • Hi Mahendra,

    I don't believe this is possible. Let me double check and get back to you by Thursday.

    Best Regards,

    Ben M

  • Hi Ben,

    Waiting for your confirmation. But if this is not possible then how I can access internet in mobile by AP mode if I have connected to CC3120MOD.

    Please give solution for our issue as soon as possible.

    Regards,

    Mahendra Rana

  • Hi Ben,

    Waiting for your confirmation. But if this is not possible then how I can access internet in mobile by AP mode if I have connected to CC3120MOD.

    Please give solution for our issue as soon as possible.

    Regards,

    Mahendra Rana

  • Hi Ben,

    I have also tried with different gateway ip like ip address as 192.168.43.237 and gateway ip as 192.168.43.1 but in this case I am able to connect with laptop and able to communicate with it but in mobile it get disconnect and again auto connect: -

    [Event] STA Removed (MAC Address: 08:25:25:10:6a)
    Error [-2018] at line [320] in function [Reset_WiFiDevice]
    [NETAPP EVENT] IP Acquired: IP=192.168.43.237 , Gateway=192.168.43.1
    Error [-11] at line [480] in function [m_openConnection]
    Error [-11] at line [437] in function [m_Start]
    [Event] New STA Added (MAC Address: 08:25:25:10:6a)
    [NETAPP Event] IP Leased: 192.168.43.221
    [Event] STA Removed (MAC Address: 08:25:25:10:6a)
    Error [-2018] at line [320] in function [Reset_WiFiDevice]
    [NETAPP EVENT] IP Acquired: IP=192.168.43.237 , Gateway=192.168.43.1
    Error [-11] at line [480] in function [m_openConnection]
    Error [-11] at line [437] in function [m_Start]
    [Event] New STA Added (MAC Address: 08:25:25:10:6a)
    [NETAPP Event] IP Leased: 192.168.43.221
    [Event] STA Removed (MAC Address: 08:25:25:10:6a)
    Error [-2018] at line [320] in function [Reset_WiFiDevice]
    [NETAPP EVENT] IP Acquired: IP=192.168.43.237 , Gateway=192.168.43.1
    Error [-11] at line [480] in function [m_openConnection]
    Error [-11] at line [437] in function [m_Start]

    Why with mobile when I set different gateway ip other then cc3120mod device ip address then it disconnect and connect automatically?

    Regards,

    Mahendra Rana

  • Hi Ben,

    Forget to mentioned in last reply that I have checked with latest host driver and service pack also but same behavior of cc3120mod and we are using non rtos environment on non TI host controller. So in latest host driver we have done changes according to below link: -

    Implemented OS Adaptation Layer for non rtos environment :-
    (referred from https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/t/690115)  

    ==============================================

    CHIP: 0x31000000
    MAC: 2.0.0.0
    PHY: 2.2.0.7
    NWP: 3.15.0.1
    ROM: 0
    HOST: 3.0.1.41
    MAC address: c8:df:84:4f:ba:f9

    ==============================================

    Regards,

    Mahendra Rana

     

     

     

     

  • Hi Mahendra,

    I checked in the FW and I confirmed that your suggestion to not include the gateway lease with built-in DHCP server of CC3120 is not currently possible.

    Best Regards,

    Ben M

  • Hi Ben,

    I have also tried with different gateway ip like ip address as 192.168.43.237 and gateway ip as 192.168.43.1 but in this case I am able to connect with laptop and able to communicate with it but in mobile it get disconnect and again auto connect: -

    [Event] STA Removed (MAC Address: 08:25:25:10:6a)
    Error [-2018] at line [320] in function [Reset_WiFiDevice]
    [NETAPP EVENT] IP Acquired: IP=192.168.43.237 , Gateway=192.168.43.1
    Error [-11] at line [480] in function [m_openConnection]
    Error [-11] at line [437] in function [m_Start]
    [Event] New STA Added (MAC Address: 08:25:25:10:6a)
    [NETAPP Event] IP Leased: 192.168.43.221
    [Event] STA Removed (MAC Address: 08:25:25:10:6a)
    Error [-2018] at line [320] in function [Reset_WiFiDevice]
    [NETAPP EVENT] IP Acquired: IP=192.168.43.237 , Gateway=192.168.43.1
    Error [-11] at line [480] in function [m_openConnection]
    Error [-11] at line [437] in function [m_Start]
    [Event] New STA Added (MAC Address: 08:25:25:10:6a)
    [NETAPP Event] IP Leased: 192.168.43.221
    [Event] STA Removed (MAC Address: 08:25:25:10:6a)
    Error [-2018] at line [320] in function [Reset_WiFiDevice]
    [NETAPP EVENT] IP Acquired: IP=192.168.43.237 , Gateway=192.168.43.1
    Error [-11] at line [480] in function [m_openConnection]
    Error [-11] at line [437] in function [m_Start]

    I have checked with latest host driver and service pack also but same behavior of cc3120mod and we are using non rtos environment on STM32 host controller. So in latest host driver we have done changes according to below link: -

    Implemented OS Adaptation Layer for non rtos environment :-
    referred from https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/t/690115

    ==============================================

    CHIP: 0x31000000
    MAC: 2.0.0.0
    PHY: 2.2.0.7
    NWP: 3.15.0.1
    ROM: 0
    HOST: 3.0.1.61
    MAC address: c8:df:84:4f:ba:f9

    ==============================================

    1) Why with mobile when I set different gateway ip other then cc3120mod device ip address then it disconnect and connect automatically?

    As in same thread you mentioned we can able to set different gateway ip then device ip. But I have retried and not able to do that as well.

    2) And as you mentioned that it is not possible in CC3120MOD to not lease default gateway to connected client/mobile then this means in CC3120MOD it is not possible to access internet if configure in AP mode?

    3) Any other way to have access internet on mobile/cc3120mod or to not lease default gateway in CC3120MOD?

    4) Any other device then cc3120mod which support our issue?

    Regards,

    Mahendra Rana

  • Hi Ben,

    Waiting for your reply on my last comment!

    Regards,

    Mahendra Rana

  • Hi,

    1) As stated earlier, I don't believe this approach will solve your problem regardless of the behavior you are seeing. That being said, if you want to dig into why you are seeing an STA_REMOVED event when using the mobile device, you can take NWP logs as described in section 20.1 in the NWP programmer's guide.

    2) There may be a workaround on the mobile device side, but this is not a use-case we specifically support with the CC31xx today.

    3) You can disable the internal DHCP server and implement your own on top of the networking stack with the behavior your desire.

    4) What is your host in the system? I assume you would like to keep the TCP/IP stack built into the Wi-Fi device?

    Thanks,

    Ben M

  • Hi Ben,

    1) Whats changes we need to do for disabling internal DHCP server.

        Is it by just calling this API will stop internal DHCP server and then will start our own while configure CC3120MOD in AP mode?

        Status = sl_NetAppStop(SL_NETAPP_DHCP_SERVER_ID);  // Stop DHCP server before settings

    2) In our application we have provision of to connect maximum one client at a time with AP so can you suggest any example code code of own DHCP server in which we will modify just to not lease default gateway.

    3) Are your asking of host MCU? We are using STM32 host MCU and in our application CC3120MOD will be a MODBUS TCP/IP server.

    waiting for your comment...

    Thanks,

    Mahendra Rana

  • Hi Mahendra,

    Yes, that API call should stop the DHCP server in AP mode. Alternatively, you could configure the setting through ImageCreator Advanced Settings.

    I don't have a specific reference that has been tested or is officially supported on a CC32xx. However, you could use the NDK DHCP server implementation as a reference to do this.

    https://www.ti.com/tool/NDKTCPIP

    For (3), you are referring to the server your CC3120 will connect to right? I was checking to see if you require the TCP/IP stack used by your system to run within the CC3120 as it typically does. I assume this is still the case.

    Best Regards,

    Ben M