This application is sampling analog input A0 of ESP8266, so it then can be displayed on-line in a web browser.
Ref: esp8266/Arduino#1634 (comment)
The repository provides seven versions of EspScopeA0 application. It is intended to walk you through development, starting from basic functionality, and ending in fully featured application optimized to display wave-forms in real-time in a web browser.
The following features are discussed and added step by step in each application version:
- State machine to handle data sampling
- Web server to visualize data on-line
- Web sockets to provide fast data transfer between ESP module and web browser
- Java Script charting library to use ready, proven and fast solution to display wave-forms
- Implementation of additional charts to visualize data transfer performance on-line
- OTA updates to make firmware updates quick and easier without serial interface
- Binary versus text data encoding to further speed up data transfer with web sockets
I was thinking how to name each version to avoid boring numbers or letters. I liked to have them clearly identify themselves to immediately know which one is first, second, third and so on. Software versions (at least preliminary) are often called Alfa, Beta, etc. So here it comes phonetic alphabet. I hope it will not sound to militaristic to you 😄. If this is the case, then stay tuned to my next project where I am planning to use some other variation of this naming convention.
A brief description of each version is provided below.
Initial version of application providing basic functionality of sampling analog input with adjustable rate. It allows to check how sampling rate may affect Wi-Fi stability if connection.
Originally I intended to name it Beta, but then decided to stick to phonetic alphabet, so here it goes Bravo. This is essentially Alfa version that automatically changes sampling rate at predefined steps. It monitors if Wi-Fi connection is not lost and saves results to ThingSpeak.
This is extension of Alfa that is displaying collected samples in a web browser. Data are transferred from ESP to browser using web sockets.
Description 🚧 | Sketch
In order to make it easier for the user, Delta is first self-contained application. All the web pages are served by ESP. In previous version the pages were separate, saved and opened directly from a PC.
This versions provides adjustable period between individual samples. So far sampling was done at maximum speed allowed by ESP hardware.
I was curious what are the factors affecting performance of EspScopeA0. For instance bigger number of samples will take longer time to transmit over Wi-Fi and process by the web browser. Also higher CPU speed of ESP8266 (you may select either 80 or 160MHz) may help to process all the data quicker. In order to measure performance I have introduced additional chart to show performance data in graphical format as opposed to numbers that may get boring.
The last version is supposed to take advantage of binary data transfer by web sockets. Less data to transfer should improve performance. This version is also adding OTA functionality to provide firmware updates faster and in more convenient manner that using a serial port.
Feel free to contribute to the project in any way you like! If you find any issues with code or descriptions please report them using Issues tab above.
Software for this project has been prepared thanks to great work of the following teams and individuals:
- Arduino team that develops and maintains versatile Arduino IDE
- esp8266/Arduino team lead by Ivan Grokhotkov that brought to us excellent ESP8266 core for Arduino
- Links2004 who developed great and very reliable arduinoWebSockets.
- CanvasJS, developer of amazing HTML5 JavaScript Charts
GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999