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.
- 1Create or login to your account
- 2Create a device from Dashboard > Devices
- 3Open Dashboard > Provisioning
- 4Copy generated HTTP or MQTT code
- 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/dataSample 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:1883Telemetry topic
market7/devices/<deviceToken>/dataHeartbeat topic
market7/devices/<deviceToken>/heartbeatCommand topic
market7/devices/<deviceToken>/commandsSupported Hardware
The platform is designed for ESP32 and ESP8266 first, but can also support gateways, smart relays, sensor nodes and custom devices.
Provisioning Wizard
Use Dashboard > Provisioning to generate device-specific ESP32 code without manually editing tokens or endpoints.
- 1Select your device
- 2Enter WiFi credentials locally
- 3Choose HTTP REST or MQTT
- 4Choose code variant
- 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.
- 1User queues command from Dashboard > Commands
- 2ESP32 calls /api/iot/commands
- 3Device executes relay/restart/config action
- 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.
- 1Keep port 1883 internal for now
- 2Plan MQTTS on 8883
- 3Use per-device credentials
- 4Add rate limiting and audit logs
- 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.
Security Notes
Keep device tokens private. Do not publish production MQTT passwords inside public repositories. Rotate tokens if a device is compromised.
Recommended Workflow
- 1Define the sensors and outputs
- 2Create devices in the platform
- 3Generate ESP32 code
- 4Test with HTTP first
- 5Move to MQTT after security planning
- 6Add charts, commands and AI reports