├── .cargo └── config.toml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── build.rs ├── clippy.toml ├── partitions.csv ├── rust-toolchain.toml ├── sdkconfig.defaults └── src ├── config.rs ├── main.rs ├── server.rs └── wifi.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | # Uncomment the relevant target for your chip here (ESP32, ESP32-S2, ESP32-S3 or ESP32-C3) 3 | #target = "xtensa-esp32-espidf" 4 | #target = "xtensa-esp32s2-espidf" 5 | target = "xtensa-esp32s3-espidf" 6 | #target = "riscv32imc-esp-espidf" 7 | #target = "riscv32imac-esp-espidf" 8 | 9 | [target.xtensa-esp32-espidf] 10 | linker = "ldproxy" 11 | runner = "espflash flash --monitor" 12 | rustflags = [ 13 | "--cfg", 14 | "mio_unsupported_force_poll_poll", 15 | "--cfg", 16 | "espidf_time64", 17 | "-C", 18 | "default-linker-libraries", 19 | ] 20 | 21 | [target.xtensa-esp32s2-espidf] 22 | linker = "ldproxy" 23 | runner = "espflash flash --monitor" 24 | rustflags = [ 25 | "--cfg", 26 | "mio_unsupported_force_poll_poll", 27 | "--cfg", 28 | "espidf_time64", 29 | "-C", 30 | "default-linker-libraries", 31 | ] 32 | 33 | [target.xtensa-esp32s3-espidf] 34 | linker = "ldproxy" 35 | runner = "espflash flash --monitor" 36 | rustflags = [ 37 | "--cfg", 38 | "mio_unsupported_force_poll_poll", 39 | "--cfg", 40 | "espidf_time64", 41 | "-C", 42 | "default-linker-libraries", 43 | ] 44 | 45 | [target.riscv32imc-esp-espidf] 46 | linker = "ldproxy" 47 | runner = "espflash flash --monitor" 48 | rustflags = [ 49 | "--cfg", 50 | "mio_unsupported_force_poll_poll", 51 | "--cfg", 52 | "espidf_time64", 53 | "-C", 54 | "default-linker-libraries", 55 | ] 56 | 57 | [target.riscv32imac-esp-espidf] 58 | linker = "ldproxy" 59 | runner = "espflash flash --monitor" 60 | rustflags = [ 61 | "--cfg", 62 | "mio_unsupported_force_poll_poll", 63 | "--cfg", 64 | "espidf_time64", 65 | "-C", 66 | "default-linker-libraries", 67 | ] 68 | 69 | [unstable] 70 | build-std = ["std", "panic_abort"] 71 | 72 | [env] 73 | ESP_IDF_VERSION = "v5.1.2" 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.embuild 2 | /target 3 | /.idea 4 | /env.sh 5 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "aho-corasick" 22 | version = "1.1.2" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "aligned" 31 | version = "0.4.1" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "80a21b9440a626c7fc8573a9e3d3a06b75c7c97754c2949bc7857b90353ca655" 34 | dependencies = [ 35 | "as-slice", 36 | ] 37 | 38 | [[package]] 39 | name = "android-tzdata" 40 | version = "0.1.1" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 43 | 44 | [[package]] 45 | name = "android_system_properties" 46 | version = "0.1.5" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 49 | dependencies = [ 50 | "libc", 51 | ] 52 | 53 | [[package]] 54 | name = "anyhow" 55 | version = "1.0.79" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" 58 | 59 | [[package]] 60 | name = "as-slice" 61 | version = "0.2.1" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" 64 | dependencies = [ 65 | "stable_deref_trait", 66 | ] 67 | 68 | [[package]] 69 | name = "async-trait" 70 | version = "0.1.77" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" 73 | dependencies = [ 74 | "proc-macro2", 75 | "quote", 76 | "syn 2.0.49", 77 | ] 78 | 79 | [[package]] 80 | name = "atomic-waker" 81 | version = "1.1.2" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 84 | 85 | [[package]] 86 | name = "autocfg" 87 | version = "1.1.0" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 90 | 91 | [[package]] 92 | name = "axum" 93 | version = "0.7.4" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e" 96 | dependencies = [ 97 | "async-trait", 98 | "axum-core", 99 | "bytes", 100 | "futures-util", 101 | "http", 102 | "http-body", 103 | "http-body-util", 104 | "hyper", 105 | "hyper-util", 106 | "itoa", 107 | "matchit", 108 | "memchr", 109 | "mime", 110 | "percent-encoding", 111 | "pin-project-lite", 112 | "rustversion", 113 | "serde", 114 | "serde_json", 115 | "serde_path_to_error", 116 | "serde_urlencoded", 117 | "sync_wrapper", 118 | "tokio", 119 | "tower", 120 | "tower-layer", 121 | "tower-service", 122 | "tracing", 123 | ] 124 | 125 | [[package]] 126 | name = "axum-core" 127 | version = "0.4.3" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" 130 | dependencies = [ 131 | "async-trait", 132 | "bytes", 133 | "futures-util", 134 | "http", 135 | "http-body", 136 | "http-body-util", 137 | "mime", 138 | "pin-project-lite", 139 | "rustversion", 140 | "sync_wrapper", 141 | "tower-layer", 142 | "tower-service", 143 | "tracing", 144 | ] 145 | 146 | [[package]] 147 | name = "axum-macros" 148 | version = "0.4.1" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" 151 | dependencies = [ 152 | "heck", 153 | "proc-macro2", 154 | "quote", 155 | "syn 2.0.49", 156 | ] 157 | 158 | [[package]] 159 | name = "backtrace" 160 | version = "0.3.69" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 163 | dependencies = [ 164 | "addr2line", 165 | "cc", 166 | "cfg-if", 167 | "libc", 168 | "miniz_oxide", 169 | "object", 170 | "rustc-demangle", 171 | ] 172 | 173 | [[package]] 174 | name = "bindgen" 175 | version = "0.63.0" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "36d860121800b2a9a94f9b5604b332d5cffb234ce17609ea479d723dbc9d3885" 178 | dependencies = [ 179 | "bitflags 1.3.2", 180 | "cexpr", 181 | "clang-sys", 182 | "lazy_static", 183 | "lazycell", 184 | "log", 185 | "peeking_take_while", 186 | "proc-macro2", 187 | "quote", 188 | "regex", 189 | "rustc-hash", 190 | "shlex", 191 | "syn 1.0.109", 192 | "which", 193 | ] 194 | 195 | [[package]] 196 | name = "bitflags" 197 | version = "1.3.2" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 200 | 201 | [[package]] 202 | name = "bitflags" 203 | version = "2.4.2" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" 206 | 207 | [[package]] 208 | name = "bstr" 209 | version = "1.9.0" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" 212 | dependencies = [ 213 | "memchr", 214 | "serde", 215 | ] 216 | 217 | [[package]] 218 | name = "build-data" 219 | version = "0.1.5" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "aed3884e2cab7c973c8fd2d150314b6a932df7fdc830edcaf1e8e7c4ae9db3c0" 222 | dependencies = [ 223 | "chrono", 224 | "safe-lock", 225 | "safe-regex", 226 | ] 227 | 228 | [[package]] 229 | name = "build-time" 230 | version = "0.1.3" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "f1219c19fc29b7bfd74b7968b420aff5bc951cf517800176e795d6b2300dd382" 233 | dependencies = [ 234 | "chrono", 235 | "once_cell", 236 | "proc-macro2", 237 | "quote", 238 | "syn 2.0.49", 239 | ] 240 | 241 | [[package]] 242 | name = "bumpalo" 243 | version = "3.15.0" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" 246 | 247 | [[package]] 248 | name = "byteorder" 249 | version = "1.5.0" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 252 | 253 | [[package]] 254 | name = "bytes" 255 | version = "1.5.0" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" 258 | 259 | [[package]] 260 | name = "camino" 261 | version = "1.1.6" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" 264 | dependencies = [ 265 | "serde", 266 | ] 267 | 268 | [[package]] 269 | name = "cargo-platform" 270 | version = "0.1.7" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" 273 | dependencies = [ 274 | "serde", 275 | ] 276 | 277 | [[package]] 278 | name = "cargo_metadata" 279 | version = "0.18.1" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" 282 | dependencies = [ 283 | "camino", 284 | "cargo-platform", 285 | "semver", 286 | "serde", 287 | "serde_json", 288 | "thiserror", 289 | ] 290 | 291 | [[package]] 292 | name = "cc" 293 | version = "1.0.83" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 296 | dependencies = [ 297 | "libc", 298 | ] 299 | 300 | [[package]] 301 | name = "cexpr" 302 | version = "0.6.0" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" 305 | dependencies = [ 306 | "nom", 307 | ] 308 | 309 | [[package]] 310 | name = "cfg-if" 311 | version = "1.0.0" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 314 | 315 | [[package]] 316 | name = "chrono" 317 | version = "0.4.34" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" 320 | dependencies = [ 321 | "android-tzdata", 322 | "iana-time-zone", 323 | "num-traits", 324 | "windows-targets 0.52.0", 325 | ] 326 | 327 | [[package]] 328 | name = "clang-sys" 329 | version = "1.7.0" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" 332 | dependencies = [ 333 | "glob", 334 | "libc", 335 | "libloading", 336 | ] 337 | 338 | [[package]] 339 | name = "cmake" 340 | version = "0.1.50" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" 343 | dependencies = [ 344 | "cc", 345 | ] 346 | 347 | [[package]] 348 | name = "const_format" 349 | version = "0.2.32" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" 352 | dependencies = [ 353 | "const_format_proc_macros", 354 | ] 355 | 356 | [[package]] 357 | name = "const_format_proc_macros" 358 | version = "0.2.32" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" 361 | dependencies = [ 362 | "proc-macro2", 363 | "quote", 364 | "unicode-xid", 365 | ] 366 | 367 | [[package]] 368 | name = "core-foundation-sys" 369 | version = "0.8.6" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 372 | 373 | [[package]] 374 | name = "critical-section" 375 | version = "1.1.2" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" 378 | 379 | [[package]] 380 | name = "crossbeam-deque" 381 | version = "0.8.5" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 384 | dependencies = [ 385 | "crossbeam-epoch", 386 | "crossbeam-utils", 387 | ] 388 | 389 | [[package]] 390 | name = "crossbeam-epoch" 391 | version = "0.9.18" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 394 | dependencies = [ 395 | "crossbeam-utils", 396 | ] 397 | 398 | [[package]] 399 | name = "crossbeam-utils" 400 | version = "0.8.19" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" 403 | 404 | [[package]] 405 | name = "cvt" 406 | version = "0.1.2" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" 409 | dependencies = [ 410 | "cfg-if", 411 | ] 412 | 413 | [[package]] 414 | name = "darling" 415 | version = "0.20.6" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" 418 | dependencies = [ 419 | "darling_core", 420 | "darling_macro", 421 | ] 422 | 423 | [[package]] 424 | name = "darling_core" 425 | version = "0.20.6" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" 428 | dependencies = [ 429 | "fnv", 430 | "ident_case", 431 | "proc-macro2", 432 | "quote", 433 | "syn 2.0.49", 434 | ] 435 | 436 | [[package]] 437 | name = "darling_macro" 438 | version = "0.20.6" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" 441 | dependencies = [ 442 | "darling_core", 443 | "quote", 444 | "syn 2.0.49", 445 | ] 446 | 447 | [[package]] 448 | name = "defmt" 449 | version = "0.3.6" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "3939552907426de152b3c2c6f51ed53f98f448babd26f28694c95f5906194595" 452 | dependencies = [ 453 | "bitflags 1.3.2", 454 | "defmt-macros", 455 | ] 456 | 457 | [[package]] 458 | name = "defmt-macros" 459 | version = "0.3.7" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "18bdc7a7b92ac413e19e95240e75d3a73a8d8e78aa24a594c22cbb4d44b4bbda" 462 | dependencies = [ 463 | "defmt-parser", 464 | "proc-macro-error", 465 | "proc-macro2", 466 | "quote", 467 | "syn 2.0.49", 468 | ] 469 | 470 | [[package]] 471 | name = "defmt-parser" 472 | version = "0.3.4" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" 475 | dependencies = [ 476 | "thiserror", 477 | ] 478 | 479 | [[package]] 480 | name = "either" 481 | version = "1.10.0" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" 484 | 485 | [[package]] 486 | name = "embassy-futures" 487 | version = "0.1.1" 488 | source = "registry+https://github.com/rust-lang/crates.io-index" 489 | checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" 490 | 491 | [[package]] 492 | name = "embassy-sync" 493 | version = "0.5.0" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "dd938f25c0798db4280fcd8026bf4c2f48789aebf8f77b6e5cf8a7693ba114ec" 496 | dependencies = [ 497 | "cfg-if", 498 | "critical-section", 499 | "embedded-io-async", 500 | "futures-util", 501 | "heapless", 502 | ] 503 | 504 | [[package]] 505 | name = "embedded-can" 506 | version = "0.4.1" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "e9d2e857f87ac832df68fa498d18ddc679175cf3d2e4aa893988e5601baf9438" 509 | dependencies = [ 510 | "nb 1.1.0", 511 | ] 512 | 513 | [[package]] 514 | name = "embedded-hal" 515 | version = "0.2.7" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" 518 | dependencies = [ 519 | "nb 0.1.3", 520 | "void", 521 | ] 522 | 523 | [[package]] 524 | name = "embedded-hal" 525 | version = "1.0.0" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" 528 | 529 | [[package]] 530 | name = "embedded-hal-async" 531 | version = "1.0.0" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" 534 | dependencies = [ 535 | "embedded-hal 1.0.0", 536 | ] 537 | 538 | [[package]] 539 | name = "embedded-hal-nb" 540 | version = "1.0.0" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" 543 | dependencies = [ 544 | "embedded-hal 1.0.0", 545 | "nb 1.1.0", 546 | ] 547 | 548 | [[package]] 549 | name = "embedded-io" 550 | version = "0.6.1" 551 | source = "registry+https://github.com/rust-lang/crates.io-index" 552 | checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" 553 | 554 | [[package]] 555 | name = "embedded-io-async" 556 | version = "0.6.1" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" 559 | dependencies = [ 560 | "embedded-io", 561 | ] 562 | 563 | [[package]] 564 | name = "embedded-svc" 565 | version = "0.27.0" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | checksum = "21535485b1b86b9780ac583f26277011623ae014f6485e3a042eb1249ce50237" 568 | dependencies = [ 569 | "defmt", 570 | "embedded-io", 571 | "embedded-io-async", 572 | "enumset", 573 | "heapless", 574 | "log", 575 | "no-std-net", 576 | "num_enum", 577 | "serde", 578 | "strum 0.25.0", 579 | "strum_macros 0.25.3", 580 | ] 581 | 582 | [[package]] 583 | name = "embuild" 584 | version = "0.31.4" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "4caa4f198bb9152a55c0103efb83fa4edfcbb8625f4c9e94ae8ec8e23827c563" 587 | dependencies = [ 588 | "anyhow", 589 | "bindgen", 590 | "bitflags 1.3.2", 591 | "cmake", 592 | "filetime", 593 | "globwalk", 594 | "home", 595 | "log", 596 | "remove_dir_all", 597 | "serde", 598 | "serde_json", 599 | "shlex", 600 | "strum 0.24.1", 601 | "tempfile", 602 | "thiserror", 603 | "which", 604 | ] 605 | 606 | [[package]] 607 | name = "enumset" 608 | version = "1.1.3" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" 611 | dependencies = [ 612 | "enumset_derive", 613 | "serde", 614 | ] 615 | 616 | [[package]] 617 | name = "enumset_derive" 618 | version = "0.8.1" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" 621 | dependencies = [ 622 | "darling", 623 | "proc-macro2", 624 | "quote", 625 | "syn 2.0.49", 626 | ] 627 | 628 | [[package]] 629 | name = "envy" 630 | version = "0.4.2" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" 633 | dependencies = [ 634 | "serde", 635 | ] 636 | 637 | [[package]] 638 | name = "equivalent" 639 | version = "1.0.1" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 642 | 643 | [[package]] 644 | name = "errno" 645 | version = "0.3.8" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 648 | dependencies = [ 649 | "libc", 650 | "windows-sys 0.52.0", 651 | ] 652 | 653 | [[package]] 654 | name = "esp-idf-hal" 655 | version = "0.43.0" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "67e962eb2733093da482c572164cc5bd3a4215da388e0bf4e82ba5c2e1191518" 658 | dependencies = [ 659 | "atomic-waker", 660 | "embassy-sync", 661 | "embedded-can", 662 | "embedded-hal 0.2.7", 663 | "embedded-hal 1.0.0", 664 | "embedded-hal-async", 665 | "embedded-hal-nb", 666 | "embedded-io", 667 | "embedded-io-async", 668 | "embuild", 669 | "enumset", 670 | "esp-idf-sys", 671 | "heapless", 672 | "log", 673 | "nb 1.1.0", 674 | "num_enum", 675 | ] 676 | 677 | [[package]] 678 | name = "esp-idf-svc" 679 | version = "0.48.0" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "be2de099fc8cac7c0c990c369c492c4296bdd9bd6bd3e4e1ddea5df1d19c714a" 682 | dependencies = [ 683 | "embassy-futures", 684 | "embedded-hal-async", 685 | "embedded-svc", 686 | "embuild", 687 | "enumset", 688 | "esp-idf-hal", 689 | "heapless", 690 | "log", 691 | "num_enum", 692 | "uncased", 693 | ] 694 | 695 | [[package]] 696 | name = "esp-idf-sys" 697 | version = "0.34.0" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "2765c2d1abbce4d88e95ba85c11e637ed1c40d4b9c507f57f513a1aa6a990869" 700 | dependencies = [ 701 | "anyhow", 702 | "bindgen", 703 | "build-time", 704 | "cargo_metadata", 705 | "const_format", 706 | "embuild", 707 | "envy", 708 | "libc", 709 | "regex", 710 | "serde", 711 | "strum 0.24.1", 712 | "which", 713 | ] 714 | 715 | [[package]] 716 | name = "esp32axum" 717 | version = "0.0.1" 718 | dependencies = [ 719 | "anyhow", 720 | "axum", 721 | "axum-macros", 722 | "build-data", 723 | "embedded-hal 1.0.0", 724 | "embedded-svc", 725 | "embuild", 726 | "esp-idf-hal", 727 | "esp-idf-svc", 728 | "esp-idf-sys", 729 | "heapless", 730 | "log", 731 | "panic-halt", 732 | "serde", 733 | "serde_json", 734 | "tokio", 735 | ] 736 | 737 | [[package]] 738 | name = "fastrand" 739 | version = "2.0.1" 740 | source = "registry+https://github.com/rust-lang/crates.io-index" 741 | checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" 742 | 743 | [[package]] 744 | name = "filetime" 745 | version = "0.2.23" 746 | source = "registry+https://github.com/rust-lang/crates.io-index" 747 | checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" 748 | dependencies = [ 749 | "cfg-if", 750 | "libc", 751 | "redox_syscall", 752 | "windows-sys 0.52.0", 753 | ] 754 | 755 | [[package]] 756 | name = "fnv" 757 | version = "1.0.7" 758 | source = "registry+https://github.com/rust-lang/crates.io-index" 759 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 760 | 761 | [[package]] 762 | name = "form_urlencoded" 763 | version = "1.2.1" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 766 | dependencies = [ 767 | "percent-encoding", 768 | ] 769 | 770 | [[package]] 771 | name = "fs_at" 772 | version = "0.1.10" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "982f82cc75107eef84f417ad6c53ae89bf65b561937ca4a3b3b0fd04d0aa2425" 775 | dependencies = [ 776 | "aligned", 777 | "cfg-if", 778 | "cvt", 779 | "libc", 780 | "nix", 781 | "windows-sys 0.48.0", 782 | ] 783 | 784 | [[package]] 785 | name = "futures-channel" 786 | version = "0.3.30" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 789 | dependencies = [ 790 | "futures-core", 791 | ] 792 | 793 | [[package]] 794 | name = "futures-core" 795 | version = "0.3.30" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 798 | 799 | [[package]] 800 | name = "futures-sink" 801 | version = "0.3.30" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 804 | 805 | [[package]] 806 | name = "futures-task" 807 | version = "0.3.30" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 810 | 811 | [[package]] 812 | name = "futures-util" 813 | version = "0.3.30" 814 | source = "registry+https://github.com/rust-lang/crates.io-index" 815 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 816 | dependencies = [ 817 | "futures-core", 818 | "futures-task", 819 | "pin-project-lite", 820 | "pin-utils", 821 | ] 822 | 823 | [[package]] 824 | name = "gimli" 825 | version = "0.28.1" 826 | source = "registry+https://github.com/rust-lang/crates.io-index" 827 | checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" 828 | 829 | [[package]] 830 | name = "glob" 831 | version = "0.3.1" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" 834 | 835 | [[package]] 836 | name = "globset" 837 | version = "0.4.14" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" 840 | dependencies = [ 841 | "aho-corasick", 842 | "bstr", 843 | "log", 844 | "regex-automata", 845 | "regex-syntax", 846 | ] 847 | 848 | [[package]] 849 | name = "globwalk" 850 | version = "0.8.1" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" 853 | dependencies = [ 854 | "bitflags 1.3.2", 855 | "ignore", 856 | "walkdir", 857 | ] 858 | 859 | [[package]] 860 | name = "h2" 861 | version = "0.4.2" 862 | source = "registry+https://github.com/rust-lang/crates.io-index" 863 | checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" 864 | dependencies = [ 865 | "bytes", 866 | "fnv", 867 | "futures-core", 868 | "futures-sink", 869 | "futures-util", 870 | "http", 871 | "indexmap", 872 | "slab", 873 | "tokio", 874 | "tokio-util", 875 | "tracing", 876 | ] 877 | 878 | [[package]] 879 | name = "hash32" 880 | version = "0.3.1" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" 883 | dependencies = [ 884 | "byteorder", 885 | ] 886 | 887 | [[package]] 888 | name = "hashbrown" 889 | version = "0.14.3" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 892 | 893 | [[package]] 894 | name = "heapless" 895 | version = "0.8.0" 896 | source = "registry+https://github.com/rust-lang/crates.io-index" 897 | checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" 898 | dependencies = [ 899 | "hash32", 900 | "serde", 901 | "stable_deref_trait", 902 | ] 903 | 904 | [[package]] 905 | name = "heck" 906 | version = "0.4.1" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 909 | 910 | [[package]] 911 | name = "home" 912 | version = "0.5.9" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" 915 | dependencies = [ 916 | "windows-sys 0.52.0", 917 | ] 918 | 919 | [[package]] 920 | name = "http" 921 | version = "1.0.0" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" 924 | dependencies = [ 925 | "bytes", 926 | "fnv", 927 | "itoa", 928 | ] 929 | 930 | [[package]] 931 | name = "http-body" 932 | version = "1.0.0" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" 935 | dependencies = [ 936 | "bytes", 937 | "http", 938 | ] 939 | 940 | [[package]] 941 | name = "http-body-util" 942 | version = "0.1.0" 943 | source = "registry+https://github.com/rust-lang/crates.io-index" 944 | checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" 945 | dependencies = [ 946 | "bytes", 947 | "futures-util", 948 | "http", 949 | "http-body", 950 | "pin-project-lite", 951 | ] 952 | 953 | [[package]] 954 | name = "httparse" 955 | version = "1.8.0" 956 | source = "registry+https://github.com/rust-lang/crates.io-index" 957 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 958 | 959 | [[package]] 960 | name = "httpdate" 961 | version = "1.0.3" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 964 | 965 | [[package]] 966 | name = "hyper" 967 | version = "1.1.0" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" 970 | dependencies = [ 971 | "bytes", 972 | "futures-channel", 973 | "futures-util", 974 | "h2", 975 | "http", 976 | "http-body", 977 | "httparse", 978 | "httpdate", 979 | "itoa", 980 | "pin-project-lite", 981 | "tokio", 982 | ] 983 | 984 | [[package]] 985 | name = "hyper-util" 986 | version = "0.1.3" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" 989 | dependencies = [ 990 | "bytes", 991 | "futures-util", 992 | "http", 993 | "http-body", 994 | "hyper", 995 | "pin-project-lite", 996 | "socket2", 997 | "tokio", 998 | ] 999 | 1000 | [[package]] 1001 | name = "iana-time-zone" 1002 | version = "0.1.60" 1003 | source = "registry+https://github.com/rust-lang/crates.io-index" 1004 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 1005 | dependencies = [ 1006 | "android_system_properties", 1007 | "core-foundation-sys", 1008 | "iana-time-zone-haiku", 1009 | "js-sys", 1010 | "wasm-bindgen", 1011 | "windows-core", 1012 | ] 1013 | 1014 | [[package]] 1015 | name = "iana-time-zone-haiku" 1016 | version = "0.1.2" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 1019 | dependencies = [ 1020 | "cc", 1021 | ] 1022 | 1023 | [[package]] 1024 | name = "ident_case" 1025 | version = "1.0.1" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 1028 | 1029 | [[package]] 1030 | name = "ignore" 1031 | version = "0.4.22" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" 1034 | dependencies = [ 1035 | "crossbeam-deque", 1036 | "globset", 1037 | "log", 1038 | "memchr", 1039 | "regex-automata", 1040 | "same-file", 1041 | "walkdir", 1042 | "winapi-util", 1043 | ] 1044 | 1045 | [[package]] 1046 | name = "indexmap" 1047 | version = "2.2.3" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" 1050 | dependencies = [ 1051 | "equivalent", 1052 | "hashbrown", 1053 | ] 1054 | 1055 | [[package]] 1056 | name = "itoa" 1057 | version = "1.0.10" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" 1060 | 1061 | [[package]] 1062 | name = "js-sys" 1063 | version = "0.3.68" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" 1066 | dependencies = [ 1067 | "wasm-bindgen", 1068 | ] 1069 | 1070 | [[package]] 1071 | name = "lazy_static" 1072 | version = "1.4.0" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1075 | 1076 | [[package]] 1077 | name = "lazycell" 1078 | version = "1.3.0" 1079 | source = "registry+https://github.com/rust-lang/crates.io-index" 1080 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 1081 | 1082 | [[package]] 1083 | name = "libc" 1084 | version = "0.2.153" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 1087 | 1088 | [[package]] 1089 | name = "libloading" 1090 | version = "0.8.1" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" 1093 | dependencies = [ 1094 | "cfg-if", 1095 | "windows-sys 0.48.0", 1096 | ] 1097 | 1098 | [[package]] 1099 | name = "linux-raw-sys" 1100 | version = "0.4.13" 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" 1102 | checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" 1103 | 1104 | [[package]] 1105 | name = "log" 1106 | version = "0.4.20" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" 1109 | 1110 | [[package]] 1111 | name = "matchit" 1112 | version = "0.7.3" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 1115 | 1116 | [[package]] 1117 | name = "memchr" 1118 | version = "2.7.1" 1119 | source = "registry+https://github.com/rust-lang/crates.io-index" 1120 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 1121 | 1122 | [[package]] 1123 | name = "mime" 1124 | version = "0.3.17" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 1127 | 1128 | [[package]] 1129 | name = "minimal-lexical" 1130 | version = "0.2.1" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1133 | 1134 | [[package]] 1135 | name = "miniz_oxide" 1136 | version = "0.7.2" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" 1139 | dependencies = [ 1140 | "adler", 1141 | ] 1142 | 1143 | [[package]] 1144 | name = "mio" 1145 | version = "0.8.10" 1146 | source = "registry+https://github.com/rust-lang/crates.io-index" 1147 | checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" 1148 | dependencies = [ 1149 | "libc", 1150 | "wasi", 1151 | "windows-sys 0.48.0", 1152 | ] 1153 | 1154 | [[package]] 1155 | name = "nb" 1156 | version = "0.1.3" 1157 | source = "registry+https://github.com/rust-lang/crates.io-index" 1158 | checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" 1159 | dependencies = [ 1160 | "nb 1.1.0", 1161 | ] 1162 | 1163 | [[package]] 1164 | name = "nb" 1165 | version = "1.1.0" 1166 | source = "registry+https://github.com/rust-lang/crates.io-index" 1167 | checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" 1168 | 1169 | [[package]] 1170 | name = "nix" 1171 | version = "0.26.4" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" 1174 | dependencies = [ 1175 | "bitflags 1.3.2", 1176 | "cfg-if", 1177 | "libc", 1178 | ] 1179 | 1180 | [[package]] 1181 | name = "no-std-net" 1182 | version = "0.5.0" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "1bcece43b12349917e096cddfa66107277f123e6c96a5aea78711dc601a47152" 1185 | dependencies = [ 1186 | "serde", 1187 | ] 1188 | 1189 | [[package]] 1190 | name = "nom" 1191 | version = "7.1.3" 1192 | source = "registry+https://github.com/rust-lang/crates.io-index" 1193 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 1194 | dependencies = [ 1195 | "memchr", 1196 | "minimal-lexical", 1197 | ] 1198 | 1199 | [[package]] 1200 | name = "normpath" 1201 | version = "1.2.0" 1202 | source = "registry+https://github.com/rust-lang/crates.io-index" 1203 | checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" 1204 | dependencies = [ 1205 | "windows-sys 0.52.0", 1206 | ] 1207 | 1208 | [[package]] 1209 | name = "num-traits" 1210 | version = "0.2.18" 1211 | source = "registry+https://github.com/rust-lang/crates.io-index" 1212 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 1213 | dependencies = [ 1214 | "autocfg", 1215 | ] 1216 | 1217 | [[package]] 1218 | name = "num_enum" 1219 | version = "0.7.2" 1220 | source = "registry+https://github.com/rust-lang/crates.io-index" 1221 | checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" 1222 | dependencies = [ 1223 | "num_enum_derive", 1224 | ] 1225 | 1226 | [[package]] 1227 | name = "num_enum_derive" 1228 | version = "0.7.2" 1229 | source = "registry+https://github.com/rust-lang/crates.io-index" 1230 | checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" 1231 | dependencies = [ 1232 | "proc-macro-crate", 1233 | "proc-macro2", 1234 | "quote", 1235 | "syn 2.0.49", 1236 | ] 1237 | 1238 | [[package]] 1239 | name = "object" 1240 | version = "0.32.2" 1241 | source = "registry+https://github.com/rust-lang/crates.io-index" 1242 | checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" 1243 | dependencies = [ 1244 | "memchr", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "once_cell" 1249 | version = "1.19.0" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 1252 | 1253 | [[package]] 1254 | name = "panic-halt" 1255 | version = "0.2.0" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "de96540e0ebde571dc55c73d60ef407c653844e6f9a1e2fdbd40c07b9252d812" 1258 | 1259 | [[package]] 1260 | name = "peeking_take_while" 1261 | version = "0.1.2" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" 1264 | 1265 | [[package]] 1266 | name = "percent-encoding" 1267 | version = "2.3.1" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 1270 | 1271 | [[package]] 1272 | name = "pin-project" 1273 | version = "1.1.4" 1274 | source = "registry+https://github.com/rust-lang/crates.io-index" 1275 | checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" 1276 | dependencies = [ 1277 | "pin-project-internal", 1278 | ] 1279 | 1280 | [[package]] 1281 | name = "pin-project-internal" 1282 | version = "1.1.4" 1283 | source = "registry+https://github.com/rust-lang/crates.io-index" 1284 | checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" 1285 | dependencies = [ 1286 | "proc-macro2", 1287 | "quote", 1288 | "syn 2.0.49", 1289 | ] 1290 | 1291 | [[package]] 1292 | name = "pin-project-lite" 1293 | version = "0.2.13" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 1296 | 1297 | [[package]] 1298 | name = "pin-utils" 1299 | version = "0.1.0" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1302 | 1303 | [[package]] 1304 | name = "proc-macro-crate" 1305 | version = "3.1.0" 1306 | source = "registry+https://github.com/rust-lang/crates.io-index" 1307 | checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" 1308 | dependencies = [ 1309 | "toml_edit", 1310 | ] 1311 | 1312 | [[package]] 1313 | name = "proc-macro-error" 1314 | version = "1.0.4" 1315 | source = "registry+https://github.com/rust-lang/crates.io-index" 1316 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1317 | dependencies = [ 1318 | "proc-macro-error-attr", 1319 | "proc-macro2", 1320 | "quote", 1321 | "syn 1.0.109", 1322 | "version_check", 1323 | ] 1324 | 1325 | [[package]] 1326 | name = "proc-macro-error-attr" 1327 | version = "1.0.4" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1330 | dependencies = [ 1331 | "proc-macro2", 1332 | "quote", 1333 | "version_check", 1334 | ] 1335 | 1336 | [[package]] 1337 | name = "proc-macro2" 1338 | version = "1.0.78" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" 1341 | dependencies = [ 1342 | "unicode-ident", 1343 | ] 1344 | 1345 | [[package]] 1346 | name = "quote" 1347 | version = "1.0.35" 1348 | source = "registry+https://github.com/rust-lang/crates.io-index" 1349 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 1350 | dependencies = [ 1351 | "proc-macro2", 1352 | ] 1353 | 1354 | [[package]] 1355 | name = "redox_syscall" 1356 | version = "0.4.1" 1357 | source = "registry+https://github.com/rust-lang/crates.io-index" 1358 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 1359 | dependencies = [ 1360 | "bitflags 1.3.2", 1361 | ] 1362 | 1363 | [[package]] 1364 | name = "regex" 1365 | version = "1.10.3" 1366 | source = "registry+https://github.com/rust-lang/crates.io-index" 1367 | checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" 1368 | dependencies = [ 1369 | "aho-corasick", 1370 | "memchr", 1371 | "regex-automata", 1372 | "regex-syntax", 1373 | ] 1374 | 1375 | [[package]] 1376 | name = "regex-automata" 1377 | version = "0.4.5" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" 1380 | dependencies = [ 1381 | "aho-corasick", 1382 | "memchr", 1383 | "regex-syntax", 1384 | ] 1385 | 1386 | [[package]] 1387 | name = "regex-syntax" 1388 | version = "0.8.2" 1389 | source = "registry+https://github.com/rust-lang/crates.io-index" 1390 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" 1391 | 1392 | [[package]] 1393 | name = "remove_dir_all" 1394 | version = "0.8.2" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "23895cfadc1917fed9c6ed76a8c2903615fa3704f7493ff82b364c6540acc02b" 1397 | dependencies = [ 1398 | "aligned", 1399 | "cfg-if", 1400 | "cvt", 1401 | "fs_at", 1402 | "lazy_static", 1403 | "libc", 1404 | "normpath", 1405 | "windows-sys 0.45.0", 1406 | ] 1407 | 1408 | [[package]] 1409 | name = "rustc-demangle" 1410 | version = "0.1.23" 1411 | source = "registry+https://github.com/rust-lang/crates.io-index" 1412 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 1413 | 1414 | [[package]] 1415 | name = "rustc-hash" 1416 | version = "1.1.0" 1417 | source = "registry+https://github.com/rust-lang/crates.io-index" 1418 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1419 | 1420 | [[package]] 1421 | name = "rustix" 1422 | version = "0.38.31" 1423 | source = "registry+https://github.com/rust-lang/crates.io-index" 1424 | checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" 1425 | dependencies = [ 1426 | "bitflags 2.4.2", 1427 | "errno", 1428 | "libc", 1429 | "linux-raw-sys", 1430 | "windows-sys 0.52.0", 1431 | ] 1432 | 1433 | [[package]] 1434 | name = "rustversion" 1435 | version = "1.0.14" 1436 | source = "registry+https://github.com/rust-lang/crates.io-index" 1437 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1438 | 1439 | [[package]] 1440 | name = "ryu" 1441 | version = "1.0.16" 1442 | source = "registry+https://github.com/rust-lang/crates.io-index" 1443 | checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" 1444 | 1445 | [[package]] 1446 | name = "safe-lock" 1447 | version = "0.1.3" 1448 | source = "registry+https://github.com/rust-lang/crates.io-index" 1449 | checksum = "077d73db7973cccf63eb4aff1e5a34dc2459baa867512088269ea5f2f4253c90" 1450 | 1451 | [[package]] 1452 | name = "safe-proc-macro2" 1453 | version = "1.0.67" 1454 | source = "registry+https://github.com/rust-lang/crates.io-index" 1455 | checksum = "7fd85be67db87168aa3c13fd0da99f48f2ab005dccad5af5626138dc1df20eb6" 1456 | dependencies = [ 1457 | "unicode-ident", 1458 | ] 1459 | 1460 | [[package]] 1461 | name = "safe-quote" 1462 | version = "1.0.15" 1463 | source = "registry+https://github.com/rust-lang/crates.io-index" 1464 | checksum = "77e530f7831f3feafcd5f1aae406ac205dd998436b4007c8e80f03eca78a88f7" 1465 | dependencies = [ 1466 | "safe-proc-macro2", 1467 | ] 1468 | 1469 | [[package]] 1470 | name = "safe-regex" 1471 | version = "0.2.5" 1472 | source = "registry+https://github.com/rust-lang/crates.io-index" 1473 | checksum = "a15289bf322e0673d52756a18194167f2378ec1a15fe884af6e2d2cb934822b0" 1474 | dependencies = [ 1475 | "safe-regex-macro", 1476 | ] 1477 | 1478 | [[package]] 1479 | name = "safe-regex-compiler" 1480 | version = "0.2.5" 1481 | source = "registry+https://github.com/rust-lang/crates.io-index" 1482 | checksum = "fba76fae590a2aa665279deb1f57b5098cbace01a0c5e60e262fcf55f7c51542" 1483 | dependencies = [ 1484 | "safe-proc-macro2", 1485 | "safe-quote", 1486 | ] 1487 | 1488 | [[package]] 1489 | name = "safe-regex-macro" 1490 | version = "0.2.5" 1491 | source = "registry+https://github.com/rust-lang/crates.io-index" 1492 | checksum = "96c2e96b5c03f158d1b16ba79af515137795f4ad4e8de3f790518aae91f1d127" 1493 | dependencies = [ 1494 | "safe-proc-macro2", 1495 | "safe-regex-compiler", 1496 | ] 1497 | 1498 | [[package]] 1499 | name = "same-file" 1500 | version = "1.0.6" 1501 | source = "registry+https://github.com/rust-lang/crates.io-index" 1502 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1503 | dependencies = [ 1504 | "winapi-util", 1505 | ] 1506 | 1507 | [[package]] 1508 | name = "semver" 1509 | version = "1.0.21" 1510 | source = "registry+https://github.com/rust-lang/crates.io-index" 1511 | checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" 1512 | dependencies = [ 1513 | "serde", 1514 | ] 1515 | 1516 | [[package]] 1517 | name = "serde" 1518 | version = "1.0.196" 1519 | source = "registry+https://github.com/rust-lang/crates.io-index" 1520 | checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" 1521 | dependencies = [ 1522 | "serde_derive", 1523 | ] 1524 | 1525 | [[package]] 1526 | name = "serde_derive" 1527 | version = "1.0.196" 1528 | source = "registry+https://github.com/rust-lang/crates.io-index" 1529 | checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" 1530 | dependencies = [ 1531 | "proc-macro2", 1532 | "quote", 1533 | "syn 2.0.49", 1534 | ] 1535 | 1536 | [[package]] 1537 | name = "serde_json" 1538 | version = "1.0.113" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" 1541 | dependencies = [ 1542 | "itoa", 1543 | "ryu", 1544 | "serde", 1545 | ] 1546 | 1547 | [[package]] 1548 | name = "serde_path_to_error" 1549 | version = "0.1.15" 1550 | source = "registry+https://github.com/rust-lang/crates.io-index" 1551 | checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" 1552 | dependencies = [ 1553 | "itoa", 1554 | "serde", 1555 | ] 1556 | 1557 | [[package]] 1558 | name = "serde_urlencoded" 1559 | version = "0.7.1" 1560 | source = "registry+https://github.com/rust-lang/crates.io-index" 1561 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1562 | dependencies = [ 1563 | "form_urlencoded", 1564 | "itoa", 1565 | "ryu", 1566 | "serde", 1567 | ] 1568 | 1569 | [[package]] 1570 | name = "shlex" 1571 | version = "1.3.0" 1572 | source = "registry+https://github.com/rust-lang/crates.io-index" 1573 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1574 | 1575 | [[package]] 1576 | name = "slab" 1577 | version = "0.4.9" 1578 | source = "registry+https://github.com/rust-lang/crates.io-index" 1579 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1580 | dependencies = [ 1581 | "autocfg", 1582 | ] 1583 | 1584 | [[package]] 1585 | name = "socket2" 1586 | version = "0.5.5" 1587 | source = "registry+https://github.com/rust-lang/crates.io-index" 1588 | checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" 1589 | dependencies = [ 1590 | "libc", 1591 | "windows-sys 0.48.0", 1592 | ] 1593 | 1594 | [[package]] 1595 | name = "stable_deref_trait" 1596 | version = "1.2.0" 1597 | source = "registry+https://github.com/rust-lang/crates.io-index" 1598 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1599 | 1600 | [[package]] 1601 | name = "strum" 1602 | version = "0.24.1" 1603 | source = "registry+https://github.com/rust-lang/crates.io-index" 1604 | checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" 1605 | dependencies = [ 1606 | "strum_macros 0.24.3", 1607 | ] 1608 | 1609 | [[package]] 1610 | name = "strum" 1611 | version = "0.25.0" 1612 | source = "registry+https://github.com/rust-lang/crates.io-index" 1613 | checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" 1614 | dependencies = [ 1615 | "strum_macros 0.25.3", 1616 | ] 1617 | 1618 | [[package]] 1619 | name = "strum_macros" 1620 | version = "0.24.3" 1621 | source = "registry+https://github.com/rust-lang/crates.io-index" 1622 | checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" 1623 | dependencies = [ 1624 | "heck", 1625 | "proc-macro2", 1626 | "quote", 1627 | "rustversion", 1628 | "syn 1.0.109", 1629 | ] 1630 | 1631 | [[package]] 1632 | name = "strum_macros" 1633 | version = "0.25.3" 1634 | source = "registry+https://github.com/rust-lang/crates.io-index" 1635 | checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" 1636 | dependencies = [ 1637 | "heck", 1638 | "proc-macro2", 1639 | "quote", 1640 | "rustversion", 1641 | "syn 2.0.49", 1642 | ] 1643 | 1644 | [[package]] 1645 | name = "syn" 1646 | version = "1.0.109" 1647 | source = "registry+https://github.com/rust-lang/crates.io-index" 1648 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1649 | dependencies = [ 1650 | "proc-macro2", 1651 | "quote", 1652 | "unicode-ident", 1653 | ] 1654 | 1655 | [[package]] 1656 | name = "syn" 1657 | version = "2.0.49" 1658 | source = "registry+https://github.com/rust-lang/crates.io-index" 1659 | checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" 1660 | dependencies = [ 1661 | "proc-macro2", 1662 | "quote", 1663 | "unicode-ident", 1664 | ] 1665 | 1666 | [[package]] 1667 | name = "sync_wrapper" 1668 | version = "0.1.2" 1669 | source = "registry+https://github.com/rust-lang/crates.io-index" 1670 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1671 | 1672 | [[package]] 1673 | name = "tempfile" 1674 | version = "3.10.0" 1675 | source = "registry+https://github.com/rust-lang/crates.io-index" 1676 | checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" 1677 | dependencies = [ 1678 | "cfg-if", 1679 | "fastrand", 1680 | "rustix", 1681 | "windows-sys 0.52.0", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "thiserror" 1686 | version = "1.0.57" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" 1689 | dependencies = [ 1690 | "thiserror-impl", 1691 | ] 1692 | 1693 | [[package]] 1694 | name = "thiserror-impl" 1695 | version = "1.0.57" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" 1698 | dependencies = [ 1699 | "proc-macro2", 1700 | "quote", 1701 | "syn 2.0.49", 1702 | ] 1703 | 1704 | [[package]] 1705 | name = "tokio" 1706 | version = "1.36.0" 1707 | source = "registry+https://github.com/rust-lang/crates.io-index" 1708 | checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" 1709 | dependencies = [ 1710 | "backtrace", 1711 | "bytes", 1712 | "libc", 1713 | "mio", 1714 | "pin-project-lite", 1715 | "socket2", 1716 | "tokio-macros", 1717 | "windows-sys 0.48.0", 1718 | ] 1719 | 1720 | [[package]] 1721 | name = "tokio-macros" 1722 | version = "2.2.0" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" 1725 | dependencies = [ 1726 | "proc-macro2", 1727 | "quote", 1728 | "syn 2.0.49", 1729 | ] 1730 | 1731 | [[package]] 1732 | name = "tokio-util" 1733 | version = "0.7.10" 1734 | source = "registry+https://github.com/rust-lang/crates.io-index" 1735 | checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" 1736 | dependencies = [ 1737 | "bytes", 1738 | "futures-core", 1739 | "futures-sink", 1740 | "pin-project-lite", 1741 | "tokio", 1742 | "tracing", 1743 | ] 1744 | 1745 | [[package]] 1746 | name = "toml_datetime" 1747 | version = "0.6.5" 1748 | source = "registry+https://github.com/rust-lang/crates.io-index" 1749 | checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" 1750 | 1751 | [[package]] 1752 | name = "toml_edit" 1753 | version = "0.21.1" 1754 | source = "registry+https://github.com/rust-lang/crates.io-index" 1755 | checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" 1756 | dependencies = [ 1757 | "indexmap", 1758 | "toml_datetime", 1759 | "winnow", 1760 | ] 1761 | 1762 | [[package]] 1763 | name = "tower" 1764 | version = "0.4.13" 1765 | source = "registry+https://github.com/rust-lang/crates.io-index" 1766 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1767 | dependencies = [ 1768 | "futures-core", 1769 | "futures-util", 1770 | "pin-project", 1771 | "pin-project-lite", 1772 | "tokio", 1773 | "tower-layer", 1774 | "tower-service", 1775 | "tracing", 1776 | ] 1777 | 1778 | [[package]] 1779 | name = "tower-layer" 1780 | version = "0.3.2" 1781 | source = "registry+https://github.com/rust-lang/crates.io-index" 1782 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1783 | 1784 | [[package]] 1785 | name = "tower-service" 1786 | version = "0.3.2" 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" 1788 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1789 | 1790 | [[package]] 1791 | name = "tracing" 1792 | version = "0.1.40" 1793 | source = "registry+https://github.com/rust-lang/crates.io-index" 1794 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1795 | dependencies = [ 1796 | "log", 1797 | "pin-project-lite", 1798 | "tracing-core", 1799 | ] 1800 | 1801 | [[package]] 1802 | name = "tracing-core" 1803 | version = "0.1.32" 1804 | source = "registry+https://github.com/rust-lang/crates.io-index" 1805 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1806 | dependencies = [ 1807 | "once_cell", 1808 | ] 1809 | 1810 | [[package]] 1811 | name = "uncased" 1812 | version = "0.9.10" 1813 | source = "registry+https://github.com/rust-lang/crates.io-index" 1814 | checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" 1815 | dependencies = [ 1816 | "version_check", 1817 | ] 1818 | 1819 | [[package]] 1820 | name = "unicode-ident" 1821 | version = "1.0.12" 1822 | source = "registry+https://github.com/rust-lang/crates.io-index" 1823 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1824 | 1825 | [[package]] 1826 | name = "unicode-xid" 1827 | version = "0.2.4" 1828 | source = "registry+https://github.com/rust-lang/crates.io-index" 1829 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 1830 | 1831 | [[package]] 1832 | name = "version_check" 1833 | version = "0.9.4" 1834 | source = "registry+https://github.com/rust-lang/crates.io-index" 1835 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1836 | 1837 | [[package]] 1838 | name = "void" 1839 | version = "1.0.2" 1840 | source = "registry+https://github.com/rust-lang/crates.io-index" 1841 | checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" 1842 | 1843 | [[package]] 1844 | name = "walkdir" 1845 | version = "2.4.0" 1846 | source = "registry+https://github.com/rust-lang/crates.io-index" 1847 | checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" 1848 | dependencies = [ 1849 | "same-file", 1850 | "winapi-util", 1851 | ] 1852 | 1853 | [[package]] 1854 | name = "wasi" 1855 | version = "0.11.0+wasi-snapshot-preview1" 1856 | source = "registry+https://github.com/rust-lang/crates.io-index" 1857 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1858 | 1859 | [[package]] 1860 | name = "wasm-bindgen" 1861 | version = "0.2.91" 1862 | source = "registry+https://github.com/rust-lang/crates.io-index" 1863 | checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" 1864 | dependencies = [ 1865 | "cfg-if", 1866 | "wasm-bindgen-macro", 1867 | ] 1868 | 1869 | [[package]] 1870 | name = "wasm-bindgen-backend" 1871 | version = "0.2.91" 1872 | source = "registry+https://github.com/rust-lang/crates.io-index" 1873 | checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" 1874 | dependencies = [ 1875 | "bumpalo", 1876 | "log", 1877 | "once_cell", 1878 | "proc-macro2", 1879 | "quote", 1880 | "syn 2.0.49", 1881 | "wasm-bindgen-shared", 1882 | ] 1883 | 1884 | [[package]] 1885 | name = "wasm-bindgen-macro" 1886 | version = "0.2.91" 1887 | source = "registry+https://github.com/rust-lang/crates.io-index" 1888 | checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" 1889 | dependencies = [ 1890 | "quote", 1891 | "wasm-bindgen-macro-support", 1892 | ] 1893 | 1894 | [[package]] 1895 | name = "wasm-bindgen-macro-support" 1896 | version = "0.2.91" 1897 | source = "registry+https://github.com/rust-lang/crates.io-index" 1898 | checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" 1899 | dependencies = [ 1900 | "proc-macro2", 1901 | "quote", 1902 | "syn 2.0.49", 1903 | "wasm-bindgen-backend", 1904 | "wasm-bindgen-shared", 1905 | ] 1906 | 1907 | [[package]] 1908 | name = "wasm-bindgen-shared" 1909 | version = "0.2.91" 1910 | source = "registry+https://github.com/rust-lang/crates.io-index" 1911 | checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" 1912 | 1913 | [[package]] 1914 | name = "which" 1915 | version = "4.4.2" 1916 | source = "registry+https://github.com/rust-lang/crates.io-index" 1917 | checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" 1918 | dependencies = [ 1919 | "either", 1920 | "home", 1921 | "once_cell", 1922 | "rustix", 1923 | ] 1924 | 1925 | [[package]] 1926 | name = "winapi" 1927 | version = "0.3.9" 1928 | source = "registry+https://github.com/rust-lang/crates.io-index" 1929 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1930 | dependencies = [ 1931 | "winapi-i686-pc-windows-gnu", 1932 | "winapi-x86_64-pc-windows-gnu", 1933 | ] 1934 | 1935 | [[package]] 1936 | name = "winapi-i686-pc-windows-gnu" 1937 | version = "0.4.0" 1938 | source = "registry+https://github.com/rust-lang/crates.io-index" 1939 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1940 | 1941 | [[package]] 1942 | name = "winapi-util" 1943 | version = "0.1.6" 1944 | source = "registry+https://github.com/rust-lang/crates.io-index" 1945 | checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" 1946 | dependencies = [ 1947 | "winapi", 1948 | ] 1949 | 1950 | [[package]] 1951 | name = "winapi-x86_64-pc-windows-gnu" 1952 | version = "0.4.0" 1953 | source = "registry+https://github.com/rust-lang/crates.io-index" 1954 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1955 | 1956 | [[package]] 1957 | name = "windows-core" 1958 | version = "0.52.0" 1959 | source = "registry+https://github.com/rust-lang/crates.io-index" 1960 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1961 | dependencies = [ 1962 | "windows-targets 0.52.0", 1963 | ] 1964 | 1965 | [[package]] 1966 | name = "windows-sys" 1967 | version = "0.45.0" 1968 | source = "registry+https://github.com/rust-lang/crates.io-index" 1969 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1970 | dependencies = [ 1971 | "windows-targets 0.42.2", 1972 | ] 1973 | 1974 | [[package]] 1975 | name = "windows-sys" 1976 | version = "0.48.0" 1977 | source = "registry+https://github.com/rust-lang/crates.io-index" 1978 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1979 | dependencies = [ 1980 | "windows-targets 0.48.5", 1981 | ] 1982 | 1983 | [[package]] 1984 | name = "windows-sys" 1985 | version = "0.52.0" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1988 | dependencies = [ 1989 | "windows-targets 0.52.0", 1990 | ] 1991 | 1992 | [[package]] 1993 | name = "windows-targets" 1994 | version = "0.42.2" 1995 | source = "registry+https://github.com/rust-lang/crates.io-index" 1996 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 1997 | dependencies = [ 1998 | "windows_aarch64_gnullvm 0.42.2", 1999 | "windows_aarch64_msvc 0.42.2", 2000 | "windows_i686_gnu 0.42.2", 2001 | "windows_i686_msvc 0.42.2", 2002 | "windows_x86_64_gnu 0.42.2", 2003 | "windows_x86_64_gnullvm 0.42.2", 2004 | "windows_x86_64_msvc 0.42.2", 2005 | ] 2006 | 2007 | [[package]] 2008 | name = "windows-targets" 2009 | version = "0.48.5" 2010 | source = "registry+https://github.com/rust-lang/crates.io-index" 2011 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 2012 | dependencies = [ 2013 | "windows_aarch64_gnullvm 0.48.5", 2014 | "windows_aarch64_msvc 0.48.5", 2015 | "windows_i686_gnu 0.48.5", 2016 | "windows_i686_msvc 0.48.5", 2017 | "windows_x86_64_gnu 0.48.5", 2018 | "windows_x86_64_gnullvm 0.48.5", 2019 | "windows_x86_64_msvc 0.48.5", 2020 | ] 2021 | 2022 | [[package]] 2023 | name = "windows-targets" 2024 | version = "0.52.0" 2025 | source = "registry+https://github.com/rust-lang/crates.io-index" 2026 | checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" 2027 | dependencies = [ 2028 | "windows_aarch64_gnullvm 0.52.0", 2029 | "windows_aarch64_msvc 0.52.0", 2030 | "windows_i686_gnu 0.52.0", 2031 | "windows_i686_msvc 0.52.0", 2032 | "windows_x86_64_gnu 0.52.0", 2033 | "windows_x86_64_gnullvm 0.52.0", 2034 | "windows_x86_64_msvc 0.52.0", 2035 | ] 2036 | 2037 | [[package]] 2038 | name = "windows_aarch64_gnullvm" 2039 | version = "0.42.2" 2040 | source = "registry+https://github.com/rust-lang/crates.io-index" 2041 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 2042 | 2043 | [[package]] 2044 | name = "windows_aarch64_gnullvm" 2045 | version = "0.48.5" 2046 | source = "registry+https://github.com/rust-lang/crates.io-index" 2047 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 2048 | 2049 | [[package]] 2050 | name = "windows_aarch64_gnullvm" 2051 | version = "0.52.0" 2052 | source = "registry+https://github.com/rust-lang/crates.io-index" 2053 | checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" 2054 | 2055 | [[package]] 2056 | name = "windows_aarch64_msvc" 2057 | version = "0.42.2" 2058 | source = "registry+https://github.com/rust-lang/crates.io-index" 2059 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 2060 | 2061 | [[package]] 2062 | name = "windows_aarch64_msvc" 2063 | version = "0.48.5" 2064 | source = "registry+https://github.com/rust-lang/crates.io-index" 2065 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 2066 | 2067 | [[package]] 2068 | name = "windows_aarch64_msvc" 2069 | version = "0.52.0" 2070 | source = "registry+https://github.com/rust-lang/crates.io-index" 2071 | checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" 2072 | 2073 | [[package]] 2074 | name = "windows_i686_gnu" 2075 | version = "0.42.2" 2076 | source = "registry+https://github.com/rust-lang/crates.io-index" 2077 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 2078 | 2079 | [[package]] 2080 | name = "windows_i686_gnu" 2081 | version = "0.48.5" 2082 | source = "registry+https://github.com/rust-lang/crates.io-index" 2083 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 2084 | 2085 | [[package]] 2086 | name = "windows_i686_gnu" 2087 | version = "0.52.0" 2088 | source = "registry+https://github.com/rust-lang/crates.io-index" 2089 | checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" 2090 | 2091 | [[package]] 2092 | name = "windows_i686_msvc" 2093 | version = "0.42.2" 2094 | source = "registry+https://github.com/rust-lang/crates.io-index" 2095 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 2096 | 2097 | [[package]] 2098 | name = "windows_i686_msvc" 2099 | version = "0.48.5" 2100 | source = "registry+https://github.com/rust-lang/crates.io-index" 2101 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 2102 | 2103 | [[package]] 2104 | name = "windows_i686_msvc" 2105 | version = "0.52.0" 2106 | source = "registry+https://github.com/rust-lang/crates.io-index" 2107 | checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" 2108 | 2109 | [[package]] 2110 | name = "windows_x86_64_gnu" 2111 | version = "0.42.2" 2112 | source = "registry+https://github.com/rust-lang/crates.io-index" 2113 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 2114 | 2115 | [[package]] 2116 | name = "windows_x86_64_gnu" 2117 | version = "0.48.5" 2118 | source = "registry+https://github.com/rust-lang/crates.io-index" 2119 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 2120 | 2121 | [[package]] 2122 | name = "windows_x86_64_gnu" 2123 | version = "0.52.0" 2124 | source = "registry+https://github.com/rust-lang/crates.io-index" 2125 | checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" 2126 | 2127 | [[package]] 2128 | name = "windows_x86_64_gnullvm" 2129 | version = "0.42.2" 2130 | source = "registry+https://github.com/rust-lang/crates.io-index" 2131 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 2132 | 2133 | [[package]] 2134 | name = "windows_x86_64_gnullvm" 2135 | version = "0.48.5" 2136 | source = "registry+https://github.com/rust-lang/crates.io-index" 2137 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 2138 | 2139 | [[package]] 2140 | name = "windows_x86_64_gnullvm" 2141 | version = "0.52.0" 2142 | source = "registry+https://github.com/rust-lang/crates.io-index" 2143 | checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" 2144 | 2145 | [[package]] 2146 | name = "windows_x86_64_msvc" 2147 | version = "0.42.2" 2148 | source = "registry+https://github.com/rust-lang/crates.io-index" 2149 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 2150 | 2151 | [[package]] 2152 | name = "windows_x86_64_msvc" 2153 | version = "0.48.5" 2154 | source = "registry+https://github.com/rust-lang/crates.io-index" 2155 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 2156 | 2157 | [[package]] 2158 | name = "windows_x86_64_msvc" 2159 | version = "0.52.0" 2160 | source = "registry+https://github.com/rust-lang/crates.io-index" 2161 | checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" 2162 | 2163 | [[package]] 2164 | name = "winnow" 2165 | version = "0.5.40" 2166 | source = "registry+https://github.com/rust-lang/crates.io-index" 2167 | checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" 2168 | dependencies = [ 2169 | "memchr", 2170 | ] 2171 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "esp32axum" 3 | version = "0.0.1" 4 | authors = ["Gábor Gyebnár "] 5 | edition = "2021" 6 | 7 | [dependencies] 8 | panic-halt = "0" 9 | anyhow = "1" 10 | axum = { version = "0", features = ["http1", "json"] } 11 | axum-macros = "0" 12 | heapless = "0.8.0" 13 | embedded-hal = "1" 14 | embedded-svc = { version = "0", features = ["experimental"] } 15 | esp-idf-sys = { version = "0", features = ["binstart"] } 16 | esp-idf-svc = { version = "0", features = ["alloc", "experimental"] } 17 | esp-idf-hal = "0" 18 | log = "0" 19 | serde = "1" 20 | serde_json = "1" 21 | tokio = { version = "1", features = ["rt", "net", "io-util", "macros"] } 22 | 23 | [build-dependencies] 24 | build-data = "0" 25 | embuild = "0" 26 | anyhow = "1" 27 | 28 | [profile.release] 29 | debug = false 30 | opt-level = "s" 31 | #lto = "fat" 32 | strip = true 33 | panic = "abort" 34 | 35 | [profile.dev] 36 | debug = true 37 | opt-level = 2 38 | lto = "off" 39 | 40 | [package.metadata.espflash] 41 | partition_table = "./partitions.csv" 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rust + Tokio + Axum on ESP32-S3 2 | 3 | This is an example application that demonstrates how to use Rust, Tokio and Axum to build a web server on the ESP32-S3 microcontroller. 4 | 5 | ## Quick Start 6 | 7 | You'll need tools: 8 | - `espup` - a tool to install the ESP32 toolchain and other tools 9 | - `cargo-espflash` - a tool to flash the ESP32 10 | 11 | ``` 12 | cargo install espup cargo-espflash 13 | espup install 14 | ``` 15 | 16 | ### Build and run 17 | 18 | 1. Set the WiFi credentials as environment variables. They will be baked into the executable at build time. 19 | - `WIFI_SSID` 20 | - `WIFI_PASS` 21 | 2. This command builds the project and flashes it to the ESP32-S3: 22 | ```sh 23 | cargo espflash flash --release --monitor 24 | ``` 25 | 26 | ### Test it 27 | 28 | Once the ESP32-S3 is connected to your network, it displays the IP address on the serial console. The server runs on port 80. 29 | 30 | ```sh 31 | $ curl http://192.168.0.24/state | jq 32 | { 33 | "counter": 940, 34 | "free_heap": 216452, 35 | "ip_address": "192.168.0.24", 36 | "mac_address": "DC:DA:0C:2A:26:C8", 37 | "message": "Hello from ESP32!" 38 | } 39 | ``` 40 | 41 | ## But is it any good? 42 | 43 | I mean, this is strapping rockets to a bicycle. 44 | 45 | It works if you don't overload it. The ESP32-S3 is a microcontroller with limited resources. The web server can only handle a few requests at a time before it runs out of memory. 46 | 47 | ### Ballpark numbers 48 | - 5 concurrent requests 49 | - 50 requests per second 50 | 51 | If I go over ~5 concurrent requests, IDF runs out of memory and crashes. 52 | 53 | Axum wasn't designed for microcontrollers to put it mildly. It's actually a miracle it works at all. I did this for science. We do what we must because we can. 54 | 55 | 56 | ### Alternatives 57 | 58 | Besides Axum, Warp also works. It uses somewhat less memory, so you can maybe throw a few more requests at it. 59 | 60 | At the time of writing this, Rocket and Actix-web don't work since they require Tokio's `rt-multi-thread` feature which doesn't compile on EPS32 yet. 61 | 62 | Honestly, just use MQTT or something. It's a microcontroller, not a server. 63 | 64 | 65 | ## Other ESP32 chips 66 | 67 | See `.cargo/config.toml` for the list of supported chips. Set the `target` to the chip you're using. 68 | 69 | ## Acknowledgements 70 | 71 | This project is heavily inspired by Sami J. Mäkinen's [esp32temp](https://github.com/sjm42/esp32temp). Thanks for figuring out how to make this work! 72 | 73 | 74 | ## License 75 | 76 | Whatever. -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | fn main() -> anyhow::Result<()> { 2 | build_data::set_GIT_BRANCH(); 3 | build_data::set_GIT_COMMIT(); 4 | build_data::set_SOURCE_TIMESTAMP(); 5 | build_data::set_RUSTC_VERSION(); 6 | build_data::no_debug_rebuilds(); 7 | 8 | embuild::build::CfgArgs::output_propagated("ESP_IDF")?; 9 | embuild::build::LinkArgs::output_propagated("ESP_IDF")?; 10 | 11 | Ok(()) 12 | } 13 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | future-size-threshold = 128 2 | -------------------------------------------------------------------------------- /partitions.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvs, data, nvs, 0x9000, 0x6000, 4 | phy_init, data, phy, 0xf000, 0x1000, 5 | factory, app, factory, 0x10000, 3M, -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "esp" 3 | components = ["rust-src"] 4 | targets = ["xtensa-esp32s3-espidf"] 5 | -------------------------------------------------------------------------------- /sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y 2 | # CONFIG_LOG_DEFAULT_LEVEL_INFO=y 3 | CONFIG_LOG_DEFAULT_LEVEL=CONFIG_LOG_DEFAULT_LEVEL_INFO 4 | #CONFIG_LOG_DEFAULT_LEVEL=CONFIG_LOG_DEFAULT_LEVEL_VERBOSE 5 | 6 | # Tokio's async runtime needs more stack than the default 8192 bytes. 7 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768 8 | 9 | CONFIG_LWIP_MAX_SOCKETS=16 10 | -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{Context, Result}; 2 | 3 | #[derive(Debug)] 4 | pub struct Config { 5 | pub wifi_ssid: &'static str, 6 | pub wifi_pass: &'static str, 7 | } 8 | 9 | impl Config { 10 | pub fn load() -> Result { 11 | Ok(Self { 12 | wifi_ssid: option_env!("WIFI_SSID") 13 | .context("WIFI_SSID env variable must be set before building the project.")?, 14 | wifi_pass: option_env!("WIFI_PASS") 15 | .context("WIFI_PASS env variable must be set before building the project.")?, 16 | }) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod config; 2 | mod server; 3 | mod wifi; 4 | 5 | use crate::config::Config; 6 | use crate::server::run_server; 7 | use crate::wifi::WifiConnection; 8 | use anyhow::Result; 9 | use esp_idf_hal::prelude::Peripherals; 10 | use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs, timer::EspTaskTimerService}; 11 | use log::{error, info}; 12 | use std::thread::sleep; 13 | 14 | // We can't use #[tokio::main] since we need to initialize eventfd before starting the tokio runtime. 15 | fn main() { 16 | esp_idf_sys::link_patches(); 17 | esp_idf_svc::log::EspLogger::initialize_default(); 18 | esp_idf_svc::io::vfs::initialize_eventfd(1).expect("Failed to initialize eventfd"); 19 | 20 | let rt = tokio::runtime::Builder::new_current_thread() 21 | .enable_all() 22 | .build() 23 | .expect("Failed to build Tokio runtime"); 24 | 25 | match rt.block_on(async { async_main().await }) { 26 | Ok(()) => info!("main() finished, reboot."), 27 | Err(err) => { 28 | error!("{err:?}"); 29 | // Let them read the error message before rebooting 30 | sleep(std::time::Duration::from_secs(3)); 31 | }, 32 | } 33 | 34 | esp_idf_hal::reset::restart(); 35 | } 36 | 37 | async fn async_main() -> Result<()> { 38 | info!("Starting async_main."); 39 | 40 | let config = Config::load()?; 41 | info!("Configuration:\n{config:#?}"); 42 | 43 | let event_loop = EspSystemEventLoop::take()?; 44 | let timer = EspTaskTimerService::new()?; 45 | let peripherals = Peripherals::take()?; 46 | let nvs_default_partition = nvs::EspDefaultNvsPartition::take()?; 47 | 48 | // Initialize the network stack, this must be done before starting the server 49 | let mut wifi_connection = WifiConnection::new( 50 | peripherals.modem, 51 | event_loop, 52 | timer, 53 | Some(nvs_default_partition), 54 | &config, 55 | ) 56 | .await?; 57 | 58 | // Run the server and the wifi keepalive concurrently until one of them fails 59 | tokio::try_join!( 60 | run_server(wifi_connection.state.clone()), 61 | wifi_connection.connect() 62 | )?; 63 | Ok(()) 64 | } 65 | -------------------------------------------------------------------------------- /src/server.rs: -------------------------------------------------------------------------------- 1 | use axum::{extract::State, routing::*, Json, Router}; 2 | use log::info; 3 | use serde_json::{json, Value}; 4 | use std::{net::SocketAddr, sync::Arc}; 5 | use std::sync::atomic::AtomicIsize; 6 | use crate::wifi::WifiState; 7 | 8 | // Shared state that all Axum handlers can access 9 | struct SharedState { 10 | pub counter: AtomicIsize, 11 | pub wifi_state: Arc, 12 | } 13 | 14 | // Starts the server. This function only returns in case of an error. 15 | pub async fn run_server(wifi_state: Arc) -> anyhow::Result<()> { 16 | let state = Arc::new(SharedState { 17 | counter: AtomicIsize::new(0), 18 | wifi_state, 19 | }); 20 | 21 | let addr = "0.0.0.0:80".parse::()?; 22 | let app = Router::new() 23 | .route("/", get(move || async { "Hello!" })) 24 | .route("/state", get(get_state)) 25 | .with_state(state); 26 | 27 | let listener = tokio::net::TcpListener::bind(&addr).await?; 28 | info!("API server listening on {addr:?}"); 29 | Ok(axum::serve(listener, app.into_make_service()).await?) 30 | } 31 | 32 | // Handler for the /state route 33 | async fn get_state(State(state): State>) -> Json { 34 | let ip = state.wifi_state.ip_addr().await; 35 | let mac = state.wifi_state.mac_address.clone(); 36 | let counter = state.counter.fetch_add(1, std::sync::atomic::Ordering::SeqCst); 37 | Json(json!({ 38 | "message": "Hello from ESP32!", 39 | "free_heap": unsafe { esp_idf_sys::esp_get_free_heap_size() }, 40 | "ip_address": ip, 41 | "mac_address": mac, 42 | "counter": counter, 43 | })) 44 | } 45 | -------------------------------------------------------------------------------- /src/wifi.rs: -------------------------------------------------------------------------------- 1 | use crate::config::Config; 2 | use anyhow::{anyhow, Result}; 3 | use embedded_svc::wifi::{ClientConfiguration, Configuration}; 4 | use esp_idf_hal::modem::Modem; 5 | use esp_idf_svc::nvs::EspDefaultNvsPartition; 6 | use esp_idf_svc::{ 7 | eventloop::{EspEventLoop, System}, 8 | ipv4, 9 | netif::{self, EspNetif}, 10 | timer::{EspTimerService, Task}, 11 | wifi::{AsyncWifi, EspWifi, WifiDriver}, 12 | }; 13 | use esp_idf_sys::{self as _}; 14 | use log::{info, warn}; 15 | use std::net::Ipv4Addr; 16 | use std::str::FromStr; 17 | use std::sync::Arc; 18 | use tokio::sync::RwLock; 19 | use tokio::time::{sleep, Duration}; 20 | 21 | // Shared state of the Wi-Fi connection. 22 | pub struct WifiState { 23 | pub mac_address: String, 24 | pub ssid: String, 25 | ip_addr: RwLock>, 26 | } 27 | 28 | impl WifiState { 29 | pub async fn ip_addr(&self) -> Option { 30 | *self.ip_addr.read().await 31 | } 32 | } 33 | 34 | // Wrapper around the Wi-Fi connection. 35 | pub struct WifiConnection<'a> { 36 | pub state: Arc, 37 | wifi: AsyncWifi>, 38 | } 39 | 40 | impl<'a> WifiConnection<'a> { 41 | // Initialize the Wi-Fi driver but do not connect yet. 42 | pub async fn new( 43 | modem: Modem, 44 | event_loop: EspEventLoop, 45 | timer: EspTimerService, 46 | default_partition: Option, 47 | config: &Config, 48 | ) -> Result { 49 | info!("Initializing..."); 50 | 51 | let wifi_driver = WifiDriver::new(modem, event_loop.clone(), default_partition)?; 52 | let ipv4_config = ipv4::ClientConfiguration::DHCP(ipv4::DHCPClientSettings::default()); 53 | let net_if = EspNetif::new_with_conf(&netif::NetifConfiguration { 54 | ip_configuration: ipv4::Configuration::Client(ipv4_config), 55 | ..netif::NetifConfiguration::wifi_default_client() 56 | })?; 57 | 58 | // Store the MAC address in the shared wifi state 59 | let mac = net_if.get_mac()?; 60 | let mac_address = format!( 61 | "{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}", 62 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] 63 | ); 64 | let state = Arc::new(WifiState { 65 | ip_addr: RwLock::new(None), 66 | mac_address, 67 | ssid: config.wifi_ssid.to_string(), 68 | }); 69 | 70 | // Wrap the Wi-Fi driver in the async wrapper 71 | let esp_wifi = 72 | EspWifi::wrap_all(wifi_driver, net_if, EspNetif::new(netif::NetifStack::Ap)?)?; 73 | let mut wifi = AsyncWifi::wrap(esp_wifi, event_loop, timer.clone())?; 74 | 75 | // Set the Wi-Fi configuration 76 | info!("Setting credentials..."); 77 | let client_config = ClientConfiguration { 78 | ssid: heapless::String::from_str(config.wifi_ssid) 79 | .map_err(|_| anyhow!("SSID is too long."))?, 80 | password: heapless::String::from_str(config.wifi_pass) 81 | .map_err(|_| anyhow!("Wifi password is too long."))?, 82 | ..Default::default() 83 | }; 84 | wifi.set_configuration(&Configuration::Client(client_config))?; 85 | 86 | info!("Starting..."); 87 | wifi.start().await?; 88 | 89 | info!("Wi-Fi driver started successfully."); 90 | Ok(Self { state, wifi }) 91 | } 92 | 93 | // Connect to Wi-Fi and stay connected. This function will loop forever. 94 | pub async fn connect(&mut self) -> anyhow::Result<()> { 95 | loop { 96 | info!("Connecting to SSID '{}'...", self.state.ssid); 97 | if let Err(err) = self.wifi.connect().await { 98 | warn!("Connection failed: {err:?}"); 99 | self.wifi.disconnect().await?; 100 | sleep(Duration::from_secs(1)).await; 101 | continue; 102 | } 103 | 104 | info!("Acquiring IP address..."); 105 | let timeout = Some(Duration::from_secs(10)); 106 | if let Err(err) = self.wifi.ip_wait_while(|w| w.is_up().map(|s| !s), timeout).await { 107 | warn!("IP association failed: {err:?}"); 108 | self.wifi.disconnect().await?; 109 | sleep(Duration::from_secs(1)).await; 110 | continue; 111 | } 112 | 113 | let ip_info = self.wifi.wifi().sta_netif().get_ip_info(); 114 | *self.state.ip_addr.write().await = ip_info.ok().map(|i| i.ip); 115 | info!("Connected to '{}': {ip_info:#?}", self.state.ssid); 116 | 117 | // Wait for Wi-Fi to be down 118 | self.wifi.wifi_wait(|w| w.is_up(), None).await?; 119 | warn!("Wi-Fi disconnected."); 120 | } 121 | } 122 | } 123 | --------------------------------------------------------------------------------