Tumgik
techtutorialsx · 2 years
Text
Flask and Pydantic
Introduction In this tutorial we are going to learn how to use Pydantic together with Flask to perform validation of query parameters and request bodies. As we have already covered in the introductory tutorial about Pydantic, this library allows to define models that can be used for data deserialization and validation. A common use case where we receive external data that we cannot trust and…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
Pydantic: Getting started
Introduction In this tutorial we will learn how to get started with pydantic, a data validation library for Python based on type annotations. Pydantic enforces type hints at runtime and exposes user friendly errors when data is invalid [1]. It allows us to define data models for validation using canonical Python, which makes it very easy to get started without having to learn a new schema…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32 WebSerial: Receiving Messages
ESP32 WebSerial: Receiving Messages
Introduction In this post we are going to learn how to receive messages sent from the WebSerial UI, on the ESP32. We will be using the Arduino core to program the ESP32. For an introductory tutorial on how to get started using WebSerial and how to print data to the console, please check this previous post. On this tutorial we are going to learn how to handle the reception of messages…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32: WebSerial and mDNS
ESP32: WebSerial and mDNS
Introduction In this tutorial we will learn how to use WebSerial and perform the resolution of the ESP32 domain name using mDNS. In this past tutorial, we have learned the basics of WebSerial and how it can be useful to debug when a physical serial connection to the ESP32 is not available. Nonetheless, it is easy to notice that, in the sample code provided, we had to actually open a wired…
Tumblr media
View On WordPress
4 notes · View notes
techtutorialsx · 2 years
Text
ESP32 Chat Application (Part 5)
ESP32 Chat Application (Part 5)
Introduction In this part we will add some new events to the chat application. More precisely, we will start sending an event when a new user joins the chat and when a user leaves the chat. Both will be displayed in the chat div, together with the messages. Since we have already added timestamping to the messages in part 4 of our series of tutorials, we will leverage what was already…
Tumblr media
View On WordPress
1 note · View note
techtutorialsx · 2 years
Text
ESP32: Chat Application (Part 4)
ESP32: Chat Application (Part 4)
Introduction In this part we will add the timestamping functionality, so we can add a timestamp to all the messages sent by users. Although messages are displayed in the UI in sequence, it is useful to have the actual time they were sent. We will be doing the timestamping on the ESP32, to avoid depending on the clients’ clock. To do so, we will configure the system time on the ESP32 using the…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32: Chat Application (Part 3)
ESP32: Chat Application (Part 3)
Introduction In this tutorial we are going to make the User Interface of our application look better by adding some CSS to style our HTML elements. We will follow the same approach from Part 2 and also serve the CSS file from the ESP32 file system. The expected look is shown below in figure 1. Figure 1 – Expected final look of the chat UI (tested on Chrome). As can be seen in the image, all…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32: Chat application (part 2)
ESP32: Chat application (part 2)
Introduction In this second part of our chat application tutorial, we will start serving the application frontend files from the ESP32. We will do this by storing the files on the ESP32 SPIFFS file system and adding endpoints to the HTTP server to serve them. Although in the previous tutorial we had just a single file with all the HTML and JavaScript of our application, we will now split it in…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32: Chat Application (part 1)
ESP32: Chat Application (part 1)
Introduction In this first part of the chat application series of tutorials we will take care of creating the foundation of our app. At the end of this tutorial, you should have a very simple working prototype. We will setup a HTTP server to run on the ESP32, using the async HTTP webserver library. For a getting started tutorial on the async HTTP server, please consult this post. On this HTTP…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32: Chat Application (Introduction)
ESP32: Chat Application (Introduction)
Introduction In this series of tutorials we will learn how to build a chat application hosted by the ESP32. Since the ESP32 is a resource constrained device, our application will have very simple functionalities and will be mainly focused on teaching the technologies that will support it. Besides covering the ESP32 Arduino programming, we will also need to write some JavaScript and HTML code…
Tumblr media
View On WordPress
1 note · View note
techtutorialsx · 2 years
Text
ESP32 websocket server: Broadcast messages
ESP32 websocket server: Broadcast messages
Introduction In this tutorial we are going to learn how to broadcast messages to all the websocket clients connected to a ESP32 server. We will be using the Arduino core and the HTTP async web server library. For an introductory tutorial to this library, please check here. For an introductory tutorial on how to work with websockets with the HTTP async web server, please go here. In the…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32: Sending an SMS with Twilio
How to use Twilio's API to send an SMS from the ESP32, using the Arduino core.
Introduction In this tutorial we are going to learn how to use Twilio’s API to send an SMS from the ESP32, using the Arduino core. Twilio is a Cloud communications Platform as a Service company that, among many other features, offers an API that allows to programmatically send SMS [1]. Although being a paid service, Twilio offers a trial account that we can use to do some testing of the…
Tumblr media
View On WordPress
1 note · View note
techtutorialsx · 2 years
Text
ESP32 Inja: using templates from the file system
ESP32 Inja: using templates from the file system
Introduction In this tutorial we are going to learn how to render inja templates stored in the file system of the ESP32. We will be using the Arduino core to program the device. On this previous tutorial, we have learned the basics on how to work with the inja library, a template rendering engine for C++. On this tutorial and the next ones, we have mostly worked with templates stored in memory,…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32 dashboard: luminosity measurements
ESP32 dashboard: luminosity measurements
Introduction In this tutorial we are going to learn how to display luminosity levels on a real-time web dashboard served by the ESP32. We will be using the ESP-DASH library and the Arduino core. When we think about sensor dashboards, we usually picture numbers to represent the sensor values. This is very common if we are working with measurements such as temperature, which are easy for a user…
Tumblr media
View On WordPress
1 note · View note
techtutorialsx · 2 years
Text
ESP32: Dynamic sensor network
ESP32: Dynamic sensor network
Introduction In this tutorial we are going to learn how to build a dynamic sensor network that can be monitored through a web-based real-time dashboard. We will be using the ESP32 to implement the nodes of the sensor network and the Arduino core to program them. For exemplification purposes we will be using temperature sensors, but the architecture of the network fits other sensor types with…
Tumblr media
View On WordPress
6 notes · View notes
techtutorialsx · 2 years
Text
ESP32: The C++ map container
ESP32: The C++ map container
Introduction In this post we will learn how to execute some basic operations on a std::map container. We will be using the ESP32 and the Arduino core. A map is an associative container that stores elements formed by a combination of a key value and a mapped value, following a specific order [1]. Keys on a map should be unique [1]. In our introductory example we will be working with a map where…
Tumblr media
View On WordPress
0 notes
techtutorialsx · 2 years
Text
ESP32 mDNS: Host name resolution
ESP32 mDNS: Host name resolution
Introduction In this post we are going to learn how to perform the resolution of a host name without the necessity for any dedicated infra-structure, using the mDNS protocol. We will be using two ESP32 devices and the Arduino core. In many of the tutorials we have covered before with WiFi, it is common that we need to print the local IP address of the device, which is assigned after it connects…
Tumblr media
View On WordPress
0 notes