NetBurner 3.5.6
PDF Version
NetBurner Demo Server for JSON Client Examples

NetBurner Demo Server

Overview

This is a comprehensive demonstration server application for the NetBurner platform that showcases various embedded web server capabilities including JSON handling, SSL/TLS support, tide calculations, and sunrise/sunset computations. The application serves as the backend for JSON client examples and provides a rich set of web services.

Features

Core Web Services

  • HTTP and HTTPS Server: Dual protocol support with SSL/TLS encryption
  • JSON API Endpoints: RESTful JSON services for client applications
  • Authentication System: Multi-level access control with user authentication
  • Real-time Data Logging: Stores and retrieves POST request data with timestamps

Specialized Functionality

  • Tide Calculations: Real-time tide height computations
  • Astronomical Calculations: Sunrise and sunset time calculations based on geographic coordinates
  • Time Zone Support: Configurable time zone handling with NTP synchronization
  • Data Visualization: Time-series data plotting for tide information

Security Features

  • SSL/TLS Encryption: Secure communication channels
  • Access Control: Password-protected endpoints with different security levels
  • Let's Encrypt Integration: Automatic SSL certificate management via ACME protocol

API Endpoints

JSON Services

  • GetJson* - Returns basic JSON response
  • PGetJson* - Protected JSON endpoint requiring authentication
  • Post* - Accepts JSON POST requests
  • PPost* - Protected JSON POST endpoint
  • JPost* - JSON POST with JSON response
  • PJPost* - Protected JSON POST with JSON response

Data Retrieval

  • Show* - HTML table view of stored POST data
  • JShow* - JSON view of stored POST data
  • PlShow* - JSON payload display for specific POST entries

Content Types

  • Text - Plain text responses
  • Html - HTML formatted responses
  • PText - Protected text endpoint
  • PHtml - Protected HTML endpoint

Configuration

Geographic Settings

  • Latitude: Default 32.9834953 (North positive)
  • Longitude: Default 117.2651886 (West negative)
  • Time Zone: Default "PST8PDT7" (Pacific Standard/Daylight Time)

SSL Configuration

  • Certificate: Requires valid SSL certificate and private key
  • Domain: Configured for demo.netburner.com
  • ACME Support: Automatic certificate renewal via Let's Encrypt

Data Storage

The application maintains a circular buffer of POST request data including:

  • Timestamp (local and UTC)
  • Client IP address
  • Security status (HTTP/HTTPS)
  • Request URL
  • JSON payload data

Maximum storage: 256 entries with automatic rollover

Authentication Levels

  1. Level 0: No authentication required
  2. Level 1: HTTPS required (SSL/TLS encryption)
  3. Level 2: Username/password authentication ("user"/"password")
  4. CONFIG_ACCESS_GROUP: System-configured credentials

Real-time Calculations

Tide Calculations

  • Continuous tide height monitoring
  • 3-minute interval updates
  • Historical data plotting
  • Day/night awareness for display

Solar Calculations

  • Sunrise/sunset times for specified coordinates
  • Equation of time calculations
  • Solar declination and hour angle computations
  • Daylight/darkness detection

Build Requirements

Dependencies

  • NetBurner development environment
  • SSL certificate and private key files
  • Network connectivity for NTP synchronization

Libraries Used

Network Configuration

The application automatically:

  • Obtains IP address via DHCP
  • Synchronizes time via NTP
  • Starts both HTTP (port 80) and HTTPS (port 443) servers
  • Enables system diagnostics

Usage

Deployment

  1. Flash the application to a NetBurner device
  2. Ensure SSL certificates are properly configured
  3. Connect to network with internet access for NTP
  4. Access via web browser at device IP address

Testing

  • Use HTTP clients to test JSON endpoints
  • Monitor POST data via Show* endpoints
  • Verify SSL functionality with HTTPS connections

Development Notes

This application serves as a reference implementation demonstrating:

  • Embedded web server best practices
  • JSON API design patterns
  • SSL/TLS integration
  • Real-time data processing
  • Astronomical calculation algorithms
  • Time zone handling in embedded systems
Warning
This project requires a valid SSL certificate and private key to build successfully. The certificate should be configured for the target domain (default: demo.netburner.com).