Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.0 version Migration related issues #8796

Open
VojtechBartoska opened this issue Oct 23, 2023 · 183 comments
Open

3.0.0 version Migration related issues #8796

VojtechBartoska opened this issue Oct 23, 2023 · 183 comments
Labels
3.0 migration issue relates to migration from 2.X to 3.X version
Milestone

Comments

@VojtechBartoska
Copy link
Collaborator

VojtechBartoska commented Oct 23, 2023

Hello,

purpose of this issue is to cover problems related to migration from 2.X (at the moment of writing the latest version is 2.0.14) to 3.X version.

💥 If you have any problems, please add comment to this issue. 💥

3.0.0 version introduces breaking changes in those APIs:

  • ADC
  • BLE
  • Hall Sensor
  • I2S
  • LEDC
  • RMT
  • SigmaDelta
  • TIMER
  • UART
  • WiFi

🎉 For more details plese take a look on MIGRATION GUIDE FROM 2.X TO 3.X. 🎉


List of all related issues: (will be updated)

Please take a look on those issue before adding comment to this ticket.

@VojtechBartoska VojtechBartoska added the 3.0 migration issue relates to migration from 2.X to 3.X version label Oct 23, 2023
@VojtechBartoska VojtechBartoska pinned this issue Oct 23, 2023
@VojtechBartoska VojtechBartoska changed the title 3.0.0 version Migration Related issues 3.0.0 version Migration related issues Oct 23, 2023
@TD-er
Copy link
Contributor

TD-er commented Oct 23, 2023

I think this is also related: #8774

@everslick
Copy link
Contributor

everslick commented Oct 27, 2023

The OneWire lib does not compile anymore, because GPIO is not defined.

libs/OneWire/OneWire.h:167:17: error: 'GPIO' was not declared in this scope; did you mean 'PI'?
  167 |         return (GPIO.in >> pin) & 0x1;
      |                 ^~~~
      |                 PI

This can be fixed by including:

#if ESP_ARDUINO_VERSION_MAJOR >= 3
#include <driver/gpio.h>
#include <hal/rtc_io_ll.h>
#else
#include <driver/rtc_io.h>
#endif

And then using the functions:

rtcio_ll_get_level, rtcio_ll_set_level, rtcio_ll_input_enable and rtcio_ll_output_enable

where appropriate.

Real fix is:

#if ESP_ARDUINO_VERSION_MAJOR >= 3
#include <soc/gpio_struct.h>
#else
#include <driver/rtc_io.h>
#endif

@me-no-dev
Copy link
Member

The OneWire lib does not compile anymore, because GPIO is not defined.

Probably needs particular include. Some have changed in IDF5

@everslick
Copy link
Contributor

I have difficulty porting the following code to IDF5. Please look at the line below FIXME! HELP NEEDED!.

error: cannot convert 'wifi_interface_t' to 'esp_netif_t*' {aka 'esp_netif_obj*'}
  esp_netif_get_ip_info(WIFI_IF_AP, &info);

Snippet:

#ifdef ESP32
#ifdef IDF5
  typedef esp_netif_ip_info_t ip_info_t;
#else
  typedef tcpip_adapter_ip_info_t ip_info_t;
#endif
#endif
#ifdef ESP8266
  typedef struct ip_info ip_info_t;
#endif

static ip_info_t ap_ip_info(void) {
  ip_info_t info = { 0 };

#ifdef ESP32
#ifdef IDF5
  // FIXME! HELP NEEDED!
  // esp_netif_get_ip_info(WIFI_IF_AP, &info);
#else // !IDF5
  tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &info);
#endif // !IDF5
#endif // ESP32

#ifdef ESP8266
  wifi_get_ip_info(SOFTAP_IF, &info);
#endif

  return (info);
}

Are wifi_interface_t and esp_netif_t incompatible types or can I just take the address of the former and cast it to the latter?

@lbernstone
Copy link
Contributor

@everslick https://github.com/espressif/esp-idf/blob/v5.1/examples/protocols/http_server/captive_portal/main/dns_server.c#L152

@everslick
Copy link
Contributor

everslick commented Oct 29, 2023

One VERY peculiar thing I just witnessed: Calling yield() in a very tight loop seems to crash with exception 29 (LoadProhibited), while PC points to a few lines above the call to yield() which makes it especially difficult to debug. Luckily I have yield() wrapped in my own system_yield() so I can switch codepaths between versions (and work around the bug). Like:

void system_yield(void) {
#ifdef IDF5
  delay(1);
#else
  yield();
#endif

#ifdef HAVE_WATCHDOG
  watchdog_feed();
#endif
}

When the tight loop, yield() is called in, gets slowed down enough (with e.g. debug prints) it does not crash.

@me-no-dev
Copy link
Member

@everslick I am rewriting/restructuring the whole network stack in order to decouple WiFi from the rest of the network functions. Many things have changed and will be fixed/rewritten to work. Some APIs will change/get deprecated, but it's for the better.

@everslick
Copy link
Contributor

@everslick I am rewriting/restructuring the whole network stack in order to decouple WiFi from the rest of the network functions. Many things have changed and will be fixed/rewritten to work. Some APIs will change/get deprecated, but it's for the better.

Yes, I've seen the issue for it. I'm very much looking forward to it!

While we are at it. One of the things I do not really like about the Arduino API is the omnipresent instantiation of singleton like APIs. We have NO_GLOBAL_INSTANCES for that, but this is not always implemented for all interfaces. In case of WiFi, it is so baked in, that nothing works anymore if the global WiFi object is not there. Maybe, if possible, this is something to consider, when reworking the API.

@me-no-dev
Copy link
Member

WiFi would be able to not be global, but beware a new Network class will be, though it's very light and has only events and dns queries.

@Jason2866
Copy link
Collaborator

Jason2866 commented Oct 31, 2023

@me-no-dev Are you going to implement IPv6 with the rework of the network / wifi part?
Nice to have a working DNS when Ethernet and WiFi is used together in the future;-)

@me-no-dev
Copy link
Member

@Jason2866 IPv6 is planned for 3.0.0/1 it's coming for sure :)

@kapyaar
Copy link

kapyaar commented Jan 2, 2024

Not sure if this belongs here, w5500+ETH using latest git version, installed manually on windows 11. Running Example ETH_W5500_Arduino_SPI. I have two boards, very possible they have two different versions of W5500. One works fine, but one gives the following very randomly.

E (127) w5500.mac: W5500 version mismatched, expected 0x04, got 0xfe
E (128) w5500.mac: emac_w5500_init(795): vefiry chip ID failed
E (128) esp_eth: esp_eth_driver_install(228): init mac failed
E (3033) w5500.mac: w5500_send_command(204): send command timeout
E (3033) w5500.mac: emac_w5500_receive(675): issue RECV command failed
E (3034) w5500.mac: frame read from module failed
E (4139) w5500.mac: w5500_send_command(204): send command timeout
E (4139) w5500.mac: emac_w5500_receive(675): issue RECV command failed
E (4140) w5500.mac: frame read from module failed
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x00380038  PS      : 0x00060930  A0      : 0x00000000  A1      : 0x3ffb5140  
A2      : 0x3ffb4960  A3      : 0x00380038  A4      : 0x40110378  A5      : 0x3ffb5ac4  
A6      : 0x000005f2  A7      : 0x00000000  A8      : 0x80110778  A9      : 0x3ffb5100  
A10     : 0x3ffb59d0  A11     : 0x3ffb5ac4  A12     : 0x0000fffc  A13     : 0x0000fffc  
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x0000001c  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00380038  LBEG    : 0x40089948  LEND    : 0x4008995e  LCOUNT  : 0xffffffff  

Backtrace: 0x00380035:0x3ffb5140
ELF file SHA256: 2dd9d9d7fcebe907

Rebooting...
ets Jun  8 2016 00:22:57

If I repower the board, Sometimes it starts working. Other times, it may give a different set of error messages, like this one.

rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1256
load:0x40078000,len:13832
load:0x40080400,len:4
load:0x40080404,len:3048
entry 0x40080590
E (127) w5500.mac: w5500_reset(302): reset timeout
E (128) w5500.mac: emac_w5500_init(793): reset w5500 failed
E (128) esp_eth: esp_eth_driver_install(228): init mac failed
E (3033) w5500.mac: w5500_send_command(204): send command timeout
E (3033) w5500.mac: emac_w5500_receive(675): issue RECV command failed
E (3034) w5500.mac: frame read from module failed
E (4139) w5500.mac: w5500_send_command(204): send command timeout
E (4139) w5500.mac: emac_w5500_receive(675): issue RECV command failed
E (4140) w5500.mac: frame read from module failed
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x00380038  PS      : 0x00060930  A0      : 0x00000000  A1      : 0x3ffb5140  
A2      : 0x3ffb4960  A3      : 0x00380038  A4      : 0x40110378  A5      : 0x3ffb5ac4  
A6      : 0x000005f2  A7      : 0x00000000  A8      : 0x80110778  A9      : 0x3ffb5100  
A10     : 0x3ffb59d0  A11     : 0x3ffb5ac4  A12     : 0x0000fffd  A13     : 0x0000fffd  
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x0000001c  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00380038  LBEG    : 0x40089948  LEND    : 0x4008995e  LCOUNT  : 0xffffffff  

Backtrace: 0x00380035:0x3ffb5140
ELF file SHA256: 2dd9d9d7fcebe907

Rebooting...
ets Jun  8 2016 00:22:57

And when it works, it connects and works fine, goes like this.

ETH Started
ETH Connected
ETH Got IP: 'eth0'
eth0: <UP,100M,FULL_DUPLEX,AUTO>
      ether 36:AB:95:6B:07:90 phy 0x1
      inet 192.168.2.30 netmask 255.255.255.0 broadcast 192.168.2.255
      gateway 192.168.2.1 dns 192.168.2.1

1
connecting to arduino.tips
HTTP/1.1 200 OK
Date: Tue, 02 Jan 2024 18:41:16 GMT....

And the rest of the contents are printed from /asciilogo.txt. I use wificlientsecure to do https.

Does espressif/esp-idf#11331 has any bearing on this?

@me-no-dev
Copy link
Member

@kostaond could you please comment on @kapyaar issue? Here the "bad" version is 0xFE

@kostaond
Copy link

kostaond commented Jan 4, 2024

@kapyaar how is the W5500 to the ESP32? Is it custom board or is it connected via wires? It seems to me like some SPI connection issue. You can also try to decrease SPI CLK frequency to see if it helps.

@kapyaar
Copy link

kapyaar commented Jan 5, 2024

@kostaond @me-no-dev Board is good, it is an assembled pcb, but the issue is totally on our side. This ETH section is part of a larger board, and the new version had a few additional SPI chips, CS of one of those chips was floating, likely responding to requests meant for W5500. Took me a while to think outside my section of the board, Fixed that part, and the ETH part works consistently. Really sorry. I have an ETH question, but unrelated to this. To keep this thread clean, let me know if you want me to delete my post and comment, I will be happy to do that.

@kostaond
Copy link

kostaond commented Jan 5, 2024

@kapyaar if you have Ethernet related question, please ask at forum.

@TD-er
Copy link
Contributor

TD-er commented Jan 5, 2024

@kapyaar
One tip for designing your board with Ethernet.
Please include a ferrite bead in the power line to the ETH power and make sure you only have a single point where GND of Ethernet and the rest is connected.
In my own designs I used a beefy 0 Ohm resistor (0805 or 1206) to connect both grounds.

You can have a look at the schematics provided by Olimex to get inspiration on how to implement the power nets when using Ethernet.
N.B. this is regardless of the used Ethernet chip as this is just typical for all Ethernet modules/chips.

@TD-er
Copy link
Contributor

TD-er commented Jan 6, 2024

Found another issue, where the DHCP service doesn't seem to work when starting softAP.
See: #9069

@everslick
Copy link
Contributor

everslick commented Jan 6, 2024

I2C HAL fails to compile if HAL LOCKS are disabled. this has been fixed.
See: #9073

@luc-github
Copy link
Contributor

luc-github commented Feb 18, 2024

Hello in latest git / 3.0.0 alpha I cannot find the API equivalent API of

/**
 * @brief Compatible version of former tcpip_adapter API of esp_netif_get_sta_list
*/
esp_err_t tcpip_adapter_get_sta_list(const wifi_sta_list_t *wifi_sta_list, tcpip_adapter_sta_list_t *tcpip_sta_list);

