EPS Datalogger

A web API that collects sensor readings from IoT devices (such as an ESP32) and returns them as JSON, for the Topics in CS course.

Right now

2readings stored
2in the last 24 hours
2users
2devices

Latest reading: 2026-10-21 01:24:06 UTC

Getting started

  1. Pick a username (it becomes part of the URL, so keep it short and without spaces) and a device_id for each board, such as huzzah1.
  2. Make your ESP32 join your WiFi and send an HTTP POST to the add URL below, with the readings as parameters.
  3. Read your data back with a GET request, from a browser, Postman, or another device.

There are no accounts or passwords: anyone who knows a username can write to it and read it, so don't send anything private.

Sending data from an ESP32

POST http://datalogger.madeateps.org/api/data/<username>/add

Send readings as query-string parameters or as form fields. Any field you leave out is stored as empty. The server sets the username from the URL (a username parameter is ignored) and stamps the time. It replies with the stored record as JSON.

Fields you can send:

Example using the Arduino core for ESP32:

#include <WiFi.h>
#include <WiFiClientSecure.h>
#include <HTTPClient.h>

const char* ssid = "your-wifi";
const char* password = "your-password";
const String username = "jbriggs";
const String deviceId = "huzzah1";

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) delay(500);
}

void postReading(float temperature, float humidity) {
  WiFiClientSecure client;
  client.setInsecure();   // skip certificate checking; fine for class data
  HTTPClient http;

  String url = "http://datalogger.madeateps.org/api/data/" + username + "/add"
             + "?device_id=" + deviceId
             + "&phase=test1"
             + "&temperature=" + String(temperature)
             + "&humidity=" + String(humidity);

  http.begin(client, url);
  int status = http.POST("");   // readings travel in the query string
  Serial.println(status);       // 200 means it was stored
  http.end();
}

void loop() {
  postReading(27.0, 40.0);
  delay(60000);
}

If this site is served over plain http:// instead, use a normal WiFiClient and call http.begin(url).

Reading data back

Every endpoint returns a JSON list of records, oldest first. GET only.

URLReturns
/api/data/<username>/<device>One device's readings that have no key
/api/data/<username>/<device>/<phase>The same, narrowed to one phase (for example an experiment run named test1)
/api/data/<username>/<device>/<string1>/<key>Readings sent with that string1 and key
/api/data/area/<area>All readings with that area, from any user, that have no key
/api/data/area/<area>/<phase>The same, narrowed to one phase
/api/data/allEvery reading in the database

Example: http://datalogger.madeateps.org/api/data/jbriggs/huzzah1/test1