Forums - socket creation error

5 posts / 0 new
Last post
socket creation error
ssmailaccount
Join Date: 25 Dec 19
Posts: 3
Posted: Tue, 2020-02-11 04:58

Hi.

I'm trying to create socket client on QCA4020 device, 

the steps I follow:

  1. enable Wlan
  2. connect to router
  3. get IP from DHCP server

then after dhcp callback called, my attempt to call -> qapi_socket(AF_INET, SOCK_STREAM, 0) 

returns -1, so I cannot create a socket. 

Is there anything that I missed to initialize before creating socket?

Thanks.

  • Up0
  • Down0
Re: socket creation error Best Answer
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2020-02-11 09:56

Can you provide us your console log to verify the issue ?
Also, can you confirm if the same behaviour is seen with QCLI_demo when following the above mentioned steps ?

 wlan enable
 wlan setdevice 1
 wlan SetWpaPassphrase password
 wlan SetWpaParameters WPA2 CCMP CCMP
 wlan connect SSID

net dhcpv4c wlan1

net benchrx tcp 2390

  • Up0
  • Down0
ssmailaccount
Join Date: 25 Dec 19
Posts: 3
Posted: Thu, 2020-02-13 01:31

Thank you for reply.

I have corrected my code so it works without issues.

I will post a part of code later, maybe it will be useful for others.

  • Up0
  • Down0
drglennwolfe
Join Date: 23 Sep 19
Posts: 9
Posted: Thu, 2021-04-08 13:49

I am also seeing the same problem where qapi_socket returns -1.  I am connected to an AP and have acquired an IP Address.  My project is not based on the QCLI_demo code.  It is a project that I spun up based on the Hello_World demo to eliminate all of the unnecessary code in the demo project.  Any info would be greatly appreciated.

 

Thanks,

Dr. Wolfe

  • Up0
  • Down0
drglennwolfe
Join Date: 23 Sep 19
Posts: 9
Posted: Mon, 2021-05-17 08:03

This seems to be a bug in sdk v3.4.  Code that works in v3.3 does not work in v3.4.

 

Regards,

Glenn

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.