Skip to content

Commit 5c1c5d3

Browse files
authored
Switch ESP32 to esp-idf framework (#107)
1 parent 35736f6 commit 5c1c5d3

File tree

3 files changed

+48
-13
lines changed

3 files changed

+48
-13
lines changed

packages/airgradient_d1_mini_board.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
substitutions:
2-
config_version: 4.0.7
2+
config_version: 4.0.8
33

44
esphome:
55
name: "${name}"
@@ -21,8 +21,6 @@ logger:
2121
logs:
2222
component: ERROR # Hiding warning messages about component taking a long time https://github.com/esphome/issues/issues/4717
2323

24-
# web_server: # Please note that enabling this component will take up a lot of memory and may decrease stability, especially on ESP8266.
25-
2624
uart:
2725
# https://esphome.io/components/uart.html#uart
2826
- rx_pin: D4
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
substitutions:
2+
config_version: 4.0.8
3+
4+
esphome:
5+
name: "${name}"
6+
friendly_name: "${friendly_name}"
7+
name_add_mac_suffix: ${name_add_mac_suffix} # Set to false if you don't want part of the MAC address in the name
8+
9+
project:
10+
name: mallocarray.airgradient
11+
version: "$config_version"
12+
min_version: 2024.6.0
13+
14+
esp32:
15+
board: esp32-c3-devkitm-1
16+
17+
# Enable logging
18+
# https://esphome.io/components/logger.html
19+
logger:
20+
baud_rate: 0 # Must disable serial logging as it conflicts with pms5003 uart pins and ESP32-C3 only has 2 hardware UART
21+
logs:
22+
component: ERROR # Hiding warning messages about component taking a long time https://github.com/esphome/issues/issues/4717
23+
24+
# The captive portal is a fallback mechanism for when connecting to the configured WiFi fails.
25+
# https://esphome.io/components/captive_portal.html
26+
captive_portal:
27+
28+
uart:
29+
# https://esphome.io/components/uart.html#uart
30+
- rx_pin: GPIO0 # Pin 12
31+
tx_pin: GPIO1 # Pin 13
32+
baud_rate: 9600
33+
id: senseair_s8_uart
34+
35+
- rx_pin: GPIO20 # Pin 30 or RX
36+
tx_pin: GPIO21 # Pin 31 or TX
37+
baud_rate: 9600
38+
id: pms5003_uart
39+
40+
i2c:
41+
# https://esphome.io/components/i2c.html
42+
sda: GPIO7 # Pin 21
43+
scl: GPIO6 # Pin 20
44+
frequency: 400kHz # 400kHz eliminates warnings about components taking a long time other than SGP40 component: https://github.com/esphome/issues/issues/4717

packages/airgradient_esp32-c3_board.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
substitutions:
2-
config_version: 4.0.7
2+
config_version: 4.0.8
33

44
esphome:
55
name: "${name}"
@@ -13,13 +13,8 @@ esphome:
1313

1414
esp32:
1515
board: esp32-c3-devkitm-1
16-
# Testing upgrading from 5.4.0 which is current default
17-
# framework:
18-
# type: arduino
19-
# version: 6.7.0
20-
21-
# esp32_improv: # Uses around 30% of available flash space due to loading BLE stack
22-
# authorizer: none
16+
framework:
17+
type: esp-idf
2318

2419
# Enable logging
2520
# https://esphome.io/components/logger.html
@@ -32,8 +27,6 @@ logger:
3227
# https://esphome.io/components/captive_portal.html
3328
captive_portal:
3429

35-
# web_server: # Please note that enabling this component will take up a lot of memory and may decrease stability, especially on ESP8266.
36-
3730
uart:
3831
# https://esphome.io/components/uart.html#uart
3932
- rx_pin: GPIO0 # Pin 12

0 commit comments

Comments
 (0)