Embedded Web Server Tutorials

The Ultimate Guide to Embedded Web Server (HTTP Server) and IoT Technology

Welcome to our collection of Embedded Web Server tutorials! Here, you'll find everything you need to know about using embedded web servers in a variety of contexts, from tiny event-driven microcontrollers to larger embedded systems like VxWorks, QNX, and Embedded Linux.

We've got you covered Whether you're working with a memory-constrained microcontroller, an RTOS-powered device, or a high-level operating system. From tips on when not to use an embedded web server to advice on how to access a WebSocket server behind a firewall, our tutorials cover a wide range of topics to help you get up and running with ease.

Definitions:

  • Metal: Applicable to bare-metal devices
  • RTOS: Applicable to Real Time Operating System powered devices
  • HLOS: Applicable to High-Level Operating Systems such as Embedded Linux, QNX, and VxWorks

For projects using memory-constrained microcontrollers with internal RAM of less than 1 MB and with no external RAM, the first three articles below are for you. If not, see the other articles to help you design your next project.

When Not to Use an Embedded Web Server in a Microcontroller (RTOS/Metal)

Before embedding a web server in a microcontroller-powered product, think about your goal. Embedding a web server may not be the best solution when using a small microcontroller. To understand why, see the following tutorial:

When Not to Use an Embedded Web Server in a Device

Embedding a Web Server in a Microcontroller (RTOS/Metal)

Looking for a way to add an embedded web server to your small microcontroller project? The tutorial on Embedding a Web Server in a Microcontroller is a great place to start. But if you're looking for an even easier solution, consider offloading all your IoT, web, and networking needs to an ESP32 running the Barracuda App Server. This low-cost option can easily be added to your existing microcontroller setup and supports wired and wireless Internet communication. Plus, the two processors can easily communicate using methods like SPI or UART.

IoT & WebSockets Behind Firewall (RTOS/Metal)

WebSockets Behind Firewall

Maximize the benefits and minimize the drawbacks of IoT and embedded web server technology with the help of our article on accessing a WebSocket server behind a firewall. By following the tips and guidance provided, you'll be able to seamlessly integrate these solutions and get the best of both worlds.

Don't let complicated networking and security issues stand in the way of your success. Learn how to overcome these challenges and harness the full potential of IoT and embedded web servers with the help of our expert guidance. Check out the article now and start reaping the benefits!

ESP32 Tutorials (RTOS)

We offer a series of hands-on tutorials tailored specifically for the ESP32 microcontroller. Among these is the IoT Noobs Tutorial crafted for C/C++ developers. This tutorial introduces our complimentary SharkSSL IoT IDE for ESP32, which comes packed with several ready-to-run examples, including the notable Minnow Server Reference Example. Using this IDE, deploying firmware to an ESP32 is as straightforward as clicking a button.

Xedge32

Xedge32

Additionally, for those exploring our Xedge32 development environment, we present two dedicated embedded web server tutorials. Xedge32 simplifies embedded systems programming, making it approachable for everyone, not just seasoned C/C++ embedded professionals.

Embedded Web Server vs. Embedded Application Server (HLOS/RTOS)

If you have ever Googled "embedded web server" or "embedded web server tutorials", you have likely come across many tutorials on how to create a lightweight web server on, for example, Linux to serve static HTML files. Being able to serve static web pages is one of the most fundamental parts of any embedded web server; however, for device management to be practical, we need to look beyond just serving static web pages. In particular, embedded web servers generally must be able to let the web functionality affect the device operation -- the remote browser has to be able to "talk" to the embedded system.

An embeddable application server is a more formalized way of saying an embedded web server that lets you easily build HTML-based interactive device management applications. To get a better understanding of the differences between an embedded web server and an embedded application server, see the What is an Embedded Application Server, a primer for embedded developers tutorial for details.

Develop the web application using C, C++, or by using a high level language? (HLOS/RTOS)

Lua

For an embedded developer, the first thing to consider is that the server-side part of the embedded web application must be designed in C code. Although this is very common, it may not be the best solution for many embedded systems. Web applications are very text heavy, and it is time-consuming and error-prone to develop server side web applications in C code. A better solution may be to use an application server that supports a fast and compact scripting language suitable for embedded systems. For efficient scripting in an embedded environment, there’s a scripting language called Lua, and it is specially designed to operate on small (embedded) platforms. It is defined as an extensible language and implemented as a C library that is compiled and linked with your application/firmware. For more information, check out the Using Lua for Web Application Development article.

The Future: Single Page Application (HLOS/RTOS)

Traditional web applications have been processed exclusively on the server side. With the uprising of JavaScript on the client side and many new client-side JavaScript frameworks, many choose to push some or all of the Human Machine Interface (HMI) processing to the client side -- i.e., to the browser. Check out the following tutorial if you are interested in learning more about Single Page Application (SPA) design techniques for device management.

