Git Product home page Git Product logo

Comments (5)

ftylitak avatar ftylitak commented on June 27, 2024 2

A very rough workaround is to comment out all the following lines:

if (connect_ret == -1)
{
int sockErr = get_socket_errno(sock);
if (sockErr != EINPROGRESS)
{
/* Codes_SRS_SOCKET_ASYNC_30_022: [ If socket connection fails, socket_async_create shall log an error and return SOCKET_ASYNC_INVALID_SOCKET. ]*/
LogError("Socket connect failed, not EINPROGRESS: %d", sockErr);
result = SOCKET_ASYNC_INVALID_SOCKET;
}
else
{
// This is the normally expected code path for our non-blocking socket
/* Codes_SRS_SOCKET_ASYNC_30_018: [ On success, socket_async_create shall return the created and configured SOCKET_ASYNC_HANDLE. ]*/
result = sock;
}
}
else
{
/* Codes_SRS_SOCKET_ASYNC_30_018: [ On success, socket_async_create shall return the created and configured SOCKET_ASYNC_HANDLE. ]*/
// This result would be a surprise because a non-blocking socket
// returns EINPROGRESS. But it could happen if this thread got
// blocked for a while by the system while the handshake proceeded,
// or for a UDP socket.
result = sock;
}

and replace them by:

result = sock;

May be it is a timing issue. Sounds bad not to check for the socket connect return code...though it works for me with esp-idf v4.4.

from esp32_azureiot_arduino.

cyberwaelder1 avatar cyberwaelder1 commented on June 27, 2024

hello, is there a solution? I have the same problem.

from esp32_azureiot_arduino.

ftylitak avatar ftylitak commented on June 27, 2024

Even though this is quite old, just for future reference, this issue is caused because you try to use this library with esp-idf 4.x which is not supported based on my tests (or ESP32 Arduino 2.x).

Switch back to esp-idf 3.x (3.3.6 is the newest at the time of writing).

If you are using Arduino code and Arduino IDE, you need to go to the Boards Manager and downgrade esp32 support to maximum version 1.0.6.

from esp32_azureiot_arduino.

ftylitak avatar ftylitak commented on June 27, 2024

FYI: at some point I changed all the backend of this project with an updated version of az_iot based on https://github.com/Azure/azure-iot-sdk-c (commit: cb8ef0535ebd06f81231be4c40b372ef17cd995e)

Just in case someone is blocked and it can help.

https://github.com/insighio/ESP32_AzureIoT_Arduino

from esp32_azureiot_arduino.

ttrichar avatar ttrichar commented on June 27, 2024

A very rough workaround is to comment out all the following lines:

if (connect_ret == -1)
{
int sockErr = get_socket_errno(sock);
if (sockErr != EINPROGRESS)
{
/* Codes_SRS_SOCKET_ASYNC_30_022: [ If socket connection fails, socket_async_create shall log an error and return SOCKET_ASYNC_INVALID_SOCKET. ]*/
LogError("Socket connect failed, not EINPROGRESS: %d", sockErr);
result = SOCKET_ASYNC_INVALID_SOCKET;
}
else
{
// This is the normally expected code path for our non-blocking socket
/* Codes_SRS_SOCKET_ASYNC_30_018: [ On success, socket_async_create shall return the created and configured SOCKET_ASYNC_HANDLE. ]*/
result = sock;
}
}
else
{
/* Codes_SRS_SOCKET_ASYNC_30_018: [ On success, socket_async_create shall return the created and configured SOCKET_ASYNC_HANDLE. ]*/
// This result would be a surprise because a non-blocking socket
// returns EINPROGRESS. But it could happen if this thread got
// blocked for a while by the system while the handshake proceeded,
// or for a UDP socket.
result = sock;
}

and replace them by:

result = sock;

May be it is a timing issue. Sounds bad not to check for the socket connect return code...though it works for me with esp-idf v4.4.

This worked for me, thank you!

from esp32_azureiot_arduino.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.