Releases: Ishanoshada/Microweb
0.2.1
0.2.1
Full Changelog: 0.2.0...0.2.1
0.2.0
Full Changelog: 0.1.9...0.2.0
0.1.9
Full Changelog: 0.1.8...0.1.9
0.1.8
Full Changelog: 0.1.7...0.1.8
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 0F8
with IP192.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
).
- Added
- 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).
- Integrated
- Template Engine Improvements:
- Enhanced template rendering with support for
for
loops andif
conditionals, 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 --static
to 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'
,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.
- 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.md
with detailed examples formode='wifi'
andurequests
usage. - Added testing instructions using
curl
andmpremote
for 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
).
0.1.6
added :
app.stop_wifi() # Uncomment to stop Wi-Fi access point
app.start_wifi() # Uncomment to start Wi-Fi access point after stop
0.1.5
MicroWeb Release Notes - Version 0.1.5
Overview
Version 0.1.5 introduces significant enhancements to the MicroWeb framework, focusing on improving the template engine, static file serving, and CLI functionality for MicroPython on ESP32. This release adds support for dynamic template rendering with for
loops and conditionals, enhances static file handling for CSS and JavaScript, and improves the create
command for generating example applications.
New Features
- Template Engine Enhancements: Added support for
for
loops andif
/else
conditionals in templates, enabling dynamic rendering of lists and conditional content. - Static File Serving: Improved support for serving static files (e.g.,
style.css
,script.js
) to enhance web interfaces with consistent styling and interactivity. - CLI Improvements: Enhanced the
microweb create
command to generate example apps withapp.py
,index.html
,style.css
,script.js
, andREADME.md
, including afor
loop example. - Dynamic Routing: Strengthened dynamic routing with URL parameter handling (e.g.,
/greet/<name>
), improving flexibility for API endpoints. - JSON Responses: Optimized
app.json_response
for consistent API output with properContent-Type
headers.
Improvements
- Wi-Fi Configuration: Refined Wi-Fi handling with better fallback to access point mode when station mode fails.
- Debugging: Enhanced
debug=True
logging for template rendering and static file serving errors. - Documentation: Updated
README.md
template in generated apps to include instructions for testingfor
loops and static files.
Bug Fixes
- Fixed issues with template caching on ESP32, improving performance for repeated renders.
- Resolved errors in
req.form
parsing for POST requests with empty or malformed data. - Corrected CLI path handling for Windows environments in the
create
command.
Upgrade Instructions
- Update MicroWeb to version 0.1.5:
pip install microweb==0.1.5
- For existing apps, ensure templates use the new
{% %}
and{{ }}
syntax for variables and control structures. - Update static file references in templates to include
.css
and.js
files served viaapp.add_static
. - Test existing routes with
curl
or a browser to verify compatibility with the updated template engine.
Known Issues
- Large template files (>10KB) may cause memory issues on ESP32 due to MicroPython constraints. Consider splitting complex templates.
- Custom Wi-Fi configurations in
config.json
may require revalidation after upgrading.
Feedback
Report issues or suggest features at https://github.com/ishanoshada/microweb.
0.1.4
update
0.1.3
Full Changelog: 0.1.2...0.1.3
0.1.2
Full Changelog: 0.1.1V...0.1.2