back to lyrat config, fixed some networking and config trouble

This commit is contained in:
Miller Puckette 2024-10-15 12:41:29 -05:00
parent 06f96cd114
commit 445c87ffca
9 changed files with 3134 additions and 1160 deletions

View file

@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.5)
# for LyraT boards uncomment this line and use "esp_adf" instead of "esp_idf":
#
# include($ENV{ADF_PATH}/CMakeLists.txt)
include($ENV{ADF_PATH}/CMakeLists.txt)
#
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

View file

@ -47,11 +47,10 @@ another (third-party) URL that might be useful:
https://gitdemo.readthedocs.io/en/latest/build-system.html
The compilation chain depends on an "sdkconfig" file. The included one is for a
generic ESP board. Samples for the two LyraT boards are included as
"sdkconfig.lyrat" and "sdkconfig.lyratmini" - you can rename one of these as
"sdkconfig" before invoking the compiler (and compile using the "ADF", not the
"IDF" - see below).
The compilation chain depends on an "sdkconfig" file. Samples for the two LyraT
boards are included as "sdkconfig.lyrat" and "sdkconfig.lyratmini", and a sample
for a bare WROOM module is included as "sdkconfig.wroom". You can rename one
of these as "sdkconfig" before invoking the compiler.
In addition to the sources youre looking at you'll need Pd, preferably the
latest version, although I'm testing this with Pd commit
@ -67,17 +66,23 @@ flash, and run the monitor program to see debugging output (see bottom of this
page to see what I type on my system). This should be done from a shell window
that is in this (espd) directory.
CAUTION: compiling for LyraT boards works differently from raw WROOM boards.
Commands I issue to shell to compile (customize to your own installation):
For generic ESP32 modules:
********* For generic ESP32 modules: *********
FIRST copy sdkconfig.wroom to sdkconfig. Then:
export IDF_TOOLS_PATH=~/bis/var/esp/tools
export IDF_PATH=~/bis/var/esp/esp-idf
. $IDF_PATH/export.sh
for LyraT boards:
********* for LyraT boards: *********
FIRST edit Cmakelists.txt to enable esp_adf and copy one of sdkconfig.lyrat*
to sdkconfig. Then:
### FIRST edit Cmakelists.txt to enable esp_adf ###
export IDF_TOOLS_PATH=~/bis/var/esp/tools
export ADF_PATH=~/bis/var/esp/esp-adf
. $ADF_PATH/esp-idf/export.sh

View file

@ -38,10 +38,12 @@ void pdmain_init( void);
void sd_init( void);
#ifndef OBSOLETEAPI
static i2s_chan_handle_t tx_handle;
#ifdef USEADC
static i2s_chan_handle_t rx_handle;
#endif
#endif /* OBSOLETEAPI */
#define BLKSIZE 64
float soundin[IOCHANS * BLKSIZE], soundout[IOCHANS * BLKSIZE];
@ -122,7 +124,7 @@ void senddacs( void)
#endif /* USEADC */
}
#if OBSOLETEAPI
#ifdef OBSOLETEAPI
/* allow deprecated form if new one unavailable */
#ifndef I2S_COMM_FORMAT_STAND_I2S
#define I2S_COMM_FORMAT_STAND_I2S I2S_COMM_FORMAT_I2S

View file

@ -2,8 +2,10 @@
#define PD_USE_WIFI /* messages to/from Pd over wifi TCP */
#define PD_USE_CONSOLE /* messages to Pd over "console" (USB serial) */
/* #define PD_INCLUDEPATCH */ /* load the patch defined in "testpatch.c" */
/* #define PD_LYRAT */ /* using LyraT or LyraT mini board */
#define PD_LYRAT /* using LyraT or LyraT mini board */
#define USEADC /* enable audio input (output always enabled) */
#define IOCHANS 1
#define OBSOLETEAPI 1
/* task priorities */
#define PRIORITY_WIFI 2
@ -30,7 +32,6 @@ void bt_init( void);
void pd_bt_writeback(unsigned char *s, int length);
#endif
#define IOCHANS 2
#ifdef PD_USE_WIFI
void wifi_init(void); /* wifi.c - manage 802.11 connection */

1581
sdkconfig

File diff suppressed because it is too large Load diff

2485
sdkconfig.wroom Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,4 @@
#N canvas 52 117 393 697 12;
#X obj 53 386 dac~ 1;
#N canvas 56 126 393 697 12;
#X obj 119 294 r a;
#X obj 158 87 loadbang;
#X msg 156 123 dsp 1;
@ -12,14 +11,25 @@
#X obj 46 239 *~ 1e+15;
#X obj 46 265 clip~ 0 1;
#X obj 52 326 *~ 0.03;
#X connect 1 0 12 1;
#X obj 53 386 dac~ 1 2;
#X obj 188 437 adc~;
#X obj 112 508 print~;
#X obj 113 465 r p1;
#X obj 238 501 print~;
#X obj 239 458 r p2;
#X connect 0 0 11 1;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 5 0 8 0;
#X connect 6 0 7 1;
#X connect 7 0 0 0;
#X connect 4 0 7 0;
#X connect 5 0 6 1;
#X connect 6 0 12 0;
#X connect 6 0 12 1;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
#X connect 12 0 7 0;
#X connect 11 0 6 0;
#X connect 13 0 14 0;
#X connect 13 1 16 0;
#X connect 15 0 14 0;
#X connect 17 0 16 0;

