Skip to content

0.1.7

Choose a tag to compare

@Ishanoshada Ishanoshada released this 30 Jun 11:57
· 11 commits to main since this release

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 using internet={'ssid': ..., 'password': ...} (e.g., Dialog 4G 0F8 with IP 192.168.8.102). Falls back to access point mode if the connection fails.
    • Improved config.json loading for Wi-Fi credentials, with a default fallback AP (SSID: ESP32-MicroWeb, password: 12345678, IP: 192.168.4.1).
  • External API Support with urequests:
    • Integrated urequests for 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., /offline route).
  • Template Engine Improvements:
    • Enhanced template rendering with support for for loops and if conditionals, as demonstrated in tests/request_send/index.html.
    • Improved variable substitution and error handling for robust rendering on resource-constrained ESP32 devices.
  • Static File Serving:
    • Streamlined serving of static files (e.g., style.css, script.js) with app.add_static().
    • Optimized file upload process via microweb run --static to ensure only changed files are uploaded.
  • 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.
  • Example Updates:
    • Added tests/request_send/ example demonstrating mode='wifi', urequests for 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.
  • 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.md with detailed examples for mode='wifi' and urequests usage.
    • Added testing instructions using curl and mpremote for debugging.

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).