Example Path: examples/SSH/SecureSerToEthFactoryApp
NetBurner Secure Serial-to-Ethernet Factory Application
Overview
The NetBurner Secure Serial-to-Ethernet Factory Application is a comprehensive embedded application that provides secure bi-directional communication between serial interfaces and Ethernet networks. This application is pre-programmed into NetBurner Serial-to-Ethernet devices and serves as a bridge between various serial protocols and network connectivity. The application pre-programmed into NetBurner Serial to Ethernet devices. This application source code is provided for customers that wish to customize the application.
Interfaces:
- RS-232
- RS-422
- RS-485
- CAN Bus
- I2C
- Ethernet
- Wifi
- Note
- Please refer to the Secure Serial Factory App Users Manual for a detailed description of this application at www.netburner.com.
Application Architecture
Entry Point
The application starts in UserMain() (located in src/main.cpp), which is the standard entry point for all NetBurner applications, rather than the typical C/C++ main() function.
Core Features
Multi-Protocol Support:**
- TCP/IP communication
- UDP communication
- SSH (Secure Shell) connections
- TLS/SSL encrypted connections
Multiple serial interface protocols (RS-232, RS-485, CAN Bus, I2C)
Network Capabilities:**
- DHCP and static IP addressing
- WiFi connectivity support
- Network Time Protocol (NTP) synchronization
- DNS resolution
HTTPS web server interface
Security Features:**
- SSL/TLS encryption for secure data transfer
- SSH authentication and key management
- Certificate and key management system
- Configurable user authentication
Supported Hardware Platforms
- SBE70LC - NetBurner SBE70LC modules
- SB800EX - NetBurner SB800EX modules
- NANO54415 - NetBurner NANO54415 modules
- MODM7AE70 - NetBurner MODM7AE70 modules
- SOMRT1061 - NetBurner SOMRT1061 modules
- MOD5441X - NetBurner MOD5441X modules
Key Source Files
Main Application
- src/main.cpp - Main application entry point and core logic
- src/nbfactory.h - Factory configuration definitions and platform-specific settings
Serial Communication
- src/serialrecord.cpp/h - Core serial port management and data handling
- src/serialburnerdata.h - Serial port configuration structures
- src/atparserforssh.cpp - AT command parser for SSH configuration
Network & Security
- src/sshuser.cpp/h - SSH user authentication and key management
- src/ssluser.cpp/h - SSL/TLS user authentication
- src/certificatekey.cpp - Certificate and key management
- src/ServerKey.cpp - Server key handling
- src/ServerCert.cpp - Server certificate handling
Hardware Interface
- src/gpioserver.cpp/h - GPIO server for pin control
- src/i2cserver.cpp/h - I2C server implementation
- src/i2cfuncs.cpp/h - I2C utility functions
- src/analog.cpp/h - Analog input handling
Web Interface
- src/configweb.cpp - Web-based configuration interface
- src/configweb_wifi.cpp - WiFi-specific web configuration
- src/formtools.cpp/h - HTML form processing utilities
- src/post.cpp - HTTP POST request handling
File System & Storage
- src/effs_std.cpp/h - EFFS (Embedded Flash File System) STD implementation
- src/effsStdPartition.cpp - Flash partition management
- src/FileSystemUtils.cpp/h - File system utility functions
- src/ftp_fs.cpp/h - FTP file system interface
System Utilities
- src/fdtimer.cpp/h - File descriptor timer management
- src/fnbrtosdump.cpp - RTOS debugging and diagnostics
- src/autoupdate.cpp - Remote firmware update functionality
Configuration and Web Interface
The application includes a comprehensive web-based configuration interface with the following pages:
Network Configuration
- html/network.html - Main network settings
- html/tcp.html - TCP protocol configuration
- html/udp.html - UDP protocol configuration
- html/wifi.html - WiFi connectivity settings
Security Configuration
- html/ssh.html - SSH server configuration
- html/ssl.html - SSL/TLS settings
- html/certificate.html - Certificate management
- html/keys.html - Cryptographic key management
Serial Port Configuration
- html/serial.html - Serial port settings
- html/advancedserial.html - Advanced serial configuration
- html/i2c.html - I2C interface settings
System Management
- html/advanced.html - Advanced system settings
- html/gpio.html - GPIO pin configuration
- html/password.html - User authentication settings
Build Configuration
Makefile Structure
The project uses a standardized NetBurner makefile with the following key components:
- Target Name: SecureSerToEthFactoryApp
- Supported Platforms: All major NetBurner platforms
- Dependencies: EFFS STD file system library
- Generated Files: HTML content is compiled into src/htmldata.cpp
Memory Configuration
Platform-specific memory settings:
- MOD5441X/NANO54415/SB800EX: 1MB reserved for EFFS STD file system
- MODM7AE70/SBE70LC: Application memory relocation disabled
Key Features Implementation
Data Flow Management
The SerialRecord class manages bidirectional data flow between serial ports and network connections, implementing:
- Circular buffering for serial-to-network and network-to-serial data
- Connection state management
- Timeout handling
- Keep-alive functionality
Protocol Handling
The application supports multiple connection modes:
- Server Mode: Listens for incoming connections
- Client Mode: Initiates outbound connections
- UDP Mode: Connectionless datagram communication
- SSH Mode: Secure shell connections with authentication
Security Implementation
- Certificate and key management with support for RSA and ECDSA
- SSL/TLS encryption for web interface and data connections
- SSH authentication with public key support
- Configurable user credentials and access control
Configuration Methods
The device can be configured through multiple interfaces:
- Web Interface (HTTP/HTTPS) - Full-featured browser-based configuration
- Configuration Interface - NetBurner's standard configuration protocol
- AT Commands - Serial port based command interface
- Remote Updates - Over-the-air firmware updates
Development and Customization
This source code is provided to enable customers to customize the factory application for specific requirements. Key customization points include:
- Protocol Extensions: Add support for custom protocols
- Hardware Integration: Interface with specific sensors or actuators
- Security Policies: Implement custom authentication mechanisms
- Data Processing: Add filtering, transformation, or logging capabilities
System Requirements
- NetBurner development environment with SDK
- Compatible NetBurner hardware platform
- Network connectivity for web-based configuration
- Optional: WiFi module for wireless connectivity
Additional Resources
For detailed documentation and user manuals, visit www.netburner.com and refer to the Secure Serial Factory App Users Manual.