NetBurner Application Update Server
Overview
This application provides a web-based interface for updating embedded application code remotely. It creates an HTTP server that accepts file uploads to update the device's application firmware through a web browser.
Features
- Web-based Update Interface: Hosts a web page (
Apppost.html) that allows users to upload application binary files
- Real-time Processing: Handles file uploads and immediately processes them for application updates
- Authentication Support: Optional username/password protection for the update process
- Automatic Reboot: Automatically reboots the device after successful updates
- Status Feedback: Provides immediate feedback on upload success or failure
Application Flow
- Initialization: The application starts the HTTP server and waits for network connectivity
- File Upload: Users access the web interface to upload application binary files
- Processing: The uploaded file is processed through
ReadBinaryApplicationCodeFromStream()
- Response: The system provides feedback on the update status
- Reboot: On successful update, the device automatically reboots after a 5-second delay
Security Options
Basic Mode (Default)
- No authentication required
- Direct access to the update interface
Authentication Mode
To enable authentication, uncomment the following line in the source code:
#define I_WANT_TO_AUTHENTICATE_UPDATE
When authentication is enabled:
- Username:
up
- Password:
date
- Realm:
NetBurner
- Users must provide credentials before accessing the update interface
Technical Details
Dependencies
Callback Events
The application handles the following POST events:
eStartingPost: Initializes the update process
eVariable: Processes form variables (currently unused)
eFile: Handles the uploaded binary file
eEndOfPost: Completes the update and provides status response
Network Configuration
- Uses DHCP for network address assignment
- Runs HTTP server on default port 80
- Includes system diagnostics (should be disabled for production)
Usage
- Build and deploy the application to your NetBurner device
- Connect the device to your network
- Access the device's IP address in a web browser
- Navigate to the
Apppost.html page
- Upload your application binary file
- Wait for the update confirmation and automatic reboot
Development Notes
- The application includes system diagnostics that should be removed for production builds
- Authentication credentials are hardcoded and should be changed for production use
- The 5-second delay before reboot allows time for the HTTP response to complete
- All POST data is consumed during authentication to prevent buffer issues
Error Handling
The application provides basic error handling:
- Failed updates return an error message via the web interface
- Network timeouts are handled during authentication
- Invalid credentials prompt for re-authentication