- Edited the Wifi Scanner in NetworkUtils namespace
- Added config.grab_mode = CAMERA_GRAB_LATEST;
to camera config to grab the latest frames
- Set httpd stack size to 20480
This commit is contained in:
ZanzyTHEbar 2022-08-28 18:31:48 +01:00
parent a5820c674a
commit e373cc704f
3 changed files with 5 additions and 5 deletions

View File

@ -13,18 +13,16 @@ bool Network_Utilities::LoopWifiScan()
{ {
// WiFi.scanNetworks will return the number of networks found // WiFi.scanNetworks will return the number of networks found
log_i("[INFO]: Beginning WiFi Scanner"); log_i("[INFO]: Beginning WiFi Scanner");
int networks = WiFi.scanNetworks(); int networks = WiFi.scanNetworks(true, true);
log_i("[INFO]: scan done"); log_i("[INFO]: scan done");
log_i("%d networks found", networks); log_i("%d networks found", networks);
for (int i = networks; i--;) for (int i = networks; i--;)
{ {
// Print SSID and RSSI for each network found // Print SSID and RSSI for each network found
//! Add method here to interface with the API and forward the scanned networks to the API //! TODO: Add method here to interface with the API and forward the scanned networks to the API
log_i("%d: %s (%d) %s\n", i - 1, WiFi.SSID(i), WiFi.RSSI(i), (WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*"); log_i("%d: %s (%d) %s\n", i - 1, WiFi.SSID(i), WiFi.RSSI(i), (WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*");
my_delay(0.02L); // delay 20ms my_delay(0.02L); // delay 20ms
} }
// Wait a bit before scanning again
delay(5000);
return (networks > 0); return (networks > 0);
} }

View File

@ -6,6 +6,7 @@ int CameraHandler::setupCamera()
config.ledc_channel = LEDC_CHANNEL_0; config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0; config.ledc_timer = LEDC_TIMER_0;
config.grab_mode = CAMERA_GRAB_LATEST;
config.pin_d0 = Y2_GPIO_NUM; config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM; config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM; config.pin_d2 = Y4_GPIO_NUM;
@ -22,7 +23,7 @@ int CameraHandler::setupCamera()
config.pin_sscb_scl = SIOC_GPIO_NUM; config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM; config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM; config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000; // 10000000 stable, config.xclk_freq_hz = 16500000; // 10000000 stable,
// 16500000 optimal, // 16500000 optimal,
// 20000000 max fps // 20000000 max fps
config.pixel_format = PIXFORMAT_JPEG; config.pixel_format = PIXFORMAT_JPEG;

View File

@ -88,6 +88,7 @@ int StreamServer::startStreamServer()
config.max_uri_handlers = 1; config.max_uri_handlers = 1;
config.server_port = this->STREAM_SERVER_PORT; config.server_port = this->STREAM_SERVER_PORT;
config.ctrl_port = this->STREAM_SERVER_PORT; config.ctrl_port = this->STREAM_SERVER_PORT;
config.stack_size = 20480;
httpd_uri_t stream_page = { httpd_uri_t stream_page = {
.uri = "/", .uri = "/",