I 使用 ngix 配置 https://api.openai.com 接口, stored Base URL: https://openai.allsoftcould.xyz/v1 esp box 还是显示 "API Key is not valid", log 如下:
chatgpt_demo % idf.py -p /dev/cu.usbmodem141201 monitor
Executing action: monitor
Running idf_monitor in directory /Users/xxx/esp-box/examples/chatgpt_demo
Executing "/Users/xxx/.espressif/python_env/idf5.1_py3.10_env/bin/python /Users/xxx/esp/esp-idf/tools/idf_monitor.py -p /dev/cu.usbmodem141201 -b 115200 --toolchain-prefix xtensa-esp32s3-elf- --target esp32s3 --revision 0 /Users/xxx/esp-box/examples/chatgpt_demo/build/chatgpt_demo.elf -m '/Users/xxx/.espressif/python_env/idf5.1_py3.10_env/bin/python' '/Users/xxx/esp/esp-idf/tools/idf.py' '-p' '/dev/cu.usbmodem141201'"...
--- esp-idf-monitor 1.3.3 on /dev/cu.usbmodem141201 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037d3a2
0x4037d3a2: esp_cpu_wait_for_intr at /Users/xxx/esp/esp-idf/components/esp_hw_support/cpu.c:121
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x18e4
load:0x403c9700,len:0x4
load:0x403c9704,len:0xda4
load:0x403cc700,len:0x3084
entry 0x403c9934
I (26) boot: ESP-IDF v5.1.2-dirty 2nd stage bootloader
I (27) boot: compile time Dec 15 2023 09:48:15
I (27) boot: Multicore bootloader
I (30) boot: chip revision: v0.1
I (34) qio_mode: Enabling default flash chip QIO
I (39) boot.esp32s3: Boot SPI Speed : 80MHz
I (44) boot.esp32s3: SPI Mode : QIO
I (49) boot.esp32s3: SPI Flash Size : 16MB
I (54) boot: Enabling RNG early entropy source...
I (59) boot: Partition Table:
I (63) boot: ## Label Usage Type ST Offset Length
I (70) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (77) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (85) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (92) boot: 3 ota_0 OTA app 00 10 00010000 00600000
I (100) boot: 4 uf2 factory app 00 00 00700000 00200000
I (107) boot: 5 storage Unknown data 01 82 00900000 00200000
I (115) boot: 6 model Unknown data 01 82 00b00000 003e8000
I (123) boot: End of partition table
I (127) esp_image: segment 0: paddr=00010020 vaddr=3c120020 size=231cb4h (2301108) map
I (484) esp_image: segment 1: paddr=00241cdc vaddr=3fc9ba00 size=071bch ( 29116) load
I (490) esp_image: segment 2: paddr=00248ea0 vaddr=40374000 size=07178h ( 29048) load
I (496) esp_image: segment 3: paddr=00250020 vaddr=42000020 size=11cfa4h (1167268) map
I (675) esp_image: segment 4: paddr=0036cfcc vaddr=4037b178 size=10874h ( 67700) load
I (689) esp_image: segment 5: paddr=0037d848 vaddr=600fe010 size=00004h ( 4) load
I (700) boot: Loaded app from partition at offset 0x10000
I (700) boot: Disabling RNG early entropy source...
I (711) cpu_start: Multicore app
I (712) octal_psram: vendor id : 0x0d (AP)
I (712) octal_psram: dev id : 0x02 (generation 3)
I (715) octal_psram: density : 0x03 (64 Mbit)
I (720) octal_psram: good-die : 0x01 (Pass)
I (725) octal_psram: Latency : 0x01 (Fixed)
I (731) octal_psram: VCC : 0x01 (3V)
I (736) octal_psram: SRF : 0x01 (Fast Refresh)
I (742) octal_psram: BurstType : 0x01 (Hybrid Wrap)
I (747) octal_psram: BurstLen : 0x01 (32 Byte)
I (753) octal_psram: Readlatency : 0x02 (10 cycles@Fixed)
I (759) octal_psram: DriveStrength: 0x00 (1/1)
I (765) MSPI Timing: PSRAM timing tuning index: 4
I (770) esp_psram: Found 8MB PSRAM device
I (774) esp_psram: Speed: 80MHz
I (856) mmu_psram: Instructions copied and mapped to SPIRAM
I (857) cpu_start: Pro cpu up.
I (857) cpu_start: Starting app cpu, entry point is 0x403758c4
0x403758c4: call_start_cpu1 at /Users/xxx/esp/esp-idf/components/esp_system/port/cpu_start.c:157
I (0) cpu_start: App cpu up.
I (1104) esp_psram: SPI SRAM memory test OK
I (1113) cpu_start: Pro cpu start user code
I (1113) cpu_start: cpu freq: 240000000 Hz
I (1113) cpu_start: Application information:
I (1116) cpu_start: Project name: chatgpt_demo
I (1121) cpu_start: App version: v0.5.0-32-g10d166a-dirty
I (1128) cpu_start: Compile time: Dec 15 2023 09:48:04
I (1134) cpu_start: ELF file SHA256: f1ea9e484bccbe12...
I (1140) cpu_start: ESP-IDF: v5.1.2-dirty
I (1146) cpu_start: Min chip rev: v0.0
I (1150) cpu_start: Max chip rev: v0.99
I (1155) cpu_start: Chip rev: v0.1
I (1160) heap_init: Initializing. RAM available for dynamic allocation:
I (1167) heap_init: At 3FCA8170 len 000415A0 (261 KiB): DRAM
I (1174) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (1181) heap_init: At 600FE014 len 00001FD4 (7 KiB): RTCRAM
I (1187) esp_psram: Adding pool of 7040K of PSRAM memory to heap allocator
I (1195) spi_flash: detected chip: gd
I (1199) spi_flash: flash io: qio
I (1203) sleep: Configure to isolate all GPIO pins in sleep state
I (1210) sleep: Enable automatic switching of GPIO sleep configuration
I (1217) app_start: Starting scheduler on CPU0
I (1222) app_start: Starting scheduler on CPU1
I (1222) main_task: Started on CPU0
I (1232) esp_psram: Reserving pool of 8K of internal memory for DMA/internal allocations
I (1240) main_task: Calling app_main()
I (1261) settings: stored ssid:xxx
I (1261) settings: stored password:xxx
I (1261) settings: stored OpenAI:sk-xxx
I (1268) settings: stored Base URL:https://openai.allsoftcould.xyz/v1
I (1400) ESP-BOX: Partition size: total: 1920401, used: 1038136
I (1401) LVGL: Starting LVGL task
I (1401) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1409) gpio: GPIO[48]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1539) gpio: GPIO[3]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:2
I (1540) button: IoT Button Version: 3.1.3
I (1542) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1552) button: IoT Button Version: 3.1.3
I (1556) gpio: GPIO[1]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1566) button: IoT Button Version: 3.1.3
I (1574) ES8311: Work in Slave mode
I (1576) gpio: GPIO[46]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1585) ES7210: Work in Slave mode
I (1591) ES7210: Enable ES7210_INPUT_MIC1
I (1594) ES7210: Enable ES7210_INPUT_MIC2
I (1601) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (1604) I2S_IF: STD Mode 1 bits:16/16 channel:2 sample_rate:16000 mask:3
I (1618) Adev_Codec: Open codec device OK
I (1618) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (1622) I2S_IF: STD Mode 0 bits:16/16 channel:2 sample_rate:16000 mask:3
I (1630) ES7210: Bits 16
I (1636) ES7210: Enable ES7210_INPUT_MIC1
I (1639) ES7210: Enable ES7210_INPUT_MIC2
I (1645) ES7210: Unmuted
I (1645) Adev_Codec: Open codec device OK
W (1650) bsp_sensor: This example don't support Sensor!!
I (1656) app_main: Display LVGL demo
I (1660) ESP-BOX: Setting LCD backlight: 100%
I (1693) app_main: speech recognition start
I (1694) MODEL_LOADER: The storage free size is 22272 KB
I (1694) MODEL_LOADER: The partition size is 4000 KB
I (1699) MODEL_LOADER: Successfully map model partition
I (1705) AFE_SR: afe interface for speech recognition
I (1711) AFE_SR: AFE version: SR_V220727
I (1715) AFE_SR: Initial auido front-end, total channel: 3, mic num: 2, ref num: 1
I (1724) AFE_SR: aec_init: 0, se_init: 1, vad_init: 1
I (1730) AFE_SR: wakenet_init: 1
I (1697) pp: pp rom version: e7ae62f
I (1739) net80211: net80211 rom version: e7ae62f
I (1745) wifi:wifi driver task: 3fcbf4b4, prio:23, stack:6656, core=0
I (1759) wifi:wifi firmware version: 91b9630
I (1760) wifi:wifi certification version: v7.0
I (1760) wifi:config NVS flash: enabled
I (1761) wifi:config nano formating: disabled
I (1765) wifi:Init data frame dynamic rx buffer num: 32
I (1770) wifi:Init static rx mgmt buffer num: 5
I (1774) wifi:Init management short buffer num: 32
I (1779) wifi:Init static tx buffer num: 16
I (1783) wifi:Init tx cache buffer num: 32
I (1787) wifi:Init static tx FG buffer num: 2
I (1791) wifi:Init static rx buffer size: 1600
I (1795) wifi:Init static rx buffer num: 10
I (1799) wifi:Init dynamic rx buffer num: 32
I (1805) wifi_init: rx ba win: 6
I (1808) wifi_init: tcpip mbox: 32
I (1812) wifi_init: udp mbox: 6
I (1815) wifi_init: tcp mbox: 6
I (1819) wifi_init: tcp tx win: 5744
I (1823) wifi_init: tcp rx win: 5744
I (1828) wifi_init: tcp mss: 1440
I (1832) wifi_init: WiFi/LWIP prefer SPIRAM
I (1836) wifi_init: WiFi IRAM OP enabled
I (1842) wifi_init: WiFi RX IRAM OP enabled
I (1848) phy_init: phy_version 620,ec7ec30,Sep 5 2023,13:49:13
I (1904) wifi:mode : sta (f4:12:fa:d7:f6:08)
I (1905) wifi:enable tsf
I (1906) wifi station: start connect to the AP
I (1906) wifi station: wifi_init_sta finished.inspur5, 123456a*
I (1912) wifi station: NET_EVENT_POWERON_SCAN
MC Quantized wakenet9: wakeNet9_v1h24_hiesp_3_0.63_0.635, tigger:v3, mode:2, p:0, (Jul 7 2023 11:10:53)
I (2000) AFE_SR: wake num: 3, mode: 0, (Jul 7 2023 11:10:53)
I (2000) app_sr: Set language EN
I (2000) app_sr: load wakenet:wn9_hiesp
MC Quantized wakenet9: wakeNet9_v1h24_hiesp_3_0.63_0.635, tigger:v3, mode:2, p:0, (Jul 7 2023 11:10:53)
I (2036) AFE_SR: wakenet wn_frame_size = 512
I (2039) app_sr: Feed Task
I (2042) app_sr: audio_chunksize=1024, feed_channel=3
I (2048) app_sr: Detection task
sr handle task, mute:1
successfully created record_audio_buffer with a size: 256000
audio_rx_buffer with a size: 1048576
I (2218) file_iterator: File : echo_cn_end.wav
I (2231) file_iterator: File : Hi.wav
I (2249) file_iterator: File : echo_cn_wake.wav
I (2255) file_iterator: File : waitPlease.mp3
I (2256) file_iterator: File : echo_en_end.wav
I (2269) file_iterator: File : echo_en_wake.wav
I (2271) file_iterator: File : echo_en_ok.wav
I (2279) file_iterator: File : Hi.mp3
I (2288) file_iterator: File : input.wav
I (2289) file_iterator: File : echo_cn_ok.wav
W (2352) app_sr: AFE Fetch Fail
W (2652) app_sr: AFE Fetch Fail
W (2952) app_sr: AFE Fetch Fail
W (3252) app_sr: AFE Fetch Fail
W (3552) app_sr: AFE Fetch Fail
W (3852) app_sr: AFE Fetch Fail
W (4152) app_sr: AFE Fetch Fail
I (4323) wifi station: Total APs scanned = 14, ret:0
I (4324) wifi station: SSID xxx
W (4452) app_sr: AFE Fetch Fail
I (4461) wifi<12,0>, old:<1,0>, ap:<255,255>, sta:<12,0>, prof:1
I (4462) wifi:state: init -> auth (b0)
I (4466) wifi:state: auth -> assoc (0)
I (4471) wifi:state: assoc -> run (10)
I (4478) wifi:idx:0 (ifx:0, 04:d4:c4:43:34:d8), tid:0, ssn:0, winSize:64
I (4496) wifi:connected with inspur5, aid = 5, channel 12, BW20, bssid = 04:d4:c4:43:34:d8
I (4497) wifi:security: WPA2-PSK, phy: bgn, rssi: -65
I (4500) wifi:pm start, type: 1
I (4501) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 25000, mt_pti: 0, mt_time: 10000
I (4516) wifi:idx:1 (ifx:0, 04:d4:c4:43:34:d8), tid:6, ssn:0, winSize:64
I (4557) wifi:AP's beacon interval = 102400 us, DTIM period = 3
W (4752) app_sr: AFE Fetch Fail
W (5052) app_sr: AFE Fetch Fail
W (5352) app_sr: AFE Fetch Fail
I (5510) esp_netif_handlers: sta ip: 172.168.50.134, mask: 255.255.255.0, gw: 172.168.50.1
I (5510) wifi station: got ip:172.168.50.134
I (16897) ui-events: sr start once
I (16905) app_sr: AFE_FETCH_CHANNEL_VERIFIED, channel index: 2
I (16905) app_audio: ### record Start
I (16972) ui_ctrl: Swich to panel[1]
I (17052) app_audio: frame_rate= 16000, ch=2, width=16
I (17055) I2S_IF: Pending out channel for in channel running
E (17076) i2s_common: i2s_channel_disable(1030): the channel has not been enabled yet
I (17077) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (17081) I2S_IF: STD Mode 1 bits:16/16 channel:2 sample_rate:16000 mask:3
I (17168) Adev_Codec: Open codec device OK
E (17168) i2s_common: i2s_channel_disable(1030): the channel has not been enabled yet
I (17170) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (17176) I2S_IF: STD Mode 0 bits:16/16 channel:2 sample_rate:16000 mask:3
I (17185) ES7210: Bits 16
I (17190) ES7210: Enable ES7210_INPUT_MIC1
I (17193) ES7210: Enable ES7210_INPUT_MIC2
I (17200) ES7210: Unmuted
I (17200) Adev_Codec: Open codec device OK
W (17271) app_sr: silence, frame:24
audio play end, 32034, 31 K
W (17841) app_sr: silence, frame:10
W (18036) app_sr: silence, frame:0
W (21740) app_sr: vad Time out
I (21741) app_audio: ESP_MN_STATE_TIMEOUT
I (21741) app_audio: ### record Stop, 83886 81K
audio load end, 11988, 11 K
E (21910) app_audio: [Start] start_openai, timestamp: 21910
I (21911) OpenAI: OpenAI create, version: 0.2.0
I (21913) ui_ctrl: Swich to panel[2]
I (21930) I2S_IF: Pending out channel for in channel running
E (21961) i2s_common: i2s_channel_disable(1030): the channel has not been enabled yet
I (21961) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (21965) I2S_IF: STD Mode 1 bits:16/16 channel:2 sample_rate:16000 mask:3
I (22045) Adev_Codec: Open codec device OK
E (22045) i2s_common: i2s_channel_disable(1030): the channel has not been enabled yet
I (22048) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (22055) I2S_IF: STD Mode 0 bits:16/16 channel:2 sample_rate:16000 mask:3
I (22062) ES7210: Bits 16
I (22068) ES7210: Enable ES7210_INPUT_MIC1
I (22071) ES7210: Enable ES7210_INPUT_MIC2
I (22078) ES7210: Unmuted
I (22078) Adev_Codec: Open codec device OK
I (23208) esp-x509-crt-bundle: Certificate validated
I (26008) app_main: replay audio end
I (30067) ui_ctrl: update listen speak
E (30068) app_audio: [End] start_openai, +offset:8158
[esp32-s3-box] API Key is not valid
Re: [esp32-s3-box] API Key is not valid
您好,我们进行了版本更新,您可以再次尝试 url:https://openai.allsoftcould.xyz/v1/。如果仍出现问题,请先确认该 URL 是否有效。如果有有效但仍出现问题,可以提供更多日志以便排查问题。
Re: [esp32-s3-box] API Key is not valid
curl --request POST \
--url https://api.openai.com/v1/audio/transcriptions \
--header 'Authorization: Bearer TOKEN' \
--header 'Content-Type: multipart/form-data' \
--form file=@/path/to/file/openai.mp3 \
--form model=whisper-1
后续出现第三方 URL 失效,可以先用命令测试下,是否有效返回
--url https://api.openai.com/v1/audio/transcriptions \
--header 'Authorization: Bearer TOKEN' \
--header 'Content-Type: multipart/form-data' \
--form file=@/path/to/file/openai.mp3 \
--form model=whisper-1
后续出现第三方 URL 失效,可以先用命令测试下,是否有效返回
Who is online
Users browsing this forum: No registered users and 14 guests