Setting up the Development Environment


Figure 01 – PlatformIO

This page is going to show you how to set up your environment to be able to successfully use the CLEAN system. Here will be explained how to install the requested libraries and also how to pull the files to create your monitoring project work.

To set up the CLEAN Monitor Prototype development environment we will use the PlatformIO (PIO) Integrated Development Environment (IDE), which is available to use as an extension on Microsoft’s Source Code Editor, Visual Studio Code, which uses the Arduino Framework.

How to install PlatformIO on Visual Studio Code
Figure 02 – Visual Studio Code

After you have already installed the Visual Studio Code on your computer, you can follow the steps below to install the PlatformIO IDE extension and also the required libraries used on the project.

Installing the PlatformIO:

With your Visual Studio Code open, you can access the extensions button which is shown in Figure 03 at the left middle part of the interface, search for “PlatformIO IDE” and download it. In Figure 04 you can see the main vision from PlatformIO to install it.

After successful installation, there will be an access button to the new IDE, which is used to create new projects, open existing files, projects examples, install libraries, check the devices that are connected to your computer, among many other functionalities useful to work on system development with microcontrollers and components.

Figure 03 – Extension Button Location
Figure 04 – PlatformIO IDE First Vision

You can access all these functions through this button in Figure 05:

Figure 05 – Access to PlatformIO IDE

Setting up the Development Environment

Our project includes both mobile and fixed devices, for each one of them, there are different source codes that share a common library made by us and also a few external libraries which will be explained in the following topics.

In order to use these codes on your equipment, is necessary that you include the libraries at the project file with the source code and open it with PlatformIO IDE. It is necessary because the Firmware functionalities were structured between class groups which you can have more information about here and there are also the external libraries that have several functionalities present at the project used to monitoring activities.

The project files can be accessed by using git or downloading it through our GitLab page. To access it by git, the HTTPS links required to clone the files are on the following table. You can also see the file name and their functionality on the project at the following table. The branch that you can clone it which we keep updated is the “full-iot-on-esp”.

File ProjectFuncionalitiesHTTPS git link
commonCommon libraries and resources for the projecthttps://codigos.ufsc.br/lcqar/common.git
fw-aercio-pro-atmegaAir Quality fixed prototype monitorhttps://codigos.ufsc.br/lcqar/fw-aercio-pro-atmega.git
fw-monit-gar-sc-atmegaAir Quality mobile prototype monitorhttps://codigos.ufsc.br/lcqar/fw-monit-gar-sc-atmega.git
fw-monit-gar-sc-atmega esp8266Firmware to Wi-Fi communication mobile versionhttps://codigos.ufsc.br/lcqar/fw-monit-gar-sc-atmega-esp8266.git
hw-monit-gar-scAir Quality Monitoring Hardwarehttps://codigos.ufsc.br/lcqar/hw-monit-gar-sc.git

Table 1. Files names, descriptions, and git links to clone them.

How to install libraries

You can install libraries directly to your projects using PlatformIO IDE inside Visual Studio Code. To do that you need to access the PlatformIO button and select the “PIO Home”, “Open” and “Libraries” options. After that, your Visual Studio Code should be looking like figure 5. Now you can search for the library, version, author, and select the project which you want to install those libraries.

For each new project, the IDE creates a new virtual environment, because of that it is necessary to install the required libraries every time you create a new project.

Figure 06 – PlatformIO libraries location button
Required Libraries

In the following table, you can review the libraries, author, version, and their description used on the project to help you find it on the IDE and understand why it is used. Those libraries are required and are been identified to which prototype is used to work on. Each of them must be installed at the file project you are using.

LibraryAuthorVersionDescriptionPrototype
ArduinoJsonBenoit Blanchon6.13.0JSON library for embedded C++. It supports serialization, MessagePack, Fixed Allocation, and more.Mobile-Fixed
NTPClientFabrice Weinberg3.1.0Library used to connect a time server. Mobile-Fixed
RTCMichael Miller2.3.4Library used to interface DS1302, DS1307, DS3231, and DS3234. Mobile-Fixed
SDArduino1.2.4Library used to create files and read/write on SD Cards. Mobile-Fixed
SdFatBill Greiman1.1.4Used to SD cards. Mobile-Fixed
TimeMichael Morgolis1.6Library necessary to work with Time situations. Mobile
TinyGPSPlusMikal Kart1.0.2Library used on NMEA parsing system Mobile-Fixed

Table 2. Libraries used in the project

Translate