ESP-ADF Board SIP Phone Example Build Issue

Started by ghanand, July 28, 2024, 09:30:10 AM

Previous topic - Next topic

ghanand

Hello Everyone,

I recently bought ESP-ADF board to Use as a SIP Phone.

However, i am not able to build the SIP Sample Application with the current ESP-IDF
and ESP-ADF versions.

I have also tried to build the application with older version of ESP-IDF 3.2 with no
success.

With older version of ESP-IDF i am facing the issue with Python dependancy. Since the
SIP Sample Example use just Python. But, my environemnt has Python3. There is an issue
with building the image.

I have tried to install Ubuntu 16.04 with no success with the Python dependencies.

I want to know which version of Ubuntu and which version of ESP-IDF/ESP-ADF are used
to build successfully the SIP Sample Example.

Please if someone had faced the same issue or know the details, please help me to
resolve this issue.

Thanks & Regards,
Anand

LubOlimex

#1
This is not related to Python. We've used python 3.0. What are the exact errors that you get?

Notice that ESP32-ADF requires specific ADF enviroment, not the general-purpose ESP-IDF environment, and you need to use that specific ADF-only ESP-IDF to compile demos without problems. More specifically "esp-idf" folder should be inside of folder "esp-adf".

If you use the general release ESP-IDF environment you would encounter such discrepancies.

For more info I recommend you to check these forum threads that encountered compilation problems:

https://www.esp32.com/viewtopic.php?t=10607

https://www.esp32.com/viewtopic.php?t=10475

Also make sure to follow the installation instructions at our GitHub for the project.
Technical support and documentation manager at Olimex

ghanand

Hi,

Thanks for the reply. I have followed the link you have provided. I am trying
to build Sip phone Sample from the github repository. I did the steps provided
in the README,md from scratch.

https://github.com/OLIMEX/sip_phone_example/tree/master

However, i am getting the following errors while building the flash image.

CC build/audio_stream/i2s_stream.o
/root/esp-adf/components/audio_stream/i2s_stream.c: In function 'i2s_stream_init':
/root/esp-adf/components/audio_stream/i2s_stream.c:462:9: error: unknown type name 'board_i2s_pin_t'
         board_i2s_pin_t board_i2s_pin = {0};
         ^~~~~~~~~~~~~~~
/root/esp-adf/components/audio_stream/i2s_stream.c:464:44: warning: passing argument 2 of 'get_i2s_pins' from incompatible pointer type [-Wincompatible-pointer-types]
         get_i2s_pins(i2s->config.i2s_port, &board_i2s_pin);
                                            ^~~~~~~~~~~~~~
In file included from /root/esp-adf/components/audio_stream/i2s_stream.c:43:
/root/espwork/sip_phone_example/components/audio_board/include/board_pins_config.h:60:59: note: expected 'i2s_pin_config_t *' {aka 'struct <anonymous> *'} but argument is of type 'int *'
 esp_err_t get_i2s_pins(i2s_port_t port, i2s_pin_config_t *i2s_config);
                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/root/esp-adf/components/audio_stream/i2s_stream.c:465:47: error: request for member 'bck_io_num' in something not a structure or union
         i2s_pin_cfg.bck_io_num = board_i2s_pin.bck_io_num;
                                               ^
/root/esp-adf/components/audio_stream/i2s_stream.c:466:46: error: request for member 'ws_io_num' in something not a structure or union
         i2s_pin_cfg.ws_io_num = board_i2s_pin.ws_io_num;
                                              ^
/root/esp-adf/components/audio_stream/i2s_stream.c:467:49: error: request for member 'data_out_num' in something not a structure or union
         i2s_pin_cfg.data_out_num = board_i2s_pin.data_out_num;
                                                 ^
/root/esp-adf/components/audio_stream/i2s_stream.c:468:48: error: request for member 'data_in_num' in something not a structure or union
         i2s_pin_cfg.data_in_num = board_i2s_pin.data_in_num;
                                                ^
/root/esp-adf/components/audio_stream/i2s_stream.c:472:47: error: request for member 'mck_io_num' in something not a structure or union
         i2s_pin_cfg.mck_io_num = board_i2s_pin.mck_io_num;
                                               ^
make[1]: *** [/root/esp-adf/esp-idf/make/component_wrapper.mk:298: i2s_stream.o] Error 1
make: *** [/root/esp-adf/esp-idf/make/project.mk:649: component-audio_stream-build] Error 2

Could you please let me know where i am doing wrong.
It would be great if you coul provide me a hint or two to solve this problem.

