Skip to content

Commit

Permalink
access point support (#17)
Browse files Browse the repository at this point in the history
+ build: reduce dep numbers and make dev builds default
+ adds release feature to disable logging
+ adds wifi-default feature to esp-wifi
+ remove smoltcp as it is not needed
+ feat: Initialize WiFi as both AP and STA modes, configure AP stack, and spawn AP task for handling connections.
  • Loading branch information
Sycrosity authored Jun 30, 2024
1 parent 69e1373 commit 364e302
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 107 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ rustflags = [
"-C",
"link-arg=-Tlinkall.x",

# # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) on riscv32imc targets.
# # NOTE: May negatively impact performance of produced code
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) on riscv32imc targets.
# NOTE: May negatively impact performance of produced code
"-C",
"force-frame-pointers",
]
Expand Down
76 changes: 34 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 27 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,26 @@ esp-alloc = { version = "0.4.0", optional = true }

#for wifi connectivity for esp controllers.
esp-wifi = { version = "0.6.0", features = [
"phy-enable-usb",
"utils",
"wifi",
"embassy-net",
# "wifi-logs",
"dhcpv4",
"async",
"wifi-default",
"wifi",
"utils",
], optional = true }

heapless = "0.8.0"

smoltcp = { version = "0.11.0", default-features = false, features = [
"medium-ethernet",
"proto-dhcpv4",
"proto-igmp",
"proto-ipv4",
"socket-dhcpv4",
"socket-icmp",
"socket-raw",
"socket-tcp",
"socket-udp",
], optional = true }
# smoltcp = { version = "0.11.0", default-features = false, features = [
# "medium-ethernet",
# "proto-dhcpv4",
# "proto-igmp",
# "proto-ipv4",
# "socket-dhcpv4",
# "socket-icmp",
# "socket-raw",
# "socket-tcp",
# "socket-udp",
# ], optional = true }

#the gold standard for logging in rust
log = "0.4.20"
Expand Down Expand Up @@ -95,6 +94,10 @@ dotenv = "0.15.0"
# Rust debug is too slow.
# For debug builds always builds with some optimization
opt-level = "s"
codegen-units = 1 # LLVM can perform better optimizations using a single thread
debug-assertions = false
overflow-checks = false
lto = 'fat'

[profile.release]
codegen-units = 1 # LLVM can perform better optimizations using a single thread
Expand All @@ -108,13 +111,20 @@ overflow-checks = false
[profile.release.package.esp-wifi]
opt-level = 3

[profile.dev.package.esp-wifi]
opt-level = 3

[features]
default = ["log", "net", "alloc"]

alloc = ["dep:esp-alloc"]

net = ["dep:esp-wifi", "dep:embassy-net", "dep:embedded-svc", "dep:reqwless"]

verbose-wifi = ["esp-wifi/wifi-logs", "esp-wifi/dump-packets"]

release = ["log/release_max_level_off"]

log = [
"embassy-net/log",
"embassy-time/log",
Expand Down Expand Up @@ -146,3 +156,4 @@ esp32c3 = [
[patch.crates-io]
ssd1306 = { version = "0.9.0", git = "https://github.com/embedevices-rs/ssd1306", branch = "async" }
embassy-embedded-hal = { version = "0.1.1", git = "https://github.com/Sycrosity/embassy-embedded-hal" }
# reqwless = { version = "0.12.0", path = "/Users/louis/dev/embedded/reqwless" }
Loading

0 comments on commit 364e302

Please sign in to comment.