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

Use ESP-IDF only for WiFi #253

Merged
merged 64 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8b22c4c
Add Wokwi config template
lptr Nov 30, 2024
45f6d4e
Use the ESP's own mDNS
lptr Nov 30, 2024
f47c669
Switch to ESP-IDF's own NTP client
lptr Nov 30, 2024
0cd535f
Use ESP-IDF's own MQTT implementation
lptr Dec 1, 2024
aed89cd
Allow Task::delay() to be called from a static context
lptr Dec 1, 2024
f94b0da
Stop MQTT client if cannot connect
lptr Dec 1, 2024
e542631
Use ESP-IDF's own HTTPS OTA
lptr Dec 1, 2024
b7569a0
Reduce NTP server printout level
lptr Dec 1, 2024
74a72db
Use ESP-IDF WiFi implementation only
lptr Dec 1, 2024
2160427
Remove now unnecessary HTTPUpdate library
lptr Dec 1, 2024
1d09e1e
Display WIFI info correctly on debug status bar
lptr Dec 1, 2024
d60559d
Do not report missing fiels from struct initializers
lptr Dec 1, 2024
1cd24f3
Track WOKWI as a build input
lptr Dec 2, 2024
a8a05aa
Do not report missing fields from struct initializers
lptr Dec 2, 2024
2133b1e
Properly handle mDNS results
lptr Dec 2, 2024
d6f38e4
Handle MQTT server lookup properly
lptr Dec 2, 2024
752cc0b
Connect to WiFi using stored credentials
lptr Dec 2, 2024
ae83211
Simplify WiFiDriver event handling
lptr Dec 2, 2024
d723a40
Polis NTP sync
lptr Dec 2, 2024
5ff84ec
Enable WiFi provisioning
lptr Dec 2, 2024
2c7f4a8
Restart provisioning on failed credentials
lptr Dec 2, 2024
fe35077
Keep WiFi on while provisioning finishes
lptr Dec 2, 2024
fb934d9
De-init WiFi provisioning once finished
lptr Dec 2, 2024
9a3c106
Set MQTT client ID
lptr Dec 2, 2024
e1a56ff
Do a debug build
lptr Dec 2, 2024
4d96ca8
Handle MQTTS connections
lptr Dec 2, 2024
e2b3a46
Connect to WiFi only once
lptr Dec 2, 2024
a08b7ae
Reduce log level for MQTT certs
lptr Dec 2, 2024
ca76ec6
Only print NTP servers at debug
lptr Dec 2, 2024
e59de52
Demote creating state log
lptr Dec 2, 2024
ac63ad0
Signal network connecting in Wokwi
lptr Dec 2, 2024
4eaf4b7
Add MK4 Wokwi simulation
lptr Dec 2, 2024
94cd5db
Fix backtrace lookup
lptr Dec 2, 2024
ae1b5f8
Do not stop a not-started MQTT client
lptr Dec 2, 2024
b3fad81
Print only the leftmost 256 characters in logs
lptr Dec 2, 2024
903a31e
Print memory info in debug log when heap tracing
lptr Dec 2, 2024
bcf864f
Inline delay() function
lptr Dec 2, 2024
22c7198
Log stack sizes when heap tracing
lptr Dec 2, 2024
355824a
Reduce battery stack size
lptr Dec 2, 2024
3b5f967
Rename mDNS init task
lptr Dec 2, 2024
e520580
Reduce status-update stack size
lptr Dec 2, 2024
a8df9b4
Delete `main` task
lptr Dec 2, 2024
af734c6
Reduce stack size of heap tracking
lptr Dec 2, 2024
80d1cd0
Reduce switch-manager stack size
lptr Dec 2, 2024
5a9747e
Increase WiFiDriver stack
lptr Dec 2, 2024
cbf5e20
Use a vector to keep track of blink patterns
lptr Dec 2, 2024
58afe86
No need for extra loop
lptr Dec 2, 2024
e49cc65
Move status printing to its own function
lptr Dec 2, 2024
2800bfe
Reduce stack of battery voltage check
lptr Dec 2, 2024
9c2ddc5
Move handling blinking to its own function
lptr Dec 2, 2024
95a01fe
Use a vector to avoid allocations
lptr Dec 2, 2024
57ded7e
Fix typo
lptr Dec 2, 2024
e6f3175
Polish function declaration
lptr Dec 2, 2024
ee81212
Simplify logging
lptr Dec 2, 2024
53c7d6d
Polish NTP settings
lptr Dec 3, 2024
ae211d4
Update deprecated config setting
lptr Dec 3, 2024
64446b5
Switch to ESP logging, step 1
lptr Dec 3, 2024
48b598f
Use ESP-IDF log, take 2
lptr Dec 3, 2024
c7d8025
Fix typos
lptr Dec 3, 2024
99cae18
Move ConsoleProvider to its own file
lptr Dec 3, 2024
c8a5d92
Fix buffer size
lptr Dec 3, 2024
fe26f6e
Do not initialize Serial
lptr Dec 3, 2024
d871ecf
Allocate fewer WiFi buffers to free up some DIRAM
lptr Dec 3, 2024
238aac2
Implement vprintf() contract properly
lptr Dec 3, 2024
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
12 changes: 0 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
[submodule "components/MQTTPubSubClient"]
path = components/MQTTPubSubClient
url = https://github.com/hideakitai/MQTTPubSubClient
[submodule "components/ArxTypeTraits"]
path = components/ArxTypeTraits
url = https://github.com/hideakitai/ArxTypeTraits
[submodule "components/ArxContainer"]
path = components/ArxContainer
url = https://github.com/hideakitai/ArxContainer
[submodule "components/NTPClient"]
path = components/NTPClient
url = https://github.com/arduino-libraries/NTPClient
[submodule "components/SHT31"]
path = components/SHT31
url = https://github.com/RobTillaart/SHT31
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ if(UD_GEN STREQUAL MK4)
add_compile_definitions(HWCDCSerial=Serial0)
endif()