Thanks & Regards,
Anand

ghanand

Hi,

I have solved the above mentioned error messages by missing struct in board_pins_config.h

The following struct was messing

/**
 * @brief                  Board i2s pin definition
 */
typedef struct {
    int mck_io_num;         /*!< MCK pin, output */
    int bck_io_num;         /*!< BCK pin, input in slave role, output in master role */
    int ws_io_num;          /*!< WS pin, input in slave role, output in master role */
    int data_out_num;       /*!< DATA pin, output */
    int data_in_num;        /*!< DATA pin, input */
} board_i2s_pin_t;

But, now when i build i have the following error messages,

/root/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c: In function 'sdcard_mount':
/root/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c:110:28: error: 'ESP_SD_PIN_CMD' undeclared (first use in this function); did you mean 'ESP_RST_PANIC'?
             .mosi_io_num = ESP_SD_PIN_CMD,
                            ^~~~~~~~~~~~~~
                            ESP_RST_PANIC
/root/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c:110:28: note: each undeclared identifier is reported only once for each function it appears in
/root/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c:111:28: error: 'ESP_SD_PIN_D0' undeclared (first use in this function); did you mean 'ESP_RST_INT_WDT'?
             .miso_io_num = ESP_SD_PIN_D0,
                            ^~~~~~~~~~~~~
                            ESP_RST_INT_WDT
/root/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c:112:28: error: 'ESP_SD_PIN_CLK' undeclared (first use in this function); did you mean 'DISP_SPI_CLK'?
             .sclk_io_num = ESP_SD_PIN_CLK,
                            ^~~~~~~~~~~~~~
                            DISP_SPI_CLK
/root/esp-adf/components/esp_peripherals/lib/sdcard/sdcard.c:127:31: error: 'ESP_SD_PIN_D3' undeclared (first use in this function); did you mean 'ESP_RST_INT_WDT'?
         slot_config.gpio_cs = ESP_SD_PIN_D3;
                               ^~~~~~~~~~~~~
                               ESP_RST_INT_WDT
make[1]: *** [/root/esp-adf/esp-idf/make/component_wrapper.mk:298: lib/sdcard/sdcard.o] Error 1
make: *** [/root/esp-adf/esp-idf/make/project.mk:649: component-esp_peripherals-build] Error 2

PLease let me know how to resolve the above error messages, where i should define messing SD Card pin definitions.

Thank you,
Anand

ghanand

Hello,
 
I fixed all the errors during build and succefully generated the image binary.

However, now i can only see the LCD with the UI. Touch panel is not working.

