• On ESP32 call of socket(AF_INET,.....) returns a socket ID + an offset(named LWIP_SOCKET_OFFSET)
    This results in an error message during check of socket against maxsize (32)

    Is there any limitation inside Espruino for socket ID, except this assert, for range of sockets ?
    With other words, is this socket ID used somewhere in Espruino, for example as a pointer to an array ?

  • @JumJum
    Please can you link to github source so there is some reference.

    The first socket does start at zero I would have thought. The inbuilt telnet server I would expect will be using the first socket.

  • The number of sockets is set in the sdkconfig file (menuconfig)
    One of the last changes was an increase from 4 to 10:

    https://github.com/espruino/EspruinoBuil­dTools/commit/a2c57ff7505bd89b1e72eb69ff­a6b69df4340166#diff-95855eaea0c4f55f2862­ca738bed5fa9R243

    esp32/build/app/sdkconfig

    -CONFIG_LWIP_MAX_SOCKETS=4
     +CONFIG_LWIP_MAX_SOCKETS=10
    

    I'm not sure where the 32 you refer to comes from?

    Are you running out of sockets?

  • in libs/network/network.c, line 671
    For ESP32 just got an answer from ESP_Angus here https://esp32.com/viewtopic.php?f=13&t=3­941
    Before doing changes in network.c, I would like to get a feedback from Gordon.
    We could add an #if USE_ESP32 and have a 2nd ASSERT for ESP32 only

  • This check was in there because we used to keep track of which sockets had TLS with bits inside a 32 bit integer (using BITFIELD_SET). I'm pretty sure that's all been removed now we pass socketType through, so these checks could be taken out? I don't believe there's any reason to restrict the value of the socket handle at all now.

  • @wilberforce,
    could you please create a list of all changes to sdkconfig, you did for ESP32 ?
    It would help to stay on same track as you are during implementation of bluetooth
    I would then add this to ESP32-docu on github
    @gordon, wilberforce, removed the assert for testing. At least Espruino now starts without problems and BLE is running. Some more testing needs to be done, but there is light ....

  • Hi @JumJum

    The ask config are documented as part of the guild tools here:

    https://github.com/espruino/EspruinoBuil­dTools/blob/master/esp32/build/app/sdkco­nfig

  • Hello @Wilberforce
    Tried to compare your sdkConfig with actual and found tons of differences.
    Most of them are new to or replaced in V3
    There are some left, which could have been changed by you.
    Could you please check this list, and mark those, which are changed by you
    I would recommend, we build a sdkconfig.default for Espruino. This would make it easy to follow changes in esp-idf

    CONFIG_ESPTOOLPY_COMPRESSED=y
    CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=y
    CONFIG_ESP32_ENABLE_COREDUMP=y
    CONFIG_ESP32_CORE_DUMP_UART_DELAY=0
    CONFIG_ESP32_CORE_DUMP_LOG_LEVEL=1
    CONFIG_ESP32_APPTRACE_DEST_NONE=y
    CONFIG_NEWLIB_STDOUT_ADDCR=y
    # CONFIG_INT_WDT=
    CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=0
    CONFIG_WIFI_ENABLED=y
    CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=­0
    CONFIG_FATFS_CODEPAGE_ASCII=y
    CONFIG_FATFS_CODEPAGE=1
    CONFIG_FATFS_MAX_LFN=255
    CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTIN­UE=y
    CONFIG_FREERTOS_BREAK_ON_SCHEDULER_START­_JTAG=y
    CONFIG_LWIP_MAX_SOCKETS=10
    CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX=0­
    CONFIG_LWIP_SO_RCVBUF=y
    CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
    CONFIG_TCPIP_TASK_STACK_SIZE=2560
    CONFIG_MBEDTLS_HARDWARE_SHA=y
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

socket ID returned from socket(AF_INET, ....) in ESP32 does not start at 0

Posted by Avatar for JumJum @JumJum

Actions