Interface and application programming

An interface, in computing, refers to the way a user interacts with a system or program. It can be visual or auditory and allows the user to enter information into the system or receive information from the system in a form that is easy to understand and use

Web interface to display IoT data

1. The Idea

I want to show data from a temperature and humidity sensor to a webpage.

2. The software design

To send this data I will use MQTT protocol over TCP/IP and I wll format the data in a Json to make the management of the data easier.

Some important facts about MQTT are:

  • MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol designed to connect IoT (Internet of Things) devices with low power and limited bandwidth over unstable communication networks.
  • MQTT is based on the publish/subscribe model, where devices publish data on a specific topic and other devices subscribe to that topic to receive the published data. This model is scalable and allows multiple devices to communicate through a single message server.
  • The main features of MQTT include its lightweight, low power consumption, ability to operate in bandwidth-limited networks as well as in unstable or intermittent networks, and scalable architecture.
  • MQTT is widely used in IoT applications, where reliable, efficient and scalable information exchange between multiple resource-constrained devices is required. MQTT is also used in other applications, such as telemetry and remote monitoring.

Some important facts about Json are:

  • JSON (JavaScript Object Notation) is a lightweight, easy to read and write data interchange format commonly used in web and mobile applications. It is a text format that is based on JavaScript object syntax and is used to send and receive data between applications.
  • JSON uses a data structure based on key-value pairs and can be used to represent a wide variety of data types, including numbers, strings, Booleans, arrays and objects. The data is represented in a plain text syntax that is easily readable and understandable to developers.
  • JSON is widely used in web and mobile applications to send and receive data over the network. For example, a web server can send JSON data to a web browser so that it can be displayed on a web page. It is also used in web services and APIs to allow different applications and systems to exchange data.
  • One of the advantages of JSON is that it is a language-independent data format, which means it can be used in a variety of programming languages. It is also lighter and easier to read than some of the older data interchange formats, such as XML.

3. Electronics

For the electronics I will use an ESP32 DevKit and a DHT22 sensor.

4. The interface

As an interface I just want to display the timestamp, the temperature and the humidity.

Also I would like to add a button to send the values for a Neopixel led and change it's color

5. Test

One problem:

I got one problem when using the Adafruit Neopixel library in conjunction with the Wifi library...

The MCU reboots each time I call the function show on the neopixels

¿Can anyone help me solve this problem?