Also, i have following errors in the boot log.

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_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:2
load:0x3fff0030,len:7104
load:0x40078000,len:15520
load:0x40080400,len:3792
entry 0x40080684
I (27) boot: ESP-IDF v4.4.4-278-g3c8bc2213c-dirty 2nd stage bootloader
I (27) boot: compile time 03:09:43
I (28) boot: chip revision: v3.0
I (32) boot.esp32: SPI Speed      : 40MHz
I (37) boot.esp32: SPI Mode       : DIO
I (41) boot.esp32: SPI Flash Size : 4MB
I (46) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (55) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (70) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (77) boot:  2 factory          factory app      00 00 00010000 00200000
I (85) boot: End of partition table
I (89) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2b3cch (177100) map
I (165) esp_image: segment 1: paddr=0003b3f4 vaddr=3ffb0000 size=03434h ( 13364) load
I (171) esp_image: segment 2: paddr=0003e830 vaddr=40080000 size=017e8h (  6120) load
I (174) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=c86cch (820940) map
I (493) esp_image: segment 4: paddr=001086f4 vaddr=400817e8 size=1ab08h (109320) load
I (555) boot: Loaded app from partition at offset 0x10000
I (555) boot: Disabling RNG early entropy source...
I (567) psram: This chip is ESP32-D0WD
I (569) spiram: Found 64MBit SPI RAM device
I (569) spiram: SPI RAM mode: flash 40m sram 40m
I (572) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (579) cpu_start: Pro cpu up.
I (583) cpu_start: Starting app cpu, entry point is 0x40081694
I (0) cpu_start: App cpu up.
I (1474) spiram: SPI SRAM memory test OK
I (1482) cpu_start: Pro cpu start user code
I (1482) cpu_start: cpu freq: 160000000
I (1482) cpu_start: Application information:
I (1485) cpu_start: Project name:     voip_app
I (1491) cpu_start: App version:      a71bb41-dirty
I (1496) cpu_start: Compile time:     Aug  4 2024 03:09:50
I (1502) cpu_start: ELF file SHA256:  fb089a43a42b7513...
I (1508) cpu_start: ESP-IDF:          v4.4.4-278-g3c8bc2213c-dirty
I (1515) cpu_start: Min chip rev:     v0.0
I (1520) cpu_start: Max chip rev:     v3.99
I (1525) cpu_start: Chip rev:         v3.0
I (1530) heap_init: Initializing. RAM available for dynamic allocation:
I (1537) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1543) heap_init: At 3FFCA0E0 len 00015F20 (87 KiB): DRAM
I (1549) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1556) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1562) heap_init: At 4009C2F0 len 00003D10 (15 KiB): IRAM
I (1569) spiram: Adding pool of 4095K of external SPI memory to heap allocator
I (1578) spi_flash: detected chip: generic
I (1581) spi_flash: flash io: dio
I (1587) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1601) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1639) SIP_PHONE: [1.0] Initialize peripherals management
I (1641) SIP_PHONE: [1.2] Initialize and start peripherals
I (1642) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3
I (1650) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3
I (1660) AUDIO_THREAD: The esp_periph task allocate stack on internal memory
I (1668) SIP_PHONE: [1.3] Start and wait for Wi-Fi network
W (1686) PERIPH_TOUCH: _touch_init
I (1699) wifi:wifi driver task: 3ffdc1a8, prio:23, stack:6656, core=0
I (1700) system_api: Base MAC address is not set
I (1700) system_api: read default base MAC address from EFUSE
I (1709) wifi:wifi firmware version: bd1de02
I (1710) wifi:wifi certification version: v7.0
I (1714) wifi:config NVS flash: enabled
I (1718) wifi:config nano formating: disabled
I (1722) wifi:Init data frame dynamic rx buffer num: 32
I (1727) wifi:Init management frame dynamic rx buffer num: 32
I (1732) wifi:Init management short buffer num: 32
I (1737) wifi:Init static tx buffer num: 16
I (1741) wifi:Init tx cache buffer num: 32
I (1745) wifi:Init static rx buffer size: 1600
I (1749) wifi:Init static rx buffer num: 10
I (1752) wifi:Init dynamic rx buffer num: 32
I (1758) wifi_init: rx ba win: 16
I (1760) wifi_init: tcpip mbox: 32
I (1764) wifi_init: udp mbox: 64
I (1768) wifi_init: tcp mbox: 6
I (1772) wifi_init: tcp tx win: 5744
I (1776) wifi_init: tcp rx win: 5744
I (1781) wifi_init: tcp mss: 1436
I (1785) wifi_init: WiFi/LWIP prefer SPIRAM
I (1789) wifi_init: WiFi IRAM OP enabled
I (1794) wifi_init: WiFi RX IRAM OP enabled
I (1800) wifi:Set ps type: 1

I (1802) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1909) wifi:mode : sta (c4:dd:57:6a:9a:10)
I (1910) wifi:enable tsf
E (1914) esp_netif_lwip: esp_netif_new: Failed to configure netif with config=0x3ffd97d0 (config or if_key is NULL or duplicate key)
I (2894) wifi:new:<9,0>, old:<1,0>, ap:<255,255>, sta:<9,0>, prof:1
I (4096) wifi:state: init -> auth (b0)
I (4102) wifi:state: auth -> assoc (0)
I (4127) wifi:state: assoc -> run (10)
I (4262) wifi:connected with TP-Link_809F, aid = 18, channel 9, BW20, bssid = 48:22:54:76:80:9f
I (4263) wifi:security: WPA2-PSK, phy: bgn, rssi: -39
I (4265) wifi:pm start, type: 1

