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
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.
You can access all these functions through this button in Figure 05:
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 Project | Funcionalities | HTTPS git link |
common | Common libraries and resources for the project | https://codigos.ufsc.br/lcqar/common.git |
fw-aercio-pro-atmega | Air Quality fixed prototype monitor | https://codigos.ufsc.br/lcqar/fw-aercio-pro-atmega.git |
fw-monit-gar-sc-atmega | Air Quality mobile prototype monitor | https://codigos.ufsc.br/lcqar/fw-monit-gar-sc-atmega.git |
fw-monit-gar-sc-atmega esp8266 | Firmware to Wi-Fi communication mobile version | https://codigos.ufsc.br/lcqar/fw-monit-gar-sc-atmega-esp8266.git |
hw-monit-gar-sc | Air Quality Monitoring Hardware | https://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.
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.
Library | Author | Version | Description | Prototype |
ArduinoJson | Benoit Blanchon | 6.13.0 | JSON library for embedded C++. It supports serialization, MessagePack, Fixed Allocation, and more. | Mobile-Fixed |
NTPClient | Fabrice Weinberg | 3.1.0 | Library used to connect a time server. | Mobile-Fixed |
RTC | Michael Miller | 2.3.4 | Library used to interface DS1302, DS1307, DS3231, and DS3234. | Mobile-Fixed |
SD | Arduino | 1.2.4 | Library used to create files and read/write on SD Cards. | Mobile-Fixed |
SdFat | Bill Greiman | 1.1.4 | Used to SD cards. | Mobile-Fixed |
Time | Michael Morgolis | 1.6 | Library necessary to work with Time situations. | Mobile |
TinyGPSPlus | Mikal Kart | 1.0.2 | Library used on NMEA parsing system | Mobile-Fixed |
Table 2. Libraries used in the project