Modern Approach to Embedded Web Server Design

Using Modern Web Frameworks such as AngularJS, ReactJS, and Vue.js (HLOS/RTOS)

Look no further if you plan on using the latest web development. The following article explains this in detail:

Using ReactJS, Angular, and Vue.js with any web server

What about CGI? (HLOS)

You may be looking for a CGI-enabled server if you are old school. In addition to being passé, CGI has several drawbacks, such as several security issues being slow and time-consuming development in embedded devices. Older websites were originally implemented using the Common Gateway Interface (CGI). In truth, CGI is only an interface. It is generally cumbersome to manage and requires a full-up OS like Linux that can load external programs, meaning that deep-embedded monolithic systems cannot use CGI. Basic embedded web servers typically specify only function hooks; you must write the functions. With CGI on standard web servers, Perl scripting is very common, but most embedded environments do not support Perl, meaning you must revert to C to get things done. All of this makes CGI an unattractive option. See the following tutorial for more information on why we do not recommend CGI for new design.

Barracuda App Server vs CGI, including CGI security issues


The elephant in the room for embedded web server security (HLOS/RTOS/Metal)

Hacking your embedded web server

With easy-to-use hacking tools available on Github, anyone can hack your embedded web server-enabled product. Follow along the hack any embedded web server tutorial to learn how shockingly easy it is to hack your devices.

Authentication Using Single Sign-On (HLOS/RTOS)

Shipping products with pre-installed passwords creates a major security vulnerability by essentially setting up a "backdoor" into the system. This risk can be mitigated by implementing Single Sign-On (SSO) solutions. SSO protocols allow users to use a single set of login credentials to access multiple applications or services, reducing the reliance on a pre-installed password. By centralizing the authentication process, SSO makes it harder for unauthorized individuals to gain access and more effortless for system administrators to manage and monitor account activities. This helps significantly enhance system security and integrity.

Single Sign On for Microcontrollers

Check out the LinkedIn article, benefits of Active Directory Single Sign-On in Embedded Industrial Devices: A Comparative Study with Traditional Authentication.

Barracuda App Server and Mako Server Tutorials (HLOS/RTOS)

The following is a list of hands-on tutorials for the Mako Server, which is a Barracuda Application Server (BAS) derivative product designed for high-level operating systems. Mako Server and BAS provide the same programmer API; thus the following Mako Server tutorials also apply to the Barracuda App Server. Clicking any of the links below takes you to the Mako Server website.

IoT Tutorials and Web of Things (HLOS/RTOS/Metal)

IoT and embedded web technologies are merging. Learn how to take advantage of both by using a common code base. Our IoT Tutorials explain this in detail.



Looking for Guidance?

Our extensive tutorials on embedded web servers and IoT are your roadmap to success. But every journey can have its challenges. Our seasoned experts are here to pave the way if you're pressed for time or hit a roadblock. At Real Time Logic, we equip you with knowledge and offer a helping hand when you need it most. Together, let's achieve the extraordinary!



OPC-UA

OPC-UA Client & Server

An easy to use OPC UA stack that enables bridging of OPC-UA enabled industrial products with cloud services, IT, and HTML5 user interfaces.

Edge Controller

Edge Controller

Use our user programmable Edge-Controller as a tool to accelerate development of the next generation industrial edge products and to facilitate rapid IoT and IIoT development.

On-Premises IoT

On-Premises IoT Platform

Learn how to use the Barracuda App Server as your On-Premises IoT Foundation.

Embedded Web Server

Barracuda Embedded Web Server

The compact Web Server C library is included in the Barracuda App Server protocol suite but can also be used standalone.

WebSocket Server

Microcontroller Friendly

The tiny Minnow Server enables modern web server user interfaces to be used as the graphical front end for tiny microcontrollers. Make sure to check out the reference design and the Minnow Server design guide.

WebDAV Server

Network File System

Why use FTP when you can use your device as a secure network drive.

HTTP Client

Secure HTTP Client Library

PikeHTTP is a compact and secure HTTP client C library that greatly simplifies the design of HTTP/REST style apps in C or C++.

WebSocket Client

Microcontroller Friendly

The embedded WebSocket C library lets developers design tiny and secure IoT applications based on the WebSocket protocol.

SMTP Client

Secure Embedded SMTP Library

Send alarms and other notifications from any microcontroller powered product.

Crypto Library

RayCrypto C Library

The RayCrypto engine is an extremely small and fast embedded crypto library designed specifically for embedded resource-constrained devices.

Embedded PKI Service

Automatic SSL Certificate Management for Devices

Real Time Logic's SharkTrust™ service is an automatic Public Key Infrastructure (PKI) solution for products containing an Embedded Web Server.

Modbus

Modbus TCP client

The Modbus client enables bridging of Modbus enabled industrial products with modern IoT devices and HTML5 powered HMIs.

Posted in Whitepapers