W (4271) PERIPH_WIFI: WiFi Event cb, Unhandle event_base:WIFI_EVENT, event_id:4
I (4325) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (5274) esp_netif_handlers: sta ip: 192.168.11.214, mask: 255.255.255.0, gw: 192.168.11.1
I (5275) PERIPH_WIFI: Got ip:192.168.11.214
I (5278) SIP_PHONE: [ 2 ] Start codec chip
I (5300) ES8388_DRIVER: init,out:02, in:00
I (5308) AUDIO_HAL: Codec mode is 3, Ctrl:1
I (5312) SIP_PHONE: [ 3 ] Create and start input key service V2
I (5313) AUDIO_THREAD: The input_key_service task allocate stack on internal memory
I (5317) SIP_PHONE: [ 4 ] Create SIP Service
E (5321) SIP: /builds/adf/esp-adf-libs-source/esp_media_protocols/esp_rtc/esp_rtc_core/esp_rtc_sip/esp_rtc_sip.c:2087 (esp_sip_init): Memory exhausted
I (5336) SIP_PHONE: [ 5 ] Create decoder and encoder pipelines
I (5345) I2S: APLL expected frequency is 22579200 Hz, real frequency is 22579193 Hz
I (5351) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (5358) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3
I (5366) I2S: I2S0, MCLK output by GPIO0
I (5372) AUDIO_PIPELINE: link el->rb, el:0x3f80f3c8, tag:ei2s, rb:0x3f80f868
I (5378) AUDIO_PIPELINE: link el->rb, el:0x3f80f53c, tag:filter, rb:0x3f8118b0
I (5386) AUDIO_THREAD: The ei2s task allocate stack on internal memory
I (5392) AUDIO_ELEMENT: [ei2s-0x3f80f3c8] Element task created
I (5399) AUDIO_THREAD: The filter task allocate stack on external memory
I (5407) AUDIO_ELEMENT: [filter-0x3f80f53c] Element task created
I (5414) AUDIO_ELEMENT: [eraw-0x3f80f78c] Element task created
I (5420) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:4224395 Bytes, Inter:127279 Bytes, Dram:112063 Bytes, Dram largest free:106496Bytes

I (5434) AUDIO_ELEMENT: [ei2s] AEL_MSG_CMD_RESUME,state:1
I (5441) AUDIO_ELEMENT: [filter] AEL_MSG_CMD_RESUME,state:1
I (5450) RSP_FILTER: sample rate of source data : 48000, channel of source data : 2, sample rate of destination data : 8000, channel of destination data : 1
I (5465) AUDIO_PIPELINE: Pipeline started
I (5467) SIP_PHONE: Recorder has been created
E (5472) I2S: register I2S object to platform failed
I (5477) I2S: I2S0, MCLK output by GPIO0
I (5484) AUDIO_PIPELINE: link el->rb, el:0x3f8144d0, tag:raw, rb:0x3f814954
I (5489) AUDIO_PIPELINE: link el->rb, el:0x3f814644, tag:filter, rb:0x3f81699c
I (5497) AUDIO_ELEMENT: [raw-0x3f8144d0] Element task created
I (5504) AUDIO_THREAD: The filter task allocate stack on external memory
I (5512) AUDIO_ELEMENT: [filter-0x3f814644] Element task created
I (5519) AUDIO_THREAD: The i2s task allocate stack on internal memory
I (5524) AUDIO_ELEMENT: [i2s-0x3f8147e4] Element task created
I (5531) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:4194939 Bytes, Inter:118539 Bytes, Dram:103323 Bytes, Dram largest free:102400Bytes

I (5545) AUDIO_ELEMENT: [filter] AEL_MSG_CMD_RESUME,state:1
I (5560) RSP_FILTER: sample rate of source data : 8000, channel of source data : 1, sample rate of destination data : 48000, channel of destination data : 2
I (5567) AUDIO_ELEMENT: [i2s] AEL_MSG_CMD_RESUME,state:1
I (5572) I2S_STREAM: AUDIO_STREAM_WRITER
I (5578) AUDIO_PIPELINE: Pipeline started
I (5582) SIP_PHONE: Speaker has been created
I (5586) SIP_PHONE: [ 6 ] Create GUI
E (5795) i2c: i2c driver install error

Could you please help me to resolve i2c driver install error issue.

Thanks & Regards,
Anand

Andy2No

@ghanand,  The errors you were getting initially, look a lot like the ones I was getting trying to compile the examples for the ESP32_SBC_FabGL board, in Arduino.  The solution was to use the boards support package that was in use at the time, not the one currently offered by Espressif.

In Arduino, it's currently 3.0.2, and the one that was in use when the examples were written was 2.0.11.  Using that instead works fine.  Whether it's Arduino or IDF/ADF, it no doubt still uses gcc or g++ to actually do the compilation.

Espressif broke compatibility with software written for their v2.0.x versions when they released 3.0.x.  Apparently, they did the same when they released 2.0.x, breaking compatibility with things writen for 1.x.x.

There is a corresponding IDF (and maybe ADF) version for each of those.  The clue is in the dates of the files in the github repository you linked to - mostly about 5 years old.  If you can find the versions that were current at that time, and switch to those, you can probably compile it as is.