EzData - Arduino

Function Description

EzData is an IoT cloud data storage service provided by M5Stack. Different devices can insert or extract data into the storage queue through the unique token to realize data sharing.

Refresh token Click refresh to get token...


EzData API

1. All the following operations depend on the unique token, which is fixed in the same browser environment. Please copy the token before use.
2. If no data operation is performed within half a year, the data queue corresponding to the token will be cleared.
3. The data will be sorted in descending order according to the inserted time (the last inserted data is at the top of the list), and the data will be accumulated and saved.

setData(const char *token, const char *topic, int val)

  • Save data to the top of the specified topic queue

getData(const char *token, const char *topic, int& result)

  • Get data from the top of the specified topic queue.

addToList(const char *token, const char *list, int val)

  • Save data to the top of the specified data list

getData(const char *token, const char *list, int *Array, int offset, int count)

  • Obtain a set of data from a specified data list. The advantage of using list storage is that it supports the specified data index offset and can obtain multiple data at a time, and the return value is a list.
  • list: list name
  • offset: the offset relative to the first position of the data list
  • count: the number of read data

removeData(const char *token, const char *field)

  • Delete topic or list, and clear the queue data.


The program in this case uses the M5Core device, and the relevant dependency libraries M5Stack and M5_EzData need to be installed before the program is compiled ,And fill in the token and wifi information into the code.

#include "M5Stack.h"
#include "M5_EzData.h"

// Configure the name and password of the connected wifi and your token.
const char* ssid = "Explore-F";
const char* password = "xingchentansuo123";
const char* token = "";

void setup() {
  M5.begin();   //Initialize M5Stack
  if(setupWifi(ssid,password)){ //Connect to wifi.
    M5.Lcd.printf("Success connecting to %s\n",ssid);
    M5.Lcd.printf("Connecting to %s failed\n",ssid);

void loop() {
   //Save the data 20 to the top of the testData topic queue.
    M5.Lcd.printf("Success sending data to the topic\n");
    M5.Lcd.print("Fail to save data\n");

  //Save 3 data in sequence to the first place of testList.
  for(int i=0;i<3;i++){
      M5.Lcd.printf("Success sending %d to the list\n",i);
      M5.Lcd.print("Fail to save data\n");

  //Get a piece of data from a topic and store the value in result.
  int result=0;
    M5.Lcd.printf("Success get data %d\n",result);
    M5.Lcd.print("Fail to get data\n");

//Get a set of data from a list and store the values in the Array array.
  int Array[3]={};
    M5.Lcd.print("Success get list\n");
    for(int i=0;i<3;i++){
    M5.Lcd.println("Fail to get data");

  //Remove data
    M5.Lcd.printf("Success remove data\n");
    M5.Lcd.println("Fail to remove data");

    M5.Lcd.printf("Success remove data from the list\n");
    M5.Lcd.println("Fail to remove data");
On This Page