Repository navigation
0.1.7
Feature Updates
Version 0.1.7 Release Notes
- Wi-Fi Configuration Enhancements:
- Added
mode='wifi'option to connect the ESP32 as a client to an existing Wi-Fi network usinginternet={'ssid': ..., 'password': ...}(e.g.,Dialog 4G 0F8with IP192.168.8.102). Falls back to access point mode if the connection fails. - Improved
config.jsonloading for Wi-Fi credentials, with a default fallback AP (SSID:ESP32-MicroWeb, password:12345678, IP:192.168.4.1).
- Added
- External API Support with
urequests:- Integrated
urequestsfor making HTTP/HTTPS requests to external APIs (e.g.,https://jsonplaceholder.typicode.com/posts/1). - Added error handling for HTTPS requests, which may fail on ESP32 due to limited SSL/TLS support, with fallback to HTML error messages or local templates (e.g.,
/offlineroute).
- Integrated
- Template Engine Improvements:
- Enhanced template rendering with support for
forloops andifconditionals, as demonstrated intests/request_send/index.html. - Improved variable substitution and error handling for robust rendering on resource-constrained ESP32 devices.
- Enhanced template rendering with support for
- Static File Serving:
- Streamlined serving of static files (e.g.,
style.css,script.js) withapp.add_static(). - Optimized file upload process via
microweb run --staticto ensure only changed files are uploaded.
- Streamlined serving of static files (e.g.,
- CLI Improvements:
- Added real-time logging support when running apps with
mpremote connect COM10 run app.py, showing Wi-Fi connection status and IP address. - Improved file validation and dependency checking for templates and static files.
- Added real-time logging support when running apps with
- Example Updates:
- Added
tests/request_send/example demonstratingmode='wifi',urequestsfor API calls, dynamic template rendering, and static file serving. - Updated examples to include
app.get_ip()for retrieving the ESP32’s IP address in responses.
- Added
- Bug Fixes:
- Fixed issues with Wi-Fi connection stability in station mode.
- Resolved template rendering errors for missing variables, ensuring empty string fallback.
- Documentation:
- Updated
README.mdwith detailed examples formode='wifi'andurequestsusage. - Added testing instructions using
curlandmpremotefor debugging.
- Updated
Note: HTTPS requests may require a MicroPython build with SSL/TLS support or a proxy server. For reliable API calls, use HTTP endpoints or local fallbacks (e.g., mirror.html).