to get IP of connected clients

It seems now a component in IDF :
https://github.com/espressif/esp-idf/blob/release/v5.1/components/esp_wifi/include/esp_wifi_ap_get_sta_list.h

But cannot find it in latest arduino-esp32 git

Will this API be ported / available in esp32-arduino for final 3.0.0 ?

@me-no-dev
Copy link
Member

@luc-github no. IDF 5.x has many changes since 4.x. There should be something else that would work the same way though

@luc-github
Copy link
Contributor

so you mean esp_err_t esp_wifi_ap_get_sta_list_with_ip(const wifi_sta_list_t *wifi_sta_list, wifi_sta_mac_ip_list_t *wifi_sta_ip_mac_list); I linked ?
but I cannot find it in latest git, so it is may be a miss ?

@VojtechBartoska VojtechBartoska added this to the 3.0.0 milestone Feb 20, 2024
@me-no-dev
Copy link
Member

@Jason2866 so let's give one final config on how to use 3.0.0 with PIO

[env:arduino-3]
platform = espressif32
platform_packages=
  platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0
  platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip

Is that it?

@mathieucarbou
Copy link
Contributor

@Jason2866 so let's give one final config on how to use 3.0.0 with PIO

[env:arduino-3]
platform = espressif32
platform_packages=
  platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0
  platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip

Is that it?

Yes I've updated all my Arduino projects on PIO with that and the CI pass :-)

@Jason2866
Copy link
Collaborator

Yep, that's the way.

@illusionmanager
Copy link

my program uses the ESPAsyncWebSrv by dvarrel version 1.2.7 It compiled great under version 2.0.17 but fails with version 3.0.0.
The error is
c:\Users\frans\Documents\Arduino\libraries\ESPAsyncWebSrv\src\WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)':
c:\Users\frans\Documents\Arduino\libraries\ESPAsyncWebSrv\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?
74 | mbedtls_md5_starts_ret(&_ctx);

Is something wrong with the md5 libraries? (I'm using an esp32c3 board)

@mathieucarbou
Copy link
Contributor

my program uses the ESPAsyncWebSrv by dvarrel version 1.2.7 It compiled great under version 2.0.17 but fails with version 3.0.0. The error is c:\Users\frans\Documents\Arduino\libraries\ESPAsyncWebSrv\src\WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)': c:\Users\frans\Documents\Arduino\libraries\ESPAsyncWebSrv\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'? 74 | mbedtls_md5_starts_ret(&_ctx);

