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.

LAUNCHCC3235MOD: sl_Connect returns -111 (ECONREFUSED)

Part Number: LAUNCHCC3235MOD
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG

Hi,

I am trying to connect a CC3235 Launchpad to a BeagleBone Black (BBB) through a socket.  The CC3235 is the client and the BBB is the server.  The BBB is connected by wired Ethernet to a WiFi router.  The CC3235 connects to the router OK,  and I can ping from the CC3235 to the BBB. I used network terminal as the basis of my app,  and left all the console functionality intact.  That is how I ping from the CC3235 to the BBB. 

My cc3235 client application opens a socket then calls sl_Connect to connect to the BBB.  The first call returns -114 (EALREADY) and the next call returns -111 (ECONREFUSED).  Capturing this in Wireshark shows that the CC3235 sends an ARP request (Who has 192.168.1.1?)  then nothing else.

My questions are:

1) Why is the CC3235 arping for the gateway mac address when I call sl_Connect()?

2)  Why is the connect returning ECONREFUSED when the cc3235 never tries to connect to the BBB?

3) What can I do to make sl_Connect() work?

Any insight would be appreciated.

Thanks,

Bill

  • Hi Bill,

    Please provide detail information about your network configuration (network parameters of CC3235 LP, network parameters of BBB, other network information IP address of GW, place where your run Wireshark, IP address of your access point)? By the network parameters I mean IP, get gateway, subnet mask. Drawing of your network setup will be great.

    btw ... are you sure that your network infrastructure is properly configured to be able capture all traffic from CC3235? Do you have set mirroring of all the WLAN communication?

    Jan

  • CC3235:

    ip address 192.168.1.96

    gateway 192.168.1.1

    netmask 255.255.255.0

    BBB:

    ip address 192.168.1.99

    gateway 192.168.1.1

    netmask 255.255.255.0

    Gateway = Netgear R7450

    ip address 192.168.1.1

    I use the hub (not a switch,  a hub) so that I can monitor the communications.  I cannot monitor the WiFI comms,  just the wired comms.

  • Hi Bill,

    You should set your Netgear R7450 into AP mode only (that means disable routing features) and set your PC, BBB and CC3235 as static IP. After that you will be able sniff all network communication from WLAN (CC3235).

    • Error code -111 is a general socket error in case TCP client is not able to open connection (unable to resolve by ARP, refused connection by opposite side, WLAN not connected, etc.).
    • ARP request to GW IP you can expect when is set IP address for connection outside current subnet - please make sure that you have set proper IP to BBB at CC3235 (e.g. not exchanged order of IP address).
    • For first test will be better do connection with your PC first, to make sure that your code at CC235 is correct.

    Jan

  • "You should set your Netgear R7450 into AP mode only "

    That didn't work out very well.  It took down the whole network and I lost access to the router setup pages so I couldn't turn off AP mode.  I had to reset to factory defaults and restore my settings manually after that.  2 more hours lost.

  • Hi,

    Hmmm... Netgear R7450 is based on MediaTek MT7621 and this is pretty bad SoC. And I am not surprised that it does not work properly. As my testing infrastructure I use hardware from Ubiquiti (APs, managed switches) and pfSense router. For advance wireless testing I use TP-link AC1750 with latest OpenWRT. OpenWRT based router is a very good option for any Wifi development.

    I am little bit surprised that you are surprised that after changing to AP mode is router/NAT and DHCP server deactivated. This is expected behaviour at any kind of network hardware which can switch between router/AP mode. Maybe I should have warned you at my previous answer, but I automatically expected that you know this.

    Jan

  • Hi Bill,

    You've  mentioned that you only sees the ARP request, but you should at least see the ICMP/ping (that you mention is working) request and response.

    If ping works than then -111 might happen due to use wrong port (please verify endianness, or you can try 0x5555 as the server port).

    Again you should see at least ARP towards the BBB (192.168.1.99) before the connection to start.  

    Can you ping from BBB to the CC3235?

    br,

    Kobi

  • OK,  I think I've identified a problem.  I'm not sure what causes it or how to fix it,  but here it is...

    All my IP addresses are static.  The C3235 is 192.168.1.96 in my code.  I also set the same address in ImageCreator.  I saw Wireshark complaining about multiple uses of 192.168.1.99,  and when I shut down the BBB and try to ping it from the CC3235 I see in Wireshark that the CC3235 is saying it is 99,  not 96.  

    When I break in network_terminal.c: SimpleLinkNetEventHandler(): case SL_NET_EVENT_IPV4_ACQUIRED I see the IP address it is returning in pEventData->ip is 192.168.1.99.  That should be the node IP address of 192.168.1.96,  shouldn't it?

    Bill

  • Did you change the default DHCP setting to STATIC IP?

    I believe the NetworkTerminal uses the definition from syscfg/Simple WIFI/General/IPV4 config.

    Br,

    Kobi

  • Ah,  yes.  In Sysconfig.  So there are 3 places to set the IP address,  in code,  in UniFlash,  and in Sysconfig.  I'm still not sure which one does what,  it is not explained very well.  Simplelink is many things,  but simple it is not.  If you want to see simple WiFi networking look at the ESP8266.

    Thanks for all the input, folks.

    Bill

  • By the way,  now it is absolutely flooding my network with ARP announcements.  At least it's flooding with the right IP address. :-)

    Bill.