页次: 1
这个难度不大, 我找个时间弄个 step by step记录.
运行了里面的server.py,然后修改一下运行可以了自己需要的端口号,和ip就可以了。
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>E/
'E' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
C:\Users\Administrator>E:
E:\>cd ESP32
E:\ESP32>cd ADF/
E:\ESP32\ADF>ls
'ls' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
E:\ESP32\ADF>cd esp-adf
E:\ESP32\ADF\esp-adf>cd examples
E:\ESP32\ADF\esp-adf\examples>cd recorder
E:\ESP32\ADF\esp-adf\examples\recorder>cd pipeline_raw_http
E:\ESP32\ADF\esp-adf\examples\recorder\pipeline_raw_http>python server.py
Serving HTTP on 0.0.0.0 port 8000
Traceback (most recent call last):
File "server.py", line 76, in <module>
httpd.serve_forever()
File "C:\Python27\lib\SocketServer.py", line 231, in serve_forever
poll_interval)
File "C:\Python27\lib\SocketServer.py", line 150, in _eintr_retry
return func(*args)
KeyboardInterrupt
E:\ESP32\ADF\esp-adf\examples\recorder\pipeline_raw_http>python server.py -place
Serving HTTP on 0.0.0.0 port 8000
Traceback (most recent call last):
File "server.py", line 76, in <module>
httpd.serve_forever()
File "C:\Python27\lib\SocketServer.py", line 231, in serve_forever
poll_interval)
File "C:\Python27\lib\SocketServer.py", line 150, in _eintr_retry
return func(*args)
KeyboardInterrupt
E:\ESP32\ADF\esp-adf\examples\recorder\pipeline_raw_http>run python server.py
'run' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
E:\ESP32\ADF\esp-adf\examples\recorder\pipeline_raw_http>python E:\ESP32\ADF\esp
-adf\examples\recorder\pipeline_raw_http\server.py
Serving HTTP on 0.0.0.0 port 8000
Traceback (most recent call last):
File "E:\ESP32\ADF\esp-adf\examples\recorder\pipeline_raw_http\server.py", lin
e 76, in <module>
httpd.serve_forever()
File "C:\Python27\lib\SocketServer.py", line 231, in serve_forever
poll_interval)
File "C:\Python27\lib\SocketServer.py", line 150, in _eintr_retry
return func(*args)
KeyboardInterrupt
E:\ESP32\ADF\esp-adf\examples\recorder\pipeline_raw_http>python server.py
Serving HTTP on 192.168.3.57 port 8899
Audio information, sample rates: 16000, bits: 16, channel(s): 2
Total bytes received: 1024
[FTotal bytes received: 2048
[FTotal bytes received: 3072
[FTotal bytes received: 4096
[FTotal bytes received: 5120
[FTotal bytes received: 6144
[FTotal bytes received: 7168
[FTotal bytes received: 8192
[FTotal bytes received: 9216
[FTotal bytes received: 10240
[FTotal bytes received: 11264
[FTotal bytes received: 12288
[FTotal bytes received: 13312
[FTotal bytes received: 14336
[FTotal bytes received: 14336
[F192.168.3.63 - - [17/Jul/2018 14:23:44] "POST /upload HTTP/1.1" 200 -
感谢晕哥提醒。
现在问题是不能录音,还是 http 上传出问题?
https://github.com/espressif/esp-adf/tree/master/examples/recorder/pipeline_raw_http
我看了一下demo, 就是用python脚本建立一个服务器, esp32通过wifi发送音频数据到服务器.
其实我就是不知道怎么用python脚本建立一个服务器。望晕哥指教。
rst:0x1 (POWERON_RESET),boot:0x3f (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:0x3fff0018,len:4
load:0x3fff001c,len:5764
load:0x40078000,len:0
load:0x40078000,len:14032
entry 0x40078ff0
I (28) boot: ESP-IDF v3.0.1 2nd stage bootloader
I (28) boot: compile time 21:16:03
I (30) boot: Enabling RNG early entropy source...
I (32) qio_mode: Enabling QIO for flash chip GD
I (38) boot: SPI Speed : 80MHz
I (42) boot: SPI Mode : QIO
I (46) boot: SPI Flash Size : 8MB
I (50) boot: Partition Table:
I (53) boot: ## Label Usage Type ST Offset Length
I (61) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (68) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (76) boot: 2 factory factory app 00 00 00010000 00100000
I (83) boot: End of partition table
I (87) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x43bb8 (277432) map
I (169) esp_image: segment 1: paddr=0x00053be0 vaddr=0x3ffb0000 size=0x0382c ( 14380) load
I (174) esp_image: segment 2: paddr=0x00057414 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at C:/projects/esp-adf/esp-idf/components/freertos/xtensa_vectors.S:1685I (176) esp_image: segment 3: paddr=0x0005781c vaddr=0x40080400 size=0x087f4 ( 34804) load
I (196) esp_image: segment 4: paddr=0x00060018 vaddr=0x400d0018 size=0xfa5d4 (1025492) map
0x400d0018: _flash_cache_start at ??:?I (467) esp_image: segment 5: paddr=0x0015a5f4 vaddr=0x40088bf4 size=0x08ce8 ( 36072) load
0x40088bf4: xTaskCreatePinnedToCore at C:/projects/esp-adf/esp-idf/components/freertos/tasks.c:4494 (discriminator 2)I (479) esp_image: segment 6: paddr=0x001632e4 vaddr=0x400c0000 size=0x00000 ( 0) load
E (479) esp_image: Image length 1389328 doesn't fit in partition length 1048576
E (484) boot: Factory app partition is not bootable
E (490) boot: No bootable app partitions in the partition table
user code donehttps://whycan.cn/files/members/3/QQ20180713213410.png
一番折腾之后,居然出错了。
这个需要修改:
1.$IDF_PATH/components/partition_table/partitions_singleapp.csv
# Name, Type, SubType, Offset, Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 2M,//这里原本是0x10000的,但是会报Factory app partition is not bootable,所以需要修改为2M,
还有就是现在不能播音乐了,要认证才可以播,但是现在那识别率真心忧伤。
https://whycan.cn/files/members/3/QQ20180707114321.png
百度dueros 申请了开发者账号,但是没有发现能下载到楼上格式的文件.
晕哥,在设备生产那里就可以生成profile文件,然后替换mian里面的duer_profile文件的内容替换就好了,现在是明明开启了音乐播放功能,然后提示没有开启这个内容,还有就是官方的例程识别真心坑爹。
https://whycan.cn/t_1098.html#p4879
测试这个本地音乐播放,判断声卡和功放是否正常。
声卡是没问题的,我试过mp3那个例程
我的上电没有提示音,难受中,也没有显示token错误之类的
from BLK0 of EFUSE[0m
[0;32mI (118) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
I (148) wifi: Init dynamic tx buffer num: 32
I (148) wifi: Init data frame dynamic rx buffer num: 32
I (148) wifi: Init management frame dynamic rx buffer num: 32
I (148) wifi: wifi driver task: 3ffc0d90, prio:23, stack:4096
I (158) wifi: Init static rx buffer num: 10
I (158) wifi: Init dynamic rx buffer num: 32
I (158) wifi: wifi power manager task: 0x3ffc59d0 prio: 21 stack: 2560
[0;32mI (198) phy: phy_version: 3662, 711a97c, May 9 2018, 14:29:06, 0, 0[0m
I (198) wifi: mode : sta (b4:e6:2d:d3:11:21)
I (318) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (1298) wifi: state: init -> auth (b0)
I (1308) wifi: state: auth -> assoc (0)
I (1308) wifi: state: assoc -> run (10)
[0;32mI (2058) BAIDU_SPEECH_EXAMPLE: [ 1 ] Start audio codec chip[0m
[0;32mI (2058) gpio: GPIO[19]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 [0m
[0;31mE (2068) gpio: gpio_install_isr_service(406): GPIO isr service already installed[0m
[0;32mI (2088) ES8388_DRIVER: init,out:02, in:00[0m
[0;32mI (2088) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (2088) AUDIO_HAL: Codec mode is 2, Ctrl:1[0m
[0;32mI (2098) BAIDU_SPEECH_EXAMPLE: [2.0] Create audio pipeline for playback[0m
[0;32mI (2098) BAIDU_SPEECH_EXAMPLE: [2.1] Create http stream to read data[0m
[0;32mI (2108) BAIDU_SPEECH_EXAMPLE: [2.2] Create i2s stream to write data to codec chip[0m
[0;32mI (2118) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3[0m
[0;32mI (2128) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=3[0m
[0;32mI (2138) I2S: APLL: Req RATE: 44100, real rate: 43945.016, BITS: 16, CLKM: 1, BCK: 8, MCLK: 11289966.924, SCLK: 1406240.500000, diva: 1, divb: 0[0m
[0;32mI (2148) BAIDU_SPEECH_EXAMPLE: [2.3] Create mp3 decoder to decode mp3 file[0m
[0;32mI (2158) MP3_DECODER: MP3 init[0m
[0;32mI (2158) BAIDU_SPEECH_EXAMPLE: [2.4] Register all elements to audio pipeline[0m
[0;32mI (2168) BAIDU_SPEECH_EXAMPLE: [2.5] Link it together http_stream-->mp3_decoder-->i2s_stream-->[codec_chip][0m
[0;32mI (2178) BAIDU_SPEECH_EXAMPLE: [2.6] Setup uri (http as http_stream, mp3 as mp3 decoder, and default output is i2s)[0m
[0;32mI (2188) BAIDU_SPEECH_EXAMPLE: [ 4 ] Setup event listener[0m
[0;32mI (2188) BAIDU_SPEECH_EXAMPLE: [4.1] Listening event from all elements of pipeline[0m
[0;32mI (2198) BAIDU_SPEECH_EXAMPLE: [4.2] Listening event from peripherals[0m
[0;32mI (2208) BAIDU_SPEECH_EXAMPLE: [ 5 ] Start audio_pipeline[0m
[0;32mI (2218) AUDIO_ELEMENT: [http] Element task created[0m
[0;32mI (2218) AUDIO_ELEMENT: [mp3] Element task created[0m
[0;32mI (2228) AUDIO_ELEMENT: [i2s] Element task created[0m
[0;32mI (2228) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:260, MEM Total:190356 Bytes
[0m
[0;32mI (2238) AUDIO_ELEMENT: [mp3] AEL_MSG_CMD_RESUME,state:1[0m
[0;32mI (2248) MP3_DECODER: MP3 opened[0m
[0;32mI (2248) AUDIO_ELEMENT: [i2s] AEL_MSG_CMD_RESUME,state:1[0m
[0;32mI (2258) I2S_STREAM: AUDIO_STREAM_WRITER[0m
[0;32mI (2258) AUDIO_PIPELINE: Pipeline started[0m
[0;32mI (2298) I2S: APLL: Req RATE: 16000, real rate: 15999.022, BITS: 16, CLKM: 1, BCK: 8, MCLK: 4096000.000, SCLK: 511968.718750, diva: 1, divb: 0[0m
[0;32mI (2298) AUDIO_ELEMENT: [i2s] AEL_MSG_CMD_RESUME,state:3[0m
[0;32mI (2308) I2S_STREAM: AUDIO_STREAM_WRITER[0m
I (4308) wifi: pm start, type:0
wenkumk 说:晕哥 说:那不错,以前还听说不开源,可以玩一玩。
那就催更了,其实看他们的readme还是不很懂
这个可以有.
https://github.com/espressif/esp-adf/tree/master/examples/dueros
DuerOS3.0 Example.
This example shows how to use ADF APIs to connect DuerOS3.0 To run this example you need ESP32 LyraT or compatible board:Setup Wi-Fi SSID and Password.
Connect speakers or headphone to the board.
Select your DuerOS device profile instead of ADF_APTH/examples/dueros/main/duer_profile. If you have not, please refer to DuerOS Developer Certification Guide apply for the DuerOS developer.Supported Features
Press [Rec] button to talk to DuerOS. The device will playback the DuerOS response. You can say anything what do you want, e.g."今天天气怎么样?" or "现在几点了?", what means "What's the weather?" or " what time is it?".
Wi-Fi Status indicate by green led. Wi-Fi connected green led turn on, disconnect with normal blink, setting will be fast blink.
Adjust volume by by touching [Vol-] or [Vol+]
Config Wi-Fi by [Set] button
Note:
DuerOS profile is device unique ID.
是滴 主要是这里面的Select your DuerOS device profile instead of ADF_APTH/examples/dueros/main/duer_profile. If you have not, please refer to DuerOS Developer Certification Guide apply for the DuerOS developer.不知道怎么操作,已经申请开发者中。
wenkumk 说:duerOs在github上更新了,求晕哥弄个帖子搞一下,是在是搞不了,就那个duer_profile需要怎么弄呢
https://github.com/dueros
这个移植到 esp32 ?
是ESP32的ADF更新了,duerOs
页次: 1