Skip to content

Commit

Permalink
updated the demo to either have the webserver enabled or the perf ser…
Browse files Browse the repository at this point in the history
…ver, further when enabling stack overflow detection the network thread was too small, so raised that to 3072 bytes.
  • Loading branch information
mkm85 committed Jul 26, 2024
1 parent b66efb4 commit ab1f4d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/nabto_device/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ menu "Nabto Edge"
"Set the stack size for the thread which runs all the core operations."
config NABTO_DEVICE_NETWORK_THREAD_STACK_SIZE
int "Nabto Network Thread Stack Size"
default 2048
default 3072
depends on ENABLE_NABTO_DEVICE
help
"Set the stack size for the thread which runs the network."
Expand Down
2 changes: 1 addition & 1 deletion components/nabto_device/src/nm_select_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void nm_select_unix_run(struct nm_select_unix* ctx)
{
esp_pthread_cfg_t pthreadConfig = esp_pthread_get_default_config();
pthreadConfig.stack_size = NETWORK_THREAD_STACK_SIZE;
pthreadConfig.thread_name = "Network";
pthreadConfig.thread_name = "Nabto Network";
pthreadConfig.prio = 15;
//pthreadConfig.pin_to_core = 1;

Expand Down
11 changes: 6 additions & 5 deletions examples/tcptunnel/main/tcptunnel_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@ void app_main(void)

nabto_esp32_iam_init(&iam, dev, iamConfig, defaultIamState, nvsHandle);

//httpd_handle_t webserver =
// Either the webserver or the perf server can be enabled but not both at the same time, the reason is currently not known.

start_webserver(&logger);
// On the ESP32 without extra ram the perf server cannot coexists with the webserver.
xTaskCreate(&perf_task, "perf_task", 4096, NULL, 5, NULL);
CHECK_NABTO_ERR(nabto_device_add_tcp_tunnel_service(dev, "http", "http", "127.0.0.1", 80));

// On the ESP32 without extra ram the perf server cannot coexists with the webserver.
//xTaskCreate(&perf_task, "perf_task", 4096, NULL, 5, NULL);
//CHECK_NABTO_ERR(nabto_device_add_tcp_tunnel_service(dev, "perf", "perf", "127.0.0.1", 9000));

CHECK_NABTO_ERR(nabto_device_add_tcp_tunnel_service(dev, "http", "http", "127.0.0.1", 80));
CHECK_NABTO_ERR(nabto_device_add_tcp_tunnel_service(dev, "perf", "perf", "127.0.0.1", 9000));

CHECK_NABTO_ERR(nabto_device_limit_connections(dev, 2));
CHECK_NABTO_ERR(nabto_device_limit_stream_segments(dev, 80));
Expand Down

0 comments on commit ab1f4d0

Please sign in to comment.