In the previous episode, we looked at how to save Raspberry Pi's temperature and humidity sensor data to the Watap Project. This time, we'll look at how to query stored data using Watap's Open API and visualize it in a mobile app using Flutter. We plan to use an Android simulator as a development environment.
1) Open API
To use the Wtab Open API, you need the following three pieces of information:
Detailed settings Watap official documentationPlease refer to
2) MXQL
MXQL is Watap's dedicated query language for querying Watap's performance data (metrics). As we saw in Part 3, MXQL can be used to visualize collected data as charts.
As shown in the example above, you can simply query the stored data.
3) MXQL Open API
MXQL can be called and results can be received via Open API. (MXQL Open API User Guide)
We will conduct a test to search the data based on the prepared information.
View data for the last 7 days with a limit of 3.
The results are the same as above.
Flutter is a cross-platform framework developed by Google. It's efficient because you can develop both iOS and Android apps with a single codebase. The features are as follows:
The following tools must be installed for Flutter development:
Detailed installation instructions Flutter official websitePlease refer to the guide at
When you create a new Flutter project in Android Studio, a counter app example is included by default. This example code can be found in the lib/main.dart file.
The main libraries required for the project include:
Using these two libraries, we'll call WTAP's API and display the temperature and humidity data as a chart.
Organize lib/main.dart in a concise manner.
This is a blank screen after cleaning up unnecessary code that is automatically generated.
Write Wtab Open API communication code.
WhaTap Open API test code
Confirm that the received data is correctly output to the AndroidStudio console.
Create a data model class.
Modify the UI screen where the chart is displayed.
In this project, we looked at the entire process of storing IoT device data in Watap and visualizing it as a mobile app. The current configuration is for basic demonstration purposes, and the following additional features can be considered for actual use:
The full source code for this project GitHub repositoryYou can check it out at
WTAP provides various functions such as saving user data, setting notifications, and querying data through Open API. By utilizing these functions, it is possible to build a more comprehensive monitoring system by linking with existing server monitoring and APM solutions.