Webbino is a webserver for Arduino. I originally wrote it for my SmartStrip project, which required several unique features which were not present in other webservers that were available at the time:
- Compatible with many network interfaces:
- WizNet W5100: Ethernet Shield
- WizNet W5500: Ethernet Shield 2
- ENC28J60: KMTronic DINo (first version)
- WINC1500 (Wi-Fi): WiFi Shield 101, MKR1000 - EXPERIMENTAL, MIGHT NOT WORK!
- ESP8266 (Wi-Fi): Either as an add-on to Arduino, like the MLT shield, or standalone like NodeMCU, WeMos D1/D1 Mini, etc...
- ESP32
- HTML pages and other data can be embedded in the code. This avoids the need of an SD card for simple sites.
- If you prefer, HTML pages can also be stored on an SD card (long file names are supported!)
- Tags like "#WHATEVER#" in HTML pages can be replaced at page request time, allowing the delivery of dynamic contents.
- Arbitrary functions can be associated to a page, to perform any needed actions.
Included with Webbino are a lot of examples showing how to use all the different features.
To switch between the supported chipsets, and to configure various working aspects of the webserver, have a look at the webbino_config.h file: the WEBBINO_USE_* #defines will enable support for the chosen network interface.
This is the chip that was used on the original Ethernet Shield. Support for it is included in the standard distribution of the Arduino IDE, so it can be used stright away.
This chip is used on the Ethernet Shield 2, originally released by arduino.org. It is supported through the Ethernet 2 library which can be installed through the Library Manager in the Arduino IDE.
The ENC28J60 Ethernet Controller is supported either through the EtherCard library or through the UIPEthernet library.
The former has some limitations and is recommended on microcontrollers/boards with limited resources, such as the Uno. It uses a lot of RAM for the packet buffer, which is currently set at 800 bytes including TCP/IP headers, leaving about 750 bytes for data to be sent to the client. Since the library also forces all communications to be single-packet, about 750 bytes is the maximum size of any data that is exchanged between server and client (i.e.: of webpages).
The latter library is more complete but even heavier on resource usage, so it is only recommended on more powerful platforms, such as the Arduino Mega, Due or on boards based on STM32 microcontrollers.
WINC1500 support is obtained through the WiFi101 library that can be installed through the Library Manager. This is currently experimental and might not work.
ESP8266 is supported either as an add-on to Arduino or standalone:
In the former case, you will need Bruno Portaluri's WiFiEsp library available in the Library Manager or at https://github.com/bportaluri/WiFiEsp.
In the latter case you will need to install the ESP8266 core, available at https://github.com/esp8266/Arduino.
ESP32 is only supported as a standalone board through the ESP32 core.
The DigiX is an Arduino Due clone by US company Digistump. Among various improvements, it features a WiFi module, which is supported.
Web pages can be stored in Arduino's flash memory (where code is stored) and/or on an SD card.
If you only need to serve one or a few pages, storing them together with the code is a great idea, as you will spare your SD card for some better job.
Any file that must be available on the webserver can be converted to a C header file throught a Python script that is available in the "tools" directory. It will also produce some code that you need to include in your sketch. Please have a look at the examples if you need help.
If flash space is an issue or if you just prefer to store your pages on an SD card (to make them easily editable, for instance), you are welcome to do so. You will need to enable SD support by uncommenting one of two #defines in webbino_config.h:
- WEBBINO_ENABLE_SD: This will use Arduino's SD library, which only allows DOS-style (i.e. 8+3 characters) file names. This implies that you will have to name your pages with a .htm extension, instead of .html.
- WEBBINO_ENABLE_SDFAT: This will use the SDFat library, which allows access to files with long names (LFNs), if properly configured (see SdFatConfig.h in the library sources).
Webbino allows easy embedding of small pieces of dynamic content in webpages. If, for instance, all you have to do is show some instant weather data in an otherwise static page, just use the Tag feature: put placeholders like #TEMPERATURE#, #HUMIDITY# and such in your HTML page, and have Webbino replace them with actual data measured when the page is loaded! Have a look at the ReplacementTags example to get started.
Apart from the various networking libraries mentioned above, Webbino requires the PString library to be installed.
Webbino is free software: you can redistribute it and/or modify it under the terms of version 3 of the GNU General Public License as published by the Free Software Foundation.
Webbino is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Webbino. If not, see http://www.gnu.org/licenses/.
Please use the official github page to report issues, suggestions and such.