# Keep struct initializers simple
add_compile_options("-Wno-missing-field-initializers")

# TODO Make this depend on some flag
set(CMAKE_BUILD_TYPE Debug)

project(ugly-duckling)

# Use `idf.py -DFSUPLOAD=1 flash` to upload the data partition
Expand Down
1 change: 0 additions & 1 deletion components/ArxContainer
Submodule ArxContainer deleted from d6affc
1 change: 0 additions & 1 deletion components/ArxTypeTraits
Submodule ArxTypeTraits deleted from 7a4415
10 changes: 0 additions & 10 deletions components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ idf_component_register(
SRCS "DallasTemperature/DallasTemperature.cpp"
INCLUDE_DIRS "DallasTemperature"

SRCS ${mqtt_sources}
INCLUDE_DIRS "MQTTPubSubClient/src" "ArxTypeTraits" "ArxContainer"

SRCS "NTPClient/NTPClient.cpp"
INCLUDE_DIRS "NTPClient"

SRCS "OneWire/OneWire.cpp"
INCLUDE_DIRS "OneWire"

Expand All @@ -31,10 +25,6 @@ idf_component_register(
SRCS "SHT2x/SHT2x.cpp"
INCLUDE_DIRS "SHT2x"

SRCS "../managed_components/espressif__arduino-esp32/libraries/HTTPUpdate/src/HTTPUpdate.cpp"
INCLUDE_DIRS "../managed_components/espressif__arduino-esp32/libraries/HTTPUpdate/src"
REQUIRES app_update

REQUIRES "arduino-esp32"
)

Expand Down
1 change: 0 additions & 1 deletion components/MQTTPubSubClient
Submodule MQTTPubSubClient deleted from 43771e
1 change: 0 additions & 1 deletion components/NTPClient
Submodule NTPClient deleted from 78d423
8 changes: 8 additions & 0 deletions data-templates/device-config-wokwi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "wokwi",
"instance": "wokwi",
"location": "local",
"peripherals": [
],
"sleepWhenIdle": true
}
2 changes: 1 addition & 1 deletion lookup-backtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Define regex patterns for the two formats
PATTERN1 = r"caller ((?:0x[0-9a-fA-F]+:)+0x[0-9a-fA-F]+)"
PATTERN2 = r"Backtrace: ((?:0x[0-9a-fA-F]+:[0-9a-fA-F]+ ?)+)"
PATTERN2 = r"Backtrace: ((?:0x[0-9a-fA-F]+:0x[0-9a-fA-F]+ ?)+)"

def parse_and_run_addr2line(line):
# Print the input line
Expand Down
3 changes: 2 additions & 1 deletion main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ if(NOT DEFINED WOKWI)
set(WOKWI "$ENV{WOKWI}")
endif()

# Make sure we reconfigure if UD_DEBUG changes
# Make sure we reconfigure if parameters change
set_property(DIRECTORY PROPERTY UD_DEBUG_TRACKER "${UD_DEBUG}")
set_property(DIRECTORY PROPERTY WOKWI_TRACKER "${WOKWI}")

idf_component_register(
SRCS ${app_sources}
Expand Down
Loading
Loading