InqPortal – Adding Web Content v5

Previous: The Bare Essentials

Adding file content is very easy. What to add is not… and far beyond the scope of this topic. Obviously, people study for years or are naturally artistic to create great content with combinations of html pages and using Cascading Style Sheets css to setup the cosmetics. I have always been fortunate in my career to be able to leave this to true artists. I’ve always been the guy behind the curtain writing the server logic with C++ and client side logic with JavaScript. Basically, you can add just about anything you have seen on the Internet. The server side is limited. Obviously, you’re never going to load a WordPress site or MySQL database on an ESP8266. But… think about it… This web content is just stored on the server. When you open the browser page, this content all flows down to your browser and its your computer/tablet/phone that is supplying all the horse power to animate your fancy UI. Your imagination is the only limit on the client side. You will find it quite surprising that the common 3MB of disk space you have available on most ESP8266’s can go a long way. Html, css and even JavaScript is relatively small. The things that always takes room are the images.

Note: I’m currently working on a project using the lowly ESP8266, ESP-01S. This has only 1MB total! With proper settings, even this device can run an InqPortal web application and still support OTA upgrading. It’s file system is proportionally handicapped at a measly 192KB.

Back to the simple part… To add content to your server, simply bring up Windows File Explorer and your server’s Admin page on your desktop. Select your files and just drag them over to the Admin page. You can also right-click on the InqPortal folder region (just like Windows Explorer) and open a dialog box to search for, select and copy files. At the moment, it does not support dragging or copying folders.

After they upload, you’ll see your files in a File Explorer like window. In the image below, you can select one or more files and perform most normal Explorer type functions via right mouse clicking on Microsoft Windoww or a long press on your mobile devices. You can also create folders and sub folders. There are several requirements to files being loaded onto your InqPortal.

  • The filenames/folders must not have any spaces – This is more related to HTML. URL’s are not allowed to have spaces in them.
  • The length of a filename (including its path) must be less than 256 characters – Do you really want a filename or a series of folders longer than 256 characters?

Loading It Up

In the example to the right, we have loaded up a pretty large sample website and yet it only uses about two-thirds of the space. I found this free web site template on the Internet at https://freewebsitetemplates.com/ Check it out being hosted on an ESP8266!

I’m not suggesting you host your next million hits a month website, but its refreshing to think that cosmetics and even size to some extent can easily be handled. Hosted on InqPortal, the little ESP8266 serves up the home page of 17 files and almost a megabyte in about three and a half seconds.

Test Web Site – About 1.8 MB

Stress Testing

InqPortal, Version 5.0 has undergone quality control and stress testing. The output/WiFi server test consists of nine different browsers requesting the above website. After the page is fully rendered, the browser requests the same page again… ad nauseam… all nine browsers. In a single, unbroken 100 hour period, the InqPortal server served almost 180 GB of data for an average rate better than 473 KB/sec => 3.7 Mbits/sec!

In the next section, we’ll add some metrics to help you check the health and performance of your InqPortal project.

Next: Adding Performance Metrics