Cuprins
API HTTP Status (Port 80)
API HTTP Configurare (Port 8080)
API HTTP OTA (Port 8081)
API HTTP Nextion (Port 8082)
Protocol BACnet/IP (UDP 47808)
Harta Registrelor Modbus TCP (TCP 502)
Format Mesaje MQTT
Protocol Zabbix Sender
Comenzi Serial UART
1. API HTTP Status (Port 80)
Public, nu necesita autentificare.
GET
/
Returneaza dashboard-ul HTML cu date senzor in timp real si grafice pe 24h.
GET
/data.json
Returneaza citirile curente ale senzorului ca JSON.
Format Raspuns JSON
{
"co2": 845,
"pm1": 3.2,
"pm25": 5.8,
"pm4": 7.1,
"pm10": 8.4,
"voc": 127,
"nox": 15,
"tvocw": 342,
"temp": 23.5,
"hum": 55.2,
"press": 1013.2,
"rssi": -52,
"uptime": 86400,
"fw": "PureAware_V1.027",
"hw": "AQS-PureAware-R1.2",
"build": "2026-03-14",
"model": "PureAQS66",
"sn": "AQS2608-8A0DE8",
"host": "pureaware-8a0de8",
"mac": "AA:BB:CC:DD:EE:FF",
"ip": "192.168.1.100",
"lang": "en",
"wifi_mode": 1,
"wifi_ok": true,
"mqtt_ok": false,
"email_en": false,
"email_cfg_ok": false,
"sleep_en": 0,
"sleep_active": false,
"aq_level": 0,
"alarms": [
{"param":"co2","trigger":1000,"hyst":50,"state":0,"en":1,"val":845},
{"param":"","trigger":0,"hyst":0,"state":0,"en":0,"val":0},
{"param":"","trigger":0,"hyst":0,"state":0,"en":0,"val":0}
]
}
Referinta Campuri
Camp Tip Unitate Descriere
co2 integer ppm Concentratie CO2
pm1 float µg/m³ Concentratie masica PM1.0
pm25 float µg/m³ Concentratie masica PM2.5
pm4 float µg/m³ Concentratie masica PM4.0
pm10 float µg/m³ Concentratie masica PM10
voc integer — Index VOC (1–500)
nox integer — Index NOx (1–500)
tvocw integer ppb Echivalent TVOC (WELL/Mølhave)
temp float °C Temperatura
hum float %RH Umiditate relativa
press float hPa Presiune barometrica
rssi integer dBm Putere semnal WiFi
uptime integer secunde Timp de functionare dispozitiv
fw string — Versiune firmware
hw string — Revizie hardware
build string — Data compilarii
model string — Model produs
sn string — Numar de serie
host string — Hostname dispozitiv
mac string — Adresa MAC
ip string — Adresa IP curenta
lang string — Limba interfata (en/ro/hu/no/ja)
wifi_mode integer — 0=AP, 1=STA, 2=OFFLINE
wifi_ok boolean — WiFi conectat
mqtt_ok boolean — MQTT conectat
email_en boolean — Notificari email activate
email_cfg_ok boolean — Configurare email valida
sleep_en integer — Repaus WiFi activat (0/1)
sleep_active boolean — Mod repaus activ in prezent
aq_level integer — Nivel global calitate aer
alarms array — 3 obiecte alarma cu param, trigger, hyst, state, en, val
GET
/log
Returneaza date istorice din buffer-ul RAM (288 inregistrari, 24h). Raspuns HTTP fragmentat.
Exemplu: cURL
# Obtinere citiri curente
curl http://192.168.1.100/data.json
# Obtinere date log
curl http://192.168.1.100/log
Exemplu: Python
import requests
import json
resp = requests.get("http://192.168.1.100/data.json")
data = resp.json()
print(f"CO2: {data['co2']} ppm")
print(f"PM2.5: {data['pm25']} ug/m3")
print(f"Temperature: {data['temp']} C")
print(f"Humidity: {data['hum']} %RH")
print(f"VOC Index: {data['voc']}")
print(f"Pressure: {data['press']} hPa")
Exemplu: JavaScript
async function getSensorData() {
const resp = await fetch('http://192.168.1.100/data.json');
const data = await resp.json();
document.getElementById('co2').textContent = data.co2 + ' ppm';
document.getElementById('pm25').textContent = data.pm25 + ' ug/m3';
document.getElementById('temp').textContent = data.temp + ' C';
}
// Interogare la fiecare 30 secunde
setInterval(getSensorData, 30000);
getSensorData();
2. API HTTP Configurare (Port 8080)
Autentificare: HTTP Basic Auth — admin / pureaware
GET
/config/export
Exporta configuratia curenta ca fisier JSON.
POST
/config/import
Importa o configuratie completa din fisier JSON (non-blocant).
POST
/setting
Actualizeaza unul sau mai multi parametri de configurare. Date formular codificate URL.
Parametri de Configurare
WiFi si Retea
Parametru Tip Valori Descriere
ssid string — SSID WiFi
password string — Parola WiFi
wifi_mode int 0=AP, 1=STA, 2=OFFLINE Mod de operare
hostname string — Baza hostname mDNS
static_ip_en int 0/1 Activare IP static
static_ip string x.x.x.x Adresa IP statica
static_gw string x.x.x.x Adresa gateway
static_sn string x.x.x.x Masca de subretea
static_dns string x.x.x.x Server DNS
MQTT
Parametru Tip Implicit Descriere
mqtt_en int 0 Activare MQTT (0/1)
mserver string nimic Host/IP broker
mport int 1883 Port broker
muser string nimic Utilizator
mpass string nimic Parola
mtopic string — Topic de publicare
minterval int 60 Interval (sec, minim 10)
Zabbix
Parametru Tip Implicit Descriere
zbx_en int 1 Activare Zabbix (0/1)
zserver string monitor.microelemente.ro Host server
zport int 55051 Port server
zhost string PureAware_Default ID host Zabbix
zbx_int int 60 Interval (sec, minim 10)
BACnet/IP
Parametru Tip Implicit Descriere
bacnet_en int 0 Activare BACnet (0/1)
bacnet_id int 0 (auto) Instanta Dispozitiv (0=auto din MAC)
Email / SMTP
Parametru Tip Implicit Descriere
email_en int 0 Activare globala email
smtp_server string — Server SMTP
smtp_port int 587 Port SMTP (587=STARTTLS, 465=SSL)
smtp_tls int 1 Activare TLS (0/1)
smtp_user string — Utilizator SMTP
smtp_pass string — Parola SMTP
smtp_from string — Email expeditor
smtp_to string — Email destinatar
Alarme (N = 0, 1, 2)
Parametru Tip Descriere
aN _en int Activare alarma N (0/1)
aN _param string Parametru: co2, pm25, pm1, pm4, pm10, voc, nox, tvocw, temp, hum, press
aN _trigger float Prag de declansare
aN _hyst float Banda moarta histerezis
aN _dir int Directie: 1=peste, 0=sub
Repaus WiFi
Parametru Tip Implicit Descriere
sleep_en int 0 Activare repaus WiFi (0/1)
sleep_start string 22:00 Ora de inceput (format HH:MM)
sleep_end string 06:00 Ora de sfarsit (format HH:MM)
Afisaj si Limba
Parametru Tip Implicit Descriere
led_enabled int 1 Activare LED NeoPixel
tft_dim int 50 Luminozitate afisaj (0–100)
lang string en Limba: en, ro, hu, no, ja
Exemplu: Actualizare Setari MQTT
# Activare MQTT si setare broker
curl -u admin:pureaware -X POST \
http://192.168.1.100:8080/setting \
-d "mqtt_en=on&mserver=mqtt.local&mport=1883&mtopic=sensors/aq1&minterval=60"
Exemplu: Export / Import Configuratie
# Export configuratie
curl -u admin:pureaware http://192.168.1.100:8080/config/export -o config-backup.json
# Import configuratie
curl -u admin:pureaware -X POST \
http://192.168.1.100:8080/config/import \
-H "Content-Type: application/data.json" \
-d @config-backup.json
Exemplu: Setare Alarma
# Alarma 0: CO2 peste 1000 ppm cu histerezis de 50 ppm
curl -u admin:pureaware -X POST \
http://192.168.1.100:8080/setting \
-d "a0_en=1&a0_param=co2&a0_trigger=1000&a0_hyst=50&a0_dir=1"
3. API HTTP OTA (Port 8081)
GET
/
Formular de incarcare pentru fisierul firmware .bin.
POST
/update
Incarcare binar firmware. Date formular multipart, numele campului: firmware.
Exemplu: Incarcare Firmware
curl -X POST http://192.168.1.100:8081/update \
-F "firmware=@PureAware_SEN66_V1.027.bin"
# Python
import requests
with open('PureAware_SEN66_V1.027.bin', 'rb') as f:
requests.post('http://192.168.1.100:8081/update',
files={'firmware': f})
Avertisment: Dispozitivul reporneste automat dupa o incarcare reusita. Nu intrerupeti alimentarea in timpul acestui proces.
4. API HTTP Nextion (Port 8082)
GET
/
Formular de incarcare pentru firmware-ul de afisaj Nextion .tft.
POST
/upload
Incarcare binar Nextion TFT. Date formular multipart.
curl -X POST http://192.168.1.100:8082/upload \
-F "file=@pureaware_v3.tft"
5. Protocol BACnet/IP (UDP 47808)
5.1 Transport
Parametru Valoare
Standard ASHRAE 135-2020, Anexa J
Port 47808 (0xBAC0) UDP
BVLC Original-Unicast (0x0A), Original-Broadcast (0x0B), Forwarded (0x04)
Max APDU 480 octeti
Segmentare Nesuportata
5.2 Servicii Suportate
Serviciu Tip Directie
Who-Is Neconfirmat Receptie → Raspuns cu I-Am
I-Am Neconfirmat Transmisie (unicast + broadcast)
ReadProperty Confirmat Receptie → Raspuns
ReadPropertyMultiple Confirmat Receptie → Raspuns
WriteProperty Confirmat Receptie → Raspuns
5.3 Harta Obiectelor
Tip Obiect Instanta Nume Unitati (ID)
Device (8) auto/manual hostname —
Analog Input (0) 0 CO2 ppm (96)
Analog Input (0) 1 PM1.0 µg/m³ (165)
Analog Input (0) 2 PM2.5 µg/m³ (165)
Analog Input (0) 3 PM4.0 µg/m³ (165)
Analog Input (0) 4 PM10 µg/m³ (165)
Analog Input (0) 5 VOC Index no-units (95)
Analog Input (0) 6 NOx Index no-units (95)
Analog Input (0) 7 TVOC ppb (97)
Analog Input (0) 8 Temperatura °C (62)
Analog Input (0) 9 Umiditate %RH (29)
Analog Input (0) 10 Presiune hPa (133)
5.4 ID-uri Proprietati
Proprietate ID Se Aplica La
Object_Identifier 75 Toate
Object_Name 77 Toate
Object_Type 79 Toate
Present_Value 85 AI, BI, BO
Status_Flags 111 AI, BI, BO
Event_State 36 AI, BI, BO
Out_Of_Service 81 AI, BI, BO
Units 117 AI
Reliability 103 AI
Description 28 AI
Vendor_Name 121 Device
Vendor_Identifier 120 Device
Model_Name 70 Device
Firmware_Revision 44 Device
Application_Software_Version 12 Device
Protocol_Version 98 Device
Protocol_Revision 139 Device
Max_APDU_Length_Accepted 62 Device
Segmentation_Supported 107 Device
System_Status 112 Device
Object_List 76 Device
Database_Revision 155 Device
6. Harta Registrelor Modbus TCP (TCP 502)
6.1 Conexiune
Parametru Valoare
Port 502
Clienti Max 3 (configurabil, maxim hard 10)
Timeout Inactivitate 60 secunde
Unit ID Oricare (ignorat, dispozitiv unic)
6.2 Coduri de Functie Suportate
FC Hex Denumire Zona de Date
01 0x01 Read Coils Coils (16)
02 0x02 Read Discrete Inputs Inputs (16)
03 0x03 Read Holding Registers Holding (16)
04 0x04 Read Input Registers Input Regs (12)
05 0x05 Write Single Coil Coils
06 0x06 Write Single Register Holding
15 0x0F Write Multiple Coils Coils
16 0x10 Write Multiple Registers Holding
6.3 Registre de Intrare (FC 04) — Date Senzor
Adresa Constanta Parametru Unitate Scalare
0 IR_DEVICE_TYPE Tip Dispozitiv — Fix: 1
1 IR_VOC VOC Index — 1:1 (1–500)
2 IR_NOX NOx Index — 1:1 (1–500)
3 IR_PM1 PM1.0 µg/m³ 1:1
4 IR_PM25 PM2.5 µg/m³ 1:1
5 IR_PM4 PM4.0 µg/m³ 1:1
6 IR_PM10 PM10 µg/m³ 1:1
7 IR_TEMP_X10 Temperatura °C × 10 ÷ 10
8 IR_HUM_X10 Umiditate %RH × 10 ÷ 10
9 IR_CO2 CO2 ppm 1:1
10 IR_TVOCW TVOC (WELL) µg/m³ 1:1
11 IR_PRESS_X10 Presiune hPa × 10 ÷ 10
6.4 Coils (FC 01/05/0F)
16 coils la adresa de baza 0. Disponibile pentru controlul iesirilor digitale personalizate.
6.5 Intrari Discrete (FC 02)
16 intrari discrete la adresa de baza 0. Disponibile pentru starea intrarilor digitale personalizate.
6.6 Registre Holding (FC 03/06/10)
16 registre holding la adresa de baza 0. Disponibile pentru parametri R/W personalizati.
7. Format Mesaje MQTT
7.1 Structura Topic-urilor
Dispozitivul publica pe un topic unic per dispozitiv:
{mtopic}/{mac6}/data
Unde {mtopic} este topic-ul de baza configurat si {mac6} sunt ultimele 6 cifre hexazecimale ale adresei MAC ESP32.
Exemplu: PureAware_Office/8a0de8/data
7.2 Parametri de Publicare
Parametru Valoare
Topic {mtopic}/{mac6}/data
QoS 0
Retain Nu
Payload JSON (toate valorile ca siruri)
Interval Configurabil (minim 10s, implicit 60s)
Client ID PureAware-{mac6}
7.3 Payload JSON
Camp Tip Unitate Descriere
device_typestring — Intotdeauna "SEN66"
namestring — Nume senzor (optional, doar daca este configurat)
co2string ppm Concentratie CO2
pm1string µg/m³ Concentratie masica PM1.0
pm25string µg/m³ Concentratie masica PM2.5
pm4string µg/m³ Concentratie masica PM4.0
pm10string µg/m³ Concentratie masica PM10
vocstring — Index VOC (1–500)
noxstring — Index NOx (1–500)
tvocwstring µg/m³ TVOC (standard WELL)
tempstring °C Temperatura (1 zecimala)
humstring %RH Umiditate relativa (1 zecimala)
pressstring hPa Presiune barometrica (1 zecimala)
rssistring dBm Putere semnal WiFi
7.4 Exemplu Payload
{
"device_type": "SEN66",
"name": "Office Sensor",
"co2": "845",
"pm1": "3",
"pm25": "5",
"pm4": "7",
"pm10": "8",
"voc": "127",
"nox": "15",
"tvocw": "342",
"temp": "23.5",
"hum": "55.2",
"press": "1013.2",
"rssi": "-52"
}
Nota: Toate valorile sunt transmise ca siruri JSON (intre ghilimele). Campul name este inclus doar daca un Nume de Senzor este configurat in setarile dispozitivului.
7.5 Exemple de Abonare
# Abonare la un dispozitiv specific
mosquitto_sub -h broker.emqx.io -t "PureAware_Office/8a0de8/data" -v
# Abonare la toate dispozitivele de pe acelasi topic de baza
mosquitto_sub -h broker.emqx.io -t "PureAware_Office/#" -v
8. Protocol Zabbix Sender
8.1 Format Mesaj
Protocol standard Zabbix Sender JSON prin TCP:
{
"request": "sender data",
"data": [
{"host": "PureAware_Office", "key": "device_type", "value": "PureAQS66"},
{"host": "PureAware_Office", "key": "co2", "value": "845"},
{"host": "PureAware_Office", "key": "pm1", "value": "3"},
{"host": "PureAware_Office", "key": "pm25", "value": "5"},
{"host": "PureAware_Office", "key": "pm4", "value": "7"},
{"host": "PureAware_Office", "key": "pm10", "value": "8"},
{"host": "PureAware_Office", "key": "voc", "value": "127"},
{"host": "PureAware_Office", "key": "nox", "value": "15"},
{"host": "PureAware_Office", "key": "tvocw", "value": "342"},
{"host": "PureAware_Office", "key": "temp", "value": "23.5"},
{"host": "PureAware_Office", "key": "hum", "value": "55.2"},
{"host": "PureAware_Office", "key": "press", "value": "1013.2"},
{"host": "PureAware_Office", "key": "rssi", "value": "-52"}
]
}
8.2 Chei Element Zabbix
Cheie Tip Unitate
co2 Numeric (float) ppm
pm1 Numeric (float) µg/m³
pm25 Numeric (float) µg/m³
pm4 Numeric (float) µg/m³
pm10 Numeric (float) µg/m³
voc Numeric (float) —
nox Numeric (float) —
tvocw Numeric (float) µg/m³
temp Numeric (float) °C
hum Numeric (float) %
press Numeric (float) hPa
9. Comenzi Serial UART
9.1 Interfata Serial2
Parametru Valoare
UART Serial2 (RX: GPIO 14, TX: GPIO 27)
Rata Baud 115200
Format 8N1
Detectie Fereastra glisanta de 6 octeti
9.2 Comenzi de Schimbare Mod
Comanda (hex) Actiune
01 01 01 FF FF FFComutare in modul AP (Access Point)
02 02 02 FF FF FFComutare in modul STA (Station)
03 03 03 FF FF FFComutare in modul OFFLINE
Firmware-ul mentine un buffer cu fereastra glisanta de 6 octeti (window6[6]). Cand fereastra se potriveste cu unul dintre modelele de comanda, dispozitivul schimba modul si reporneste.
9.3 Interfata Serial1 (RS-485)
Parametru Valoare
UART Serial1 (RX: GPIO 16, TX: GPIO 17)
Rata Baud 19200
Format 8N1
Control Directie GPIO 2 (HIGH = transmisie)
Protocol Modbus RTU