Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate sdkconfig for sensors #40

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build/
sdkconfig.old
build_sensor1/
build_sensor2/
managed_components/

.vscode/.browse.c_cpp.db*
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
cmake_minimum_required(VERSION 3.5)

set(SDKCONFIG "${CMAKE_BINARY_DIR}/sdkconfig")

# Sensor 1
#set(BUILD_DIR build-sensor1)
set(SDKCONFIG_DEFAULTS "sdkconfig.defaults;sdkconfig.sensor1")

# Sensor 2
#set(BUILD_DIR build-sensor2)
#set(CMAKE_BINARY_DIR build-sensor2)
#set(SDKCONFIG_DEFAULTS "sdkconfig.defaults;sdkconfig.sensor2")

#idf_build_set_property(BUILD_DIR "build-sensor2")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)

#LVGL custom config file setup
Expand Down
1 change: 1 addition & 0 deletions main/util/async_web_server/http_event_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <esp_log.h>
#include <mutex>
#include <string>
#include <sys/socket.h>

namespace esp32
{
Expand Down
2 changes: 2 additions & 0 deletions main/wifi/wifi_sta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void wifi_sta::connect_to_ap()
copy_min_to_buffer(credentials_.get_password().begin(), credentials_.get_password().length(), config.sta.password);
config.sta.threshold.authmode = credentials_.get_password().empty() ? WIFI_AUTH_OPEN : WIFI_AUTH_WPA2_PSK;
config.sta.pmf_cfg.capable = true;
config.sta.pmf_cfg.required = false;

CHECK_THROW_ESP(esp_wifi_set_storage(WIFI_STORAGE_RAM));
CHECK_THROW_ESP(esp_wifi_set_config(WIFI_IF_STA, &config));
Expand All @@ -50,6 +51,7 @@ void wifi_sta::connect_to_ap()
void wifi_sta::connect() const
{
CHECK_THROW_ESP(esp_wifi_start());
CHECK_THROW_ESP(esp_wifi_set_dynamic_cs(true));
CHECK_THROW_ESP(esp_wifi_connect());
}

Expand Down
11 changes: 0 additions & 11 deletions sdkconfig → sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#
# Automatically generated file. DO NOT EDIT.
# Espressif IoT Development Framework (ESP-IDF) Project Configuration
#
CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000
Expand Down Expand Up @@ -1710,16 +1709,6 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y
# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set
# end of Wi-Fi Provisioning Manager

#
# Project
#
# CONFIG_SHT3X_SENSOR_ENABLE is not set
CONFIG_SCD30_SENSOR_ENABLE=y
CONFIG_SCD30_SENSOR_TEMPERATURE_OFFSET=90
# CONFIG_SCD4x_SENSOR_ENABLE is not set
# CONFIG_ENABLE_SD_CARD_SUPPORT is not set
# end of Project

#
# I2C
#
Expand Down
9 changes: 9 additions & 0 deletions sdkconfig.sensor1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Project
#
# CONFIG_SHT3X_SENSOR_ENABLE is not set
CONFIG_SCD30_SENSOR_ENABLE=y
CONFIG_SCD30_SENSOR_TEMPERATURE_OFFSET=160
# CONFIG_SCD4x_SENSOR_ENABLE is not set
# CONFIG_ENABLE_SD_CARD_SUPPORT is not set
# end of Project
10 changes: 10 additions & 0 deletions sdkconfig.sensor2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Project
#
# CONFIG_SHT3X_SENSOR_ENABLE is not set
# CONFIG_SCD30_SENSOR_ENABLE is not set
# CONFIG_SCD30_SENSOR_TEMPERATURE_OFFSET
CONFIG_SCD4x_SENSOR_ENABLE=y
CONFIG_SCD4x_SENSOR_TEMPERATURE_OFFSET=200
# CONFIG_ENABLE_SD_CARD_SUPPORT is not set
# end of Project