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

Compilation error: 'esp_netif_next_unsafe' was not declared in this scope #34

Open
PaulSchulz opened this issue Oct 14, 2024 · 3 comments

Comments

@PaulSchulz
Copy link

Greetings, I got the compilation error when trying to compile the Esp32_oscilloscope code for a Heltec Wifi Kit 32 V3.
(This is an ESP32S3 board, without any PSRAM)

The code successfully builds and installs on the following:

  • Lilygo T-Display (T Display PiICOC3) (ESP32C3); and an
  • M5ATOM Echo (ESP-PICO-D4)

Using Arduino IDE v2 (arduino-ide_2.3.3_Linux_64bit.AppImage) on Ubuntu 24.04

In file included from /home/paul/Documents/git/Esp32_oscilloscope/servers/time_functions.h:31,
                 from /home/paul/Documents/git/Esp32_oscilloscope/Esp32_servers_config.h:91,
                 from /home/paul/Documents/git/Esp32_oscilloscope/Esp32_oscilloscope.ino:27:
/home/paul/Documents/git/Esp32_oscilloscope/servers/netwk.h: In function 'void startWiFi()':
/home/paul/Documents/git/Esp32_oscilloscope/servers/netwk.h:791:30: error: 'esp_netif_next_unsafe' was not declared in this scope
         esp_netif_t *netif = esp_netif_next_unsafe (NULL);
                              ^~~~~~~~~~~~~~~~~~~~~
/home/paul/Documents/git/Esp32_oscilloscope/servers/netwk.h:791:30: note: suggested alternative: 'esp_netif_next'
         esp_netif_t *netif = esp_netif_next_unsafe (NULL);
                              ^~~~~~~~~~~~~~~~~~~~~
                              esp_netif_next
In file included from /home/paul/Documents/git/Esp32_oscilloscope/Esp32_servers_config.h:106,
                 from /home/paul/Documents/git/Esp32_oscilloscope/Esp32_oscilloscope.ino:27:
/home/paul/Documents/git/Esp32_oscilloscope/servers/oscilloscope.h: At global scope:
/home/paul/Documents/git/Esp32_oscilloscope/servers/oscilloscope.h:66:25: note: #pragma message: Oscilloscope will use I2S interface (for monitoring a single analog signal) and adc1_get_raw (for monitoring double analog signals).
         #pragma message "Oscilloscope will use I2S interface (for monitoring a single analog signal) and adc1_get_raw (for monitoring double analog signals)."
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/paul/Documents/git/Esp32_oscilloscope/Esp32_servers_config.h:106,
                 from /home/paul/Documents/git/Esp32_oscilloscope/Esp32_oscilloscope.ino:27:
/home/paul/Documents/git/Esp32_oscilloscope/servers/oscilloscope.h: In function 'void oscReader_analog_1_signal_i2s(void*)':
/home/paul/Documents/git/Esp32_oscilloscope/servers/oscilloscope.h:891:75: error: 'I2S_MODE_ADC_BUILT_IN' was not declared in this scope
                     .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN),
                                                                           ^~~~~~~~~~~~~~~~~~~~~
/home/paul/Documents/git/Esp32_oscilloscope/servers/oscilloscope.h:920:23: error: 'i2s_set_adc_mode' was not declared in this scope
                 err = i2s_set_adc_mode (ADC_UNIT_1, adcchannel1);
                       ^~~~~~~~~~~~~~~~
/home/paul/Documents/git/Esp32_oscilloscope/servers/oscilloscope.h:920:23: note: suggested alternative: 'i2s_set_clk'
                 err = i2s_set_adc_mode (ADC_UNIT_1, adcchannel1);
                       ^~~~~~~~~~~~~~~~
                       i2s_set_clk

exit status 1

Compilation error: 'esp_netif_next_unsafe' was not declared in this scope
@BojanJurca
Copy link
Owner

Hello,

'esp_netif_next_unsafe' problem (with some boards) has been solved here: #31. So please, just replace 'esp_netif_next_unsafe' with 'esp_netif_next' function.

'i2s_set_adc_mode' problem occurs because your board does not have an appropriate I2S interface. Oscilloscope will still run on this board if you comment out the '#define USE_I2S_INTERFACE' line in Esp32_servers_config.h. Single channel analog sampling will not be that fast and accurate though.

@PaulSchulz
Copy link
Author

Is the fix foir #31 going into the main code? (Thank you for letting me know.)

@BojanJurca
Copy link
Owner

BojanJurca commented Oct 19, 2024

esp_netif_next will be used in the next release.

According to ESP-IDF Programming Guide (https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_netif.html) esp_netif_next is deprecated and Espressif suggests using a faser function esp_netif_next_unsafe. But there are some boards where esp_netif_next_unsafe is not supported. I haven't come across a board where esp_netif_next would not be supported though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants