Network-Connected Environmental Station Demo#44
Open
alieissa-commits wants to merge 9 commits into
Open
Conversation
…d default to threadx_basic Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
Co-authored-by: Codex <codex@openai.com> Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
…tion demo Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
Signed-off-by: alieissa-commits <ali.eissa.dev@gmail.com>
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.
Network-Connected Environmental Station Demo
Summary
The Network-Connected Environmental Station demo (
app/demos/network_station/) is an integrated IoT application demonstrating how to coordinate the Eclipse ThreadX RTOS, FileX FAT file system, and NetX Duo TCP/IP stack on resource-constrained microcontrollers.The application periodically polls temperature and humidity data (supporting both a physical I2C HTS221 sensor and an automatic mathematical simulator fallback), logs the readings locally as CSV records to a virtual FAT RAM disk, and forwards them to a separate network thread. The network thread dynamically monitors Ethernet cable status, resolves an IP via DHCP, resolves the broker hostname via DNS, and publishes the logs as JSON telemetry payloads over MQTT. The threads communicate using an asynchronous, decoupled queue pipeline utilizing an Evict Oldest circular policy to prevent system blocking and preserve the newest real-time data during network outages.
Key Features
1. Environmental Station Application (
app/demos/network_station/)sensor_thread(polls data every 2s),logger_thread(writes data locally to a FAT filesystem), andnetwork_thread(publishes JSON telemetry via MQTT).I2C1, automatically falling back to a mathematical sine-wave simulation loop (mock_sensor.c) if no sensor is physically detected at startup.sensor_log.txt.test.mosquitto.org:1883) using a client ID derived from the board's unique hardware ID. Telemetry is formatted as JSON.2. Unified 256-Color Logging (
ansi_colors.h)app/ansi_colors.hcontaining VT100-compatible color codes to replace standard harsh terminal colors with a modern, muted color scheme.\x1b[38;5;243m) is used for all prefix tags (e.g.[System],[HAL],[NetX],[Logger Thread]), pushing the tags into the visual background.MSG_SUCCESS) for successes.MSG_WARNING) for alerts/link changes.MSG_ERROR) for disconnections/failures.board_init.cand the other demos (threadx_basicandnetx_echo) to use this shared logging header for consistency.Verification
-Werroractive) with a Flash size of ~165.9 KB and RAM size of ~415.8 KB.