Skip to content

Latest commit

 

History

History
362 lines (239 loc) · 2.71 KB

API.md

File metadata and controls

362 lines (239 loc) · 2.71 KB

DP50V5A REST API

Base URL:

http://<esp32-ip>

Status

Get PSU Status

GET /api/status

Response

{
    "success":true,
    "vset":5,
    "iset":2,
    "vout":5,
    "iout":0,
    "power":0,
    "vin":36.28,
    "output":true,
    "ccMode":false,
    "protection":0,
    "model":5005,
    "firmware":14,
    "locked":false,
    "ovp":51,
    "ocp":5.2,
    "opp":265.2
}

Output Control

Enable Output

GET /api/output?state=1

Response

OK

Disable Output

GET /api/output?state=0

Response

OK

Voltage / Current Control

Set Voltage

GET /api/voltage?value=12.0

Response

OK

Set Current

GET /api/current?value=2.5

Response

OK

Set Voltage and Current

GET /api/setvi?voltage=12.0&current=2.5

Response

OK

Protection Settings

Set OVP

GET /api/ovp?value=15.0

Response

OK

Set OCP

GET /api/ocp?value=2.5

Response

OK

Set OPP

GET /api/opp?value=30

Response

OK

Presets

Recall Preset

GET /api/preset?slot=0

Valid slots:

0-9

Response

OK

Front Panel

Lock Front Panel

GET /api/lock?state=1

Response

OK

Unlock Front Panel

GET /api/lock?state=0

Response

OK

Display

Set Brightness

GET /api/brightness?value=5

Valid values:

0-5

Response

OK

Logging

Start Logging

GET /api/log/start

Response

OK

Stop Logging

GET /api/log/stop

Response

OK

Clear Log

GET /api/log/clear

Response

OK

Download CSV Log

GET /api/log/csv

Response

timestamp,vout,iout,power,vin
0,5.00,0.10,0.50,36.4
1,5.00,0.11,0.55,36.4

Raw Register Access

Read Register

GET /api/read?reg=9

Response

255

Write Register

GET /api/raw?reg=9&value=1

Response

OK

Protection Codes

Value Meaning
0 Normal
1 OVP
2 OCP
3 OPP

Operating Modes

Value Meaning
false CV
true CC

Output State

Value Meaning
false OFF
true ON

Lock State

Value Meaning
false Unlocked
true Locked