NetBurner 3.5.6
PDF Version
HTML Application File Post

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

  1. Initialization: The application starts the HTTP server and waits for network connectivity
  2. File Upload: Users access the web interface to upload application binary files
  3. Processing: The uploaded file is processed through ReadBinaryApplicationCodeFromStream()
  4. Response: The system provides feedback on the update status
  5. 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

  1. Build and deploy the application to your NetBurner device
  2. Connect the device to your network
  3. Access the device's IP address in a web browser
  4. Navigate to the Apppost.html page
  5. Upload your application binary file
  6. 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