View file

@ -1,4 +1,4 @@
#N canvas 687 140 1262 545 12;
#N canvas 616 243 1262 545 12;
#X msg 373 294 listen 4498;
#X obj 374 331 netreceive -u -f;
#X listbox 481 365 26 0 0 0 - - - 0;
@ -11,27 +11,17 @@
#X floatatom 120 478 5 0 0 0 - - - 0;
#X obj 43 480 list;
#X listbox 43 504 20 0 0 0 - - - 0;
#X obj 227 75 text define patch;
#X obj 125 345 text sequence patch;
#X msg 126 319 line 0 \, auto;
#X obj 144 370 print;
#X obj 922 425 text define patch;
#X obj 108 398 text sequence patch;
#X obj 44 454 netreceive;
#X msg 107 255 send pd foo 1;
#X msg 123 287 send pd begin-new poodle .;
#X msg 115 397 send pd end-new;
#X msg 96 270 send pd foo 1;
#X obj 55 12 loadbang;
#X msg 97 175 send a 0;
#X msg 96 95 send a 70;
#X msg 98 200 send f 440;
#X msg 102 226 send f 660;
#X obj 228 15 loadbang;
#X msg 229 44 read esp-patch.pd;
#X obj 379 78 r amp;
#X msg 379 104 set \$1;
#X obj 379 130 s amp-set;
#X floatatom 655 144 8 0 100 1 amp amp-set amp 0;
#X obj 95 121 r amp;
#X msg 93 146 send a \$1;
#X obj 103 131 r amp;
#X msg 101 156 send a \$1;
#X msg 476 198 set \$1;
#X floatatom 589 180 11 -100 100 1 bias bias-set bias 0;
#X obj 476 172 r bias;
@ -54,18 +44,18 @@
#X obj 599 54 expr 100*sqrt($f1/32768);
#X floatatom 622 82 11 0 100 0 - - - 0;
#X obj 599 106 s amp;
#X floatatom 821 349 5 0 1000 0 - - - 0;
#X obj 821 400 / 32768;
#X obj 821 374 + 0.25;
#X obj 820 453 s bias;
#X floatatom 837 427 10 0 0 0 - - - 0;
#X obj 821 314 r int-bias;
#X floatatom 762 304 5 0 1000 0 - - - 0;
#X obj 762 355 / 32768;
#X obj 762 329 + 0.25;
#X obj 761 408 s bias;
#X floatatom 778 382 10 0 0 0 - - - 0;
#X obj 762 269 r int-bias;
#X msg 941 34 \; int-bias 223 \; amp 0 \; freq 0;
#X msg 929 279 \; int-bias \$1 \; amp 0 \; freq 0;
#X msg 904 275 \; int-bias \$1 \; amp 0 \; freq 0;
#X msg 905 151 15;
#X msg 938 151 31;
#X obj 905 177 t b f;
#X floatatom 930 252 5 0 0 0 - - - 0;
#X floatatom 905 248 5 0 0 0 - - - 0;
#X msg 1003 153 55;
#X msg 970 151 47;
#X obj 847 178 del 250;
@ -78,78 +68,80 @@
#X msg 1166 155 639;
#X msg 830 31 \; int-bias 255 \; amp 0 \; freq 0;
#X msg 1134 153 510;
#X msg 210 255 send pd foo 0;
#X msg 250 225 send pd foo 2;
#X msg 94 246 send pd foo 0;
#X msg 81 296 send pd foo 2;
#X floatatom 1053 395 11 0 0 0 - - - 0;
#X obj 1053 446 s amp;
#X obj 1053 420 / 200;
#X msg 1058 36 \; amp 2 \; bias -1 \; freq 30;
#X obj 1014 241 bng 35 250 50 0 empty empty empty 0 -11 0 12 #fcfcfc #000000 #000000;
#X obj 921 397 r pat;
#X obj 110 425 r esp;
#X msg 1013 281 \; pat read esp-patch.pd \; esp send pd begin-new poodle . \; seq line 0 \, auto \; esp send pd end-new;
#X obj 105 373 r seq;
#X msg 749 455 \; esp send p1 bang;
#X msg 752 494 \; esp send p2 bang;
#X connect 0 0 1 0;
#X connect 1 0 4 0;
#X connect 1 1 2 0;
#X connect 3 0 5 0;
#X connect 4 0 3 0;
#X connect 5 0 46 0;
#X connect 5 0 36 0;
#X connect 6 0 0 0;
#X connect 7 0 16 0;
#X connect 8 0 16 0;
#X connect 7 0 14 0;
#X connect 8 0 14 0;
#X connect 10 0 11 0;
#X connect 13 0 15 0;
#X connect 13 0 16 0;
#X connect 14 0 13 0;
#X connect 16 0 10 0;
#X connect 16 1 9 0;
#X connect 17 0 16 0;
#X connect 18 0 16 0;
#X connect 19 0 16 0;
#X connect 20 0 7 0;
#X connect 21 0 16 0;
#X connect 22 0 16 0;
#X connect 23 0 16 0;
#X connect 24 0 16 0;
#X connect 25 0 26 0;
#X connect 26 0 12 0;
#X connect 13 0 14 0;
#X connect 14 0 10 0;
#X connect 14 1 9 0;
#X connect 15 0 14 0;
#X connect 16 0 7 0;
#X connect 17 0 18 0;
#X connect 18 0 19 0;
#X connect 21 0 22 0;
#X connect 22 0 14 0;
#X connect 23 0 26 0;
#X connect 25 0 23 0;
#X connect 27 0 28 0;
#X connect 28 0 29 0;
#X connect 31 0 32 0;
#X connect 32 0 16 0;
#X connect 33 0 36 0;
#X connect 35 0 33 0;
#X connect 37 0 38 0;
#X connect 38 0 16 0;
#X connect 39 0 42 0;
#X connect 41 0 39 0;
#X connect 43 0 44 0;
#X connect 44 0 16 0;
#X connect 28 0 14 0;
#X connect 29 0 32 0;
#X connect 31 0 29 0;
#X connect 33 0 34 0;
#X connect 34 0 14 0;
#X connect 35 0 37 0;
#X connect 36 0 35 0;
#X connect 36 1 35 1;
#X connect 38 0 39 0;
#X connect 40 0 38 0;
#X connect 41 0 42 0;
#X connect 42 0 43 0;
#X connect 42 0 44 0;
#X connect 45 0 47 0;
#X connect 46 0 45 0;
#X connect 46 1 45 1;
#X connect 48 0 49 0;
#X connect 50 0 48 0;
#X connect 51 0 52 0;
#X connect 52 0 53 0;
#X connect 52 0 54 0;
#X connect 55 0 57 0;
#X connect 56 0 59 0;
#X connect 56 0 58 0;
#X connect 57 0 56 0;
#X connect 46 0 49 0;
#X connect 46 0 48 0;
#X connect 47 0 46 0;
#X connect 50 0 45 0;
#X connect 53 0 55 0;
#X connect 54 0 55 0;
#X connect 55 0 59 0;
#X connect 55 1 56 0;
#X connect 56 0 52 0;
#X connect 57 0 55 0;
#X connect 58 0 55 0;
#X connect 59 0 62 0;
#X connect 60 0 55 0;
#X connect 63 0 65 0;
#X connect 64 0 65 0;
#X connect 65 0 69 0;
#X connect 65 1 66 0;
#X connect 66 0 62 0;
#X connect 67 0 65 0;
#X connect 68 0 65 0;
#X connect 69 0 72 0;
#X connect 70 0 65 0;
#X connect 71 0 65 0;
#X connect 72 0 66 0;
#X connect 73 0 65 0;
#X connect 74 0 65 0;
#X connect 75 0 74 0;
#X connect 76 0 65 0;
#X connect 78 0 65 0;
#X connect 79 0 16 0;
#X connect 80 0 16 0;
#X connect 81 0 83 0;
#X connect 83 0 82 0;
#X connect 61 0 55 0;
#X connect 62 0 56 0;
#X connect 63 0 55 0;
#X connect 64 0 55 0;
#X connect 65 0 64 0;
#X connect 66 0 55 0;
#X connect 68 0 55 0;
#X connect 69 0 14 0;
#X connect 70 0 14 0;
#X connect 71 0 73 0;
#X connect 73 0 72 0;
#X connect 75 0 78 0;
#X connect 76 0 12 0;
#X connect 77 0 14 0;
#X connect 79 0 13 0;

View file

@ -21,7 +21,7 @@
#include "lwip/err.h"
#include "lwip/sys.h"
#define EXAMPLE_ESP_MAXIMUM_RETRY 5
#define EXAMPLE_ESP_MAXIMUM_RETRY 50
/* FreeRTOS event group to signal when we are connected*/
static EventGroupHandle_t s_wifi_event_group;
@ -48,9 +48,9 @@ static void event_handler(void* arg, esp_event_base_t event_base,
s_retry_num++;
ESP_LOGI(TAG, "retry to connect to the AP");
} else {
ESP_LOGI(TAG,"connect to the AP fail");
xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
}
ESP_LOGI(TAG,"connect to the AP fail");
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));