WhaTap Monitoring
2025-02-13
Project to build your own smart temperature and humidity monitoring system: Part 3. Watap integration

Table of contents

Watap Focus is a program that can upload custom time series data from the Watap monitoring platform. For more details Official documentYou can check it out at Focus supports various CPU architectures, and also supports Raspberry Pi's ARM64 architecture.

Preparing the Watap project

To use Focus, you need a Watap account and project. Focus can send user-defined data to Wattap projects in the form of metrics. Can be used with any Watap project that supports metric data.

WTAP provides up to 5 free server monitoring services, so even if you are not a paid user, you can start a server monitoring project.

key

After creating a project, you can check the project access key and project code on the management screen. These two pieces of information are required for Focus to send data collected from the Raspberry Pi to Watap. Watap server host information is available on the agent installation page.

WhaTap Focus settings

Watap agent repositoryYou can download the Focus Agent at For Raspberry Pi Pi2w Linux_arm64 Since it uses an architecture, download that version.

Use the wget command to download and execute inside the Raspberry Pi and grant permission to run it.

The commands supported by Focus are the same as above. To send user data, license, pcode, category, and onetime options must be passed.

Try sending virtual data through Focus.

Introduction to metrics features

The data collected through Focus can be viewed on Watap's metrics dashboard.

key

Specified on the metrics search screen sensor You can see that the category has been created.

key

If you search at that time, the original data that was repeatedly sent will be queried.

key

Using the MXQL data query, you can preview it organized as a series chart.

key

Watap can set alarms for collected metric data. For example, if the temperature exceeds 30 degrees, you can receive notifications via email, mobile app push, SMS, or a third-party plug-in.

Actual data collection and transmission

Write a code to send data collected from a temperature and humidity sensor connected to the Raspberry Pi to Watap via Focus.

dht22-focus.py

Code execution

We have implemented a system that periodically transmits data using Raspberry Pi. This article covered how to collect temperature and humidity data using an analog sensor (DHT22). However, analog sensors are more likely to cause errors, so error detection logic has been added to make up for this.

If more stable data collection is required and there are no cost restrictions, using a digital sensor capable of I2C communication may be a better choice. Digital sensors provide higher reliability and accuracy, and can minimize errors that can occur during data transmission.

The code currently shared is example code that focuses on implementing basic functionality. The actual service phase requires additional complementary tasks such as system stabilization, condition monitoring, and environmental variable isolation.

That code and project GitHub repositoryYou can also check it out.

finishing

In this article, I covered the process of sending temperature and humidity data collected from Raspberry Pi to Watap, visualizing it, and setting an alarm. In the next part 4: Mobile App Development, we will introduce how to use the Wtab Open API to query data and display it in real time in a mobile app.

Experience Monitoring with WhaTap!