Is something wrong with the md5 libraries? (I'm using an esp32c3 board)

A lot of libraries are still not ready. FYI if it can help, I am maintaining a fork of ESPAsyncWebServer (and its dependencies), which is compatible with Arduino 3 already since a while. This fork is already used in many projects like OpenDTU, ESP-Dash, ElegantOTA, Beelance, YaSolR, MycilaESPConnect, ClusterDuck Protocol, etc.

@illusionmanager
Copy link

illusionmanager commented May 28, 2024

A lot of libraries are still not ready. FYI if it can help, I am maintaining a fork of ESPAsyncWebServer (and its dependencies), which is compatible with Arduino 3 already since a while. This fork is already used in many projects like OpenDTU, ESP-Dash, ElegantOTA, Beelance, YaSolR, MycilaESPConnect, ClusterDuck Protocol, etc.

How do I use your version? I can't find it in the library manager of the arduine IDE. Probably just copy it from github and put it somewhere? but where?

@mathieucarbou
Copy link
Contributor

mathieucarbou commented May 28, 2024

How do I use your version? I can't find it in the library manager of the arduine IDE. Probably just copy it from github and put it somewhere? but where?

I have learnt to never rely on Arduino's library manager because the identifier they use is the library name and it causes some conflicts.

For this lib for example, @me-no-dev is the original author. But if you look in the list here you will see some 2.x versions coming from the fork I maintain (where I've kept the orignal author), but a guy decided to fork the ESPHome fork (what a hell), change to version 3.x and also change the author to his pseudo and deploy his package on top of it. So now everything is screwed up because people depending on ESPAsyncWebServer on Arduino will get his fork, which is an old version with still some bugs and it is not compatible with Arduino 3, like the 2.x versions are.

Sadly the way everybody can deploy to the Arduino library manager and screw up things makes it completely unsafe to use.

You better use Platformio instead, or manually download or re-download all the dependencies each time you open a new Arduino project to make sure you have the right library name and version.

@Xylopyrographer
Copy link
Contributor

With Arduino IDE, you can also install libraries manually.
Sketch --> Include Library --> Add .ZIP library...

@mozgy
Copy link

mozgy commented May 28, 2024

Platformio can be blessing and a curse when you use it's [env] settings, it can easily confuse itself when juggling between v2 and v3.
On the ESPAsyncWebServer topic here's my ini part -

lib_deps =
    ESP Async WebServer
    ; https://github.com/me-no-dev/ESPAsyncWebServer.git
    ; https://github.com/dvarrel/ESPAsyncWebSrv.git

you just uncomment one line, ctrl-save and platformio does the rest for you ..

@tutotio
Copy link

tutotio commented May 29, 2024

I have tried this example
https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino
and the ESP32 continually reboots when connecting to network eduroam.

Connecting to network: eduroam
[ 1743][W][STA.cpp:533] disconnect(): STA already disconnected.
[ 1767][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 9 - WIFI_READY
[ 1844][V][STA.cpp:184] _onStaEvent(): STA Started
[ 1848][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 11 - STA_START
[ 1856][D][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 11 - STA_START

assert failed: xQueueReceive queue.c:1475 (( pxQueue ))

@me-no-dev
Copy link
Member

@tutotio looks like that example needs updating. We have a direct method to connect to enterprise networks: https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiSTA.h#L111-L115

@tutotio
Copy link

tutotio commented May 29, 2024

@tutotio looks like that example needs updating. We have a direct method to connect to enterprise networks: https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiSTA.h#L111-L115

thanks for your answer

The example is updated to the new version: esp_eap_client.h, used in the example, has been included in version 3

I have tried the direct method and got the same crash (the ESP32 continually reboots when connecting to network eduroam)

@me-no-dev
Copy link
Member

do you get a backtrace that you can decode?

@tutotio
Copy link

tutotio commented May 29, 2024

do you get a backtrace that you can decode?

I tried this example:
https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiClientEnterprise/WiFiClientEnterprise.ino

Log:

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1448
load:0x40078000,len:14844
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3356
entry 0x4008059c
=========== Before Setup Start ===========
Chip Info:
------------------------------------------
  Model             : ESP32
  Package           : D0WD-Q6
  Revision          : 100
  Cores             : 2
  Frequency         : 240 MHz
  Embedded Flash    : No
  Embedded PSRAM    : No
  2.4GHz WiFi       : Yes
  Classic BT        : Yes
  BT Low Energy     : Yes
  IEEE 802.15.4     : No
------------------------------------------
INTERNAL Memory Info:
------------------------------------------
  Total Size        :   343888 B ( 335.8 KB)
  Free Bytes        :   313324 B ( 306.0 KB)
  Allocated Bytes   :    23468 B (  22.9 KB)
  Minimum Free Bytes:   307808 B ( 300.6 KB)
  Largest Free Block:   110580 B ( 108.0 KB)
------------------------------------------
Flash Info:
------------------------------------------
  Chip Size         :  4194304 B (4 MB)
  Block Size        :    65536 B (  64.0 KB)
  Sector Size       :     4096 B (   4.0 KB)
  Page Size         :      256 B (   0.2 KB)
  Bus Speed         : 80 MHz
  Bus Mode          : QIO
------------------------------------------
Partitions Info:
------------------------------------------
                nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
            otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
               app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
               app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
             spiffs : addr: 0x00290000, size:  1408.0 KB, type: DATA, subtype: SPIFFS
           coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
------------------------------------------
Software Info:
------------------------------------------
  Compile Date/Time : May 28 2024 12:13:56
  Compile Host OS   : windows
  ESP-IDF Version   : v5.1.4-51-g442a798083-dirty
  Arduino Version   : 3.0.0
------------------------------------------
Board Info:
------------------------------------------
  Arduino Board     : ESP32_DEV
  Arduino Variant   : esp32
  Arduino FQBN      : esp32:esp32:esp32:UploadSpeed=921600,CPUFreq=240,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=default,DebugLevel=verbose,PSRAM=disabled,LoopCore=1,EventsCore=1,EraseFlash=none,JTAGAdapter=default,ZigbeeMode=default
============ Before Setup End ============
[   710][V][esp32-hal-uart.c:408] uartBegin(): UART0 baud(115200) Mode(800001c) rxPin(3) txPin(1)
[   719][V][esp32-hal-uart.c:497] uartBegin(): UART0 not installed. Starting installation
[   729][V][esp32-hal-uart.c:544] uartBegin(): UART0 initialization done.

Connecting to network: eduroam
[   754][W][STA.cpp:533] disconnect(): STA already disconnected.
[   778][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 9 - WIFI_READY
[   855][V][STA.cpp:184] _onStaEvent(): STA Started
[   859][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 11 - STA_START
[   867][D][STA.cpp:110] _onStaArduinoEvent(): Arduino STA Event: 11 - STA_START

assert failed: xQueueReceive queue.c:1475 (( pxQueue ))


Backtrace: 0x40082649:0x3ffcd0f0 0x4008bd85:0x3ffcd110 0x4009123e:0x3ffcd130 0x4008c4a7:0x3ffcd260 0x40119241:0x3ffcd2a0 0x40105716:0x3ffcd2c0

ELF file SHA256: df9e818849b24687

Rebooting...

@me-no-dev
Copy link
Member

Now run the backtrace through exception decoder :)

@tutotio
Copy link

tutotio commented May 29, 2024

Now run the backtrace through exception decoder :)

Is this what you need?

0x40082649: panic_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system\panic.c:466
0x4008bd85: esp_system_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/port\esp_system_chip.c:84
0x4009123e: __assert_func at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib\assert.c:81
0x4008c4a7: xQueueReceive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel\queue.c:1479
0x40119241: queue_recv_wrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_wifi/esp32\esp_adapter.c:321
0x40105716: wpa2_task at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/wpa_supplicant/esp_supplicant/src\esp_eap_client.c:208

@tutotio
Copy link

tutotio commented May 29, 2024

With the first example:
https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino

i got the same backtrace:

0x40082b49: panic_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system\panic.c:466
0x4008df25: esp_system_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/port\esp_system_chip.c:84
0x4009350a: __assert_func at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib\assert.c:81
0x4008e647: xQueueReceive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel\queue.c:1479
0x40123bb9: queue_recv_wrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_wifi/esp32\esp_adapter.c:321
0x40111072: wpa2_task at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/wpa_supplicant/esp_supplicant/src\esp_eap_client.c:208

@me-no-dev
Copy link
Member

please list the exact call you make to WiFi.begin(). You should not get this error. I traced the code and it should work ok

@tutotio
Copy link

tutotio commented May 29, 2024

Both examples brakes without do any modification. It doesn't matter if you put a good or bad identity or password, it always breaks:

https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiClientEnterprise/WiFiClientEnterprise.ino
https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino

It breaks if you are under wifi eduroam coberture. If eduroam wifi is not available or you change the ssid to a non existant ssid
const char *ssid = "eduro";

you got an error, but it don't brake and reboot:
[W][STA.cpp:135] _onStaArduinoEvent(): Reason: 201 - NO_AP_FOUND

@me-no-dev
Copy link
Member

@tutotio please open an issue so we can further look into it. Post all relevant info there

@ctodor
Copy link

ctodor commented May 29, 2024

Hi guys,
I'm trying to build an "empty" sketch using PlatformIO.

these are the dependencies

Resolving arduino_nano_esp32-30 dependencies...
Platform espressif32 @ 6.7.0 (required: espressif32)
├── framework-arduinoespressif32 @ 3.0.0+sha.b3ad98c (required: git+https://github.com/espressif/arduino-esp32.git#3.0.0)
├── framework-arduinoespressif32-libs @ 5.1.0+sha.442a798083 (required: https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip)
├── tool-dfuutil-arduino @ 1.11.0 (required: platformio/tool-dfuutil-arduino @ ~1.11.0)
├── tool-esptoolpy @ 1.40501.0 (required: platformio/tool-esptoolpy @ ~1.40501.0)
├── toolchain-riscv32-esp @ 12.2.0+20230208 (required: espressif/toolchain-riscv32-esp @ 12.2.0+20230208)
└── toolchain-xtensa-esp32s3 @ 12.2.0+20230208 (required: espressif/toolchain-xtensa-esp32s3 @ 12.2.0+20230208)

this is the content of platformio.ini

[env:arduino_nano_esp32-30]
platform = espressif32
platform_packages =
platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0
platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip
board = arduino_nano_esp32
framework = arduino

and here the link error:

Linking .pio\build\arduino_nano_esp32-30\firmware.elf
c:/users/myuser/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: .pio/build/arduino_nano_esp32-30/FrameworkArduinoVariant/dfu_callbacks.cpp.o:(.literal._ZN12_GLOBAL__N_110MD5Builder8getCharsEPc+0x0): undefined reference to (anonymous namespace)::HEXBuilder::bytes2hex(char*, unsigned int, unsigned char const*, unsigned int)' c:/users/myuser/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: .pio/build/arduino_nano_esp32-30/FrameworkArduinoVariant/dfu_callbacks.cpp.o:(.literal._ZN12_GLOBAL__N_110MD5Builder12addHexStringEPKc+0x0): undefined reference to (anonymous namespace)::HEXBuilder::hex2bytes(unsigned char*, unsigned int, char const*)'
c:/users/myuser/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: .pio/build/arduino_nano_esp32-30/FrameworkArduinoVariant/dfu_callbacks.cpp.o: in function (anonymous namespace)::MD5Builder::getChars(char*)': C:/Users/myuser/.platformio/packages/framework-arduinoespressif32@src-262fa62c27b81033b57e37f6ab09cbed/cores/esp32/md5builder.cpp:92: undefined reference to (anonymous namespace)::HEXBuilder::bytes2hex(char*, unsigned int, unsigned char const*, unsigned int)'
c:/users/myuser/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: .pio/build/arduino_nano_esp32-30/FrameworkArduinoVariant/dfu_callbacks.cpp.o: in function (anonymous namespace)::MD5Builder::addHexString(char const*)': C:/Users/myuser/.platformio/packages/framework-arduinoespressif32@src-262fa62c27b81033b57e37f6ab09cbed/cores/esp32/md5builder.cpp:39: undefined reference to (anonymous namespace)::HEXBuilder::hex2bytes(unsigned char*, unsigned int, char const*)'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\arduino_nano_esp32-30\firmware.elf] Error 1

@Jason2866
Copy link
Collaborator

@ctodor This issue is not about Platformio setup or problems at all.
Anyways you can try

[env:arduino_nano_esp32-30]
platform = espressif32 @ 6.7.0
platform_packages =
     framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0
     framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip
board = arduino_nano_esp32
framework = arduino

@ctodor
Copy link

ctodor commented May 29, 2024

@ctodor This issue is not about Platformio setup or problems at all. Anyways you can try

[env:arduino_nano_esp32-30]
platform = espressif32 @ 6.7.0
platform_packages =
     framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0
     framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0/esp32-arduino-libs-3.0.0.zip
board = arduino_nano_esp32
framework = arduino

@Jason2866 thx for the answer, but there is no diff. between your example and mine (except you specify platform = espressif32 @ 6.7.0), but if you take a look at the dependencise you will see Platform espressif32 @ 6.7.0 (required: espressif32)

Anyway, removing platform_packages key, everything works fine

@mathieucarbou
Copy link
Contributor

@me-no-dev : FYI found a bug in the new IPAddress implementation, following a bug report in my ESPAsyncWebServer fork, with an updated AsyncTCP which is Ipv6 compatible and also using the new IPAddress(ip_addr_t) construction.
Bug report: #9724
PR: #9725

@Hedda
Copy link

Hedda commented May 31, 2024

FYI, many also want PlatformIO to add Arduino v3.0.0 support for it in platform-espressif32 too, which might never happen now?

There is already an open pull request but PlatformIO is refusing to merge it as they claim that Espressif lack of support is at fault:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 migration issue relates to migration from 2.X to 3.X version
Projects
Status: In Progress
Development

No branches or pull requests