Add multi-A-record DNS failover for WiFi HTTPS - #14
Merged
Conversation
Resolve all A records via raw UDP DNS, stick to one IP, advance on each transport/TLS failure, fall back to hostname when exhausted. TCP connects to the IP while SNI and cert verification stay on the hostname. Ported onto main's refactored HTTP client. Also drop payload-encoder examples/ and test/ from the compiled src tree: PlatformIO and arduino-cli sweep every source under src/ and broke on their stale payload_encoder.h includes.
AgSerial::write (Arduino) takes const char*, AirgradientSerial (ESP-IDF) takes const uint8_t*. No single unguarded call compiles on both, so branch on ARDUINO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds DNS-level failover for WiFi HTTPS so the device can still reach the
AirGradient backend when some of the hostname's A records are
unreachable. Built on top of main's refactored WiFi client. Also folds
in two build fixes needed to compile main under the Arduino/PlatformIO
and ESP-IDF toolchains.
Changes
to one IP, advances to the next on transport/TLS failure, and falls
back to hostname resolution once all IPs are exhausted. TCP connects to
the selected IP while TLS SNI and certificate verification stay on the
hostname. Adds
EndpointSelector.examples/andtest/from the compiledsrc/tree; PlatformIO and arduino-cli compile every source under
src/andbroke on their stale
payload_encoder.hincludes.ATCommandHandler::sendRawbyte write for the divergent serialAPIs (
AgSerialconst char*on Arduino vsAirgradientSerialconst uint8_t*on ESP-IDF).Validation
pio run -e esp32-c3(OneOpenAir) compiles and links.