Market7 IoT
Market7 IoT Documentation

Build ESP32, MQTT and IoT automation projects faster.

This public documentation page gives users the essential guides, API references, sample code and project workflow needed to connect devices to the Market7 Smart Automation Platform.

Documentation Sections

Getting Started

Create an account, add a device, copy the device token and use the provisioning wizard to generate ESP32 code.

Supported Hardware

The platform is designed for ESP32 and ESP8266 first, but can also support gateways, smart relays, sensor nodes and custom devices.

HTTP API Reference

Devices can send sensor data directly using the secure token assigned to each device.

MQTT Reference

MQTT is used for lightweight real-time telemetry and future command delivery.

Sample ESP32 HTTP Code

Use this minimal Arduino example as a starting point. For a ready-to-use code with your device token, use Dashboard > Provisioning.

Provisioning Wizard

Use Dashboard > Provisioning to generate device-specific ESP32 code without manually editing tokens or endpoints.

Command Flow

ESP32 devices can poll the cloud for pending commands, execute relay actions and report results back to the platform.

Security Notes

Keep device tokens private. Do not publish production MQTT passwords inside public repositories. Rotate tokens if a device is compromised.

Getting Started

Create an account, add a device, copy the device token and use the provisioning wizard to generate ESP32 code.

  1. 1Create or login to your account
  2. 2Create a device from Dashboard > Devices
  3. 3Open Dashboard > Provisioning
  4. 4Copy generated HTTP or MQTT code
  5. 5Upload the code to ESP32

HTTP API Reference

Devices can send sensor data directly using the secure token assigned to each device.

POST https://iot.marketseven.net/api/iot/data

POST https://iot.marketseven.net/api/iot/data

Sample JSON Payload

{
  "token": "YOUR_DEVICE_TOKEN",
  "data": {
    "temperature": 27.4,
    "humidity": 61,
    "voltage": 220,
    "relay1": 1
  }
}

MQTT Reference

MQTT is used for lightweight real-time telemetry and future command delivery.

Broker

mqtt://iot.marketseven.net:1883

Telemetry topic

market7/devices/<deviceToken>/data

Heartbeat topic

market7/devices/<deviceToken>/heartbeat

Command topic

market7/devices/<deviceToken>/commands

Supported Hardware

The platform is designed for ESP32 and ESP8266 first, but can also support gateways, smart relays, sensor nodes and custom devices.

ESP32
ESP8266
Smart Relay
Sensor Node
Industrial Gateway
Custom Device

Provisioning Wizard

Use Dashboard > Provisioning to generate device-specific ESP32 code without manually editing tokens or endpoints.

  1. 1Select your device
  2. 2Enter WiFi credentials locally
  3. 3Choose HTTP REST or MQTT
  4. 4Choose code variant
  5. 5Copy and upload the generated Arduino code

Command Flow

ESP32 devices can poll the cloud for pending commands, execute relay actions and report results back to the platform.

  1. 1User queues command from Dashboard > Commands
  2. 2ESP32 calls /api/iot/commands
  3. 3Device executes relay/restart/config action
  4. 4Device reports result to /api/iot/command-result

MQTT Public Access Plan

MQTT is currently internal-only. Public MQTT should only be enabled after TLS/MQTTS, firewall rules, per-device credentials and abuse protection are designed.

  1. 1Keep port 1883 internal for now
  2. 2Plan MQTTS on 8883
  3. 3Use per-device credentials
  4. 4Add rate limiting and audit logs
  5. 5Rotate credentials if compromised

Sample ESP32 HTTP Code

Use this minimal Arduino example as a starting point. For a ready-to-use code with your device token, use Dashboard > Provisioning.

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

const char* WIFI_SSID = "YOUR_WIFI_SSID";
const char* WIFI_PASSWORD = "YOUR_WIFI_PASSWORD";

const char* DEVICE_TOKEN = "YOUR_DEVICE_TOKEN";
const char* API_URL = "https://iot.marketseven.net/api/iot/data";

void setup() {
  Serial.begin(115200);
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("WiFi connected");
}

void loop() {
  HTTPClient http;
  http.begin(API_URL);
  http.addHeader("Content-Type", "application/json");

  String payload = "{";
  payload += "\"token\":\"" + String(DEVICE_TOKEN) + "\",";
  payload += "\"data\":{";
  payload += "\"temperature\":27.4,";
  payload += "\"humidity\":61,";
  payload += "\"voltage\":220,";
  payload += "\"relay1\":1";
  payload += "}}";

  int code = http.POST(payload);
  Serial.println(code);
  Serial.println(http.getString());
  http.end();

  delay(10000);
}

Project Ideas

Use the platform for smart home, industrial monitoring, energy tracking and automation dashboards.

Temperature and humidity monitor
Voltage and energy monitoring
Smart relay control
Factory machine status dashboard
Water pump monitoring
Industrial alarm system

Security Notes

Keep device tokens private. Do not publish production MQTT passwords inside public repositories. Rotate tokens if a device is compromised.

Recommended Workflow

  1. 1Define the sensors and outputs
  2. 2Create devices in the platform
  3. 3Generate ESP32 code
  4. 4Test with HTTP first
  5. 5Move to MQTT after security planning
  6. 6Add charts, commands and AI reports