-
Notifications
You must be signed in to change notification settings - Fork 3
RaftCoreAPI
Rob Dobson edited this page Feb 8, 2026
·
11 revisions
| URL | Verb | Description | e.g. req | e.g. resp |
|---|---|---|---|---|
v |
GET | Get the system name and version of RIC | v | {"req":"v","rslt":"ok","SystemName":"Cog","SystemVersion":"1.3.0","Friendly":"","SerialNo":"","MAC":"b0818422894a","SysTypeVers":"","HwRev":""} |
friendlyname |
GET | Get or set the friendly name. Set a blank name to clear. The name and friendlyNameIsSet are strored in non-volatile storage |
friendlynameor friendlyname/My Deviceor friendlyname/
|
{"req":"friendlyname","friendlyName":"My Device","friendlyNameIsSet":1,"rslt":"ok"}or {"req":"friendlyname/My Device","friendlyName":"My Device","friendlyNameIsSet":1,"rslt":"ok"}or {"req":"friendlyname/","friendlyName":"SystemName","friendlyNameIsSet":0,"rslt":"ok"}
|
w/<ssid>/<password> |
GET | Specify WiFi Station (client) credentials. WiFi SSID is limited to 31 (not 32) chars. Password is limited to 63 (not 64) chars. Valid SSID chars include: ~!@#$^*()-={}[:;<>?,.Aa1 %&_/<br> And valid Password chars include:~!@#$^*()-={}[:;<>?,.A1 %&_]+"\/ HTTP encoded chars are valid - e.g. backslash %2F forward-slash %5C. |
w/myssid/mypassword |
{"req":"w/myssid/mypassword","rslt":"ok"} |
wap/<ssid>/<password> |
GET | Specify WiFi Access Point credentials. WiFi SSID is limited to 31 (not 32) chars. Password is limited to 63 (not 64) chars. Valid SSID chars include: ~!@#$^*()-={}[:;<>?,.Aa1 %&_/<br> And valid Password chars include:~!@#$^*()-={}[:;<>?,.A1 %&_]+"\/ HTTP encoded chars are valid - e.g. backslash %2F forward-slash %5C. |
wap/myssid/mypassword |
{"req":"wap/myssid/mypassword","rslt":"ok"} |
wc/<norestart> |
GET | Clear WiFi credentials and disconnect WiFi. norestart option suppresses restart |
wc or wc/norestart
|
{"req":"wc","rslt":"ok"} or {"req":"wc/norestart","rslt":"ok"}
|
reset |
GET | Schedule a reset in around 1 second. | reset |
{"req":"reset","rslt":"ok"} |
serialno |
GET | Set / get system serial number. Serial number is a 16 byte value (sent/received hex formatted). |
serialno or serialno/01234567890ABCDEF0123456789ABCDEF
|
{"req":"serialno","SerialNo":"0123456789abcdef0123456789abcdef","rslt":"ok"} or {"req":"serialno/0123456789ABCDEF0123456789ABCDEF","SerialNo":"01234567890abcdef0123456789abcde","rslt":"ok"}
|
hwrevno |
GET | Get hardware revision and SysTypeVersion The hardware revision may be any string. Once set the hardware revision is stored in non-volatile storage The SysTypeVers is a string which is used to determine which version of a SysType is used (this is applicable to versioned SysTypes only) |
hwrevno |
{"req":"hwrevno","SysTypeVers":"","HwRev":"","rslt":"ok"} |
filelist/<fs> |
GET | Get a list of files on the file system. Two file systems are supported: local (stored in flash on the ESP32) and SD (if an external SD card is present). The first part of the path can specify a file system followed by ~. If no file system is specified the default one is used which is generally local. |
filelistor filelist/localor filelist/sd
|
{"req":"filelist","rslt":"ok","fsName":"local","fsBase":"/local","diskSize":892556.00,"diskUsed":111946.00,"folder":"/local/","files":[{"name":"test.txt","size":317}, ... ]} |
fileread/<fs>/<filename> |
GET | Read the content of a text file and return as a string |
fileread/local/<fileName>or fileread/sd/test.txt
|
… the text content of the file … |
filedelete/<fs>/<filename> |
GET | Delete a file on a file system | filedelete/<fs>/<filename> |
{"req":"filedelete/local/test.txt","rslt":"ok"} |
fileupload |
POST | Upload a file to the file system using HTTP POST. This is only directly usable from a WiFi/Ethernet connection, other communication channels are supported using the RICREST protocol. |
fileupload |
|
reformatfs |
GET | Re-format the file system (either local or sd). This can be forced (even if the fs is not corrupt) using the reformatfs/force option. Note that the system will restart if a re-format is successful. |
reformatfs/local |
{"req":"reformatfs/local","rslt":"ok"} |
sysmodinfo/<SysMod> |
GET | Get information on a SysMod (system module). SysMod names are case-sensitive. Examples of SysMod names are NetMan, BLEMan, SysMan. |
sysmodinfo/NetMan |
{“rslt”:”ok”,"isConn":1,"connState":"WiFiAndIP","SSID":"myssid","IP":"192.168.1.12","Hostname":""} |
sysmoddebug/<SysMod> |
GET | Get debug information from a SysMod. | sysmoddebug/NetMan |
{"req":"sysmoddebug/RobotCtrl","debugStr":"... debug info ..."} |
getsettings/<filter> |
GET | Get SysType settings. These are the overall JSON configuration for the active SysType. There are two sections to the SysType settings, base settings are those defined in the SysType defined when the firmware was built and are immutable, nv settings are overrides to the base settings which are stored in non-volatile storage and are user-modifiable (see postsettings below). The option allows section of base, nv or all settings
|
getsettingsor getsettings/nv
|
{"req":"getsettings","sysType":"MySysType","nv":{},"base":{"SysType":"MySysType","CmdsAtStart":"","WebUI":"","SysManager":{"monitorPeriodMs":10000,"reportList":["NetMan","BLEMan","SysMan"],... |
postsettings |
POST | Set SysType nv (non-volatile) settings, see getsettings for explanation of SysType settings.This POST operation will only work natively over HTTP - see RICREST for use over other comms channels. |
postsettings |
The JSON object has the same format as the SysType settings returned by the getsettings/base command.Override occurs JSON tag by JSON tag, so if an array is specified at exactly the same point in the nv section then it will override an array of the same name and position in the base settings. |
clearsettings |
GET | Clear nv (non-volatile) settings, see getsettings for more information. |
clearsettings |
|
subscription |
GET | Setup subscriptions to published information. Single topic format: topic (or name) is the topic name, rateHz specifies publish rate in Hz (0 to disable), minMs sets minimum interval between messages in milliseconds (default: varies), and trigger sets the trigger type (change, time, timeorchange - default: timeorchange).Multiple topics format: Use pubRecs array with objects containing name (or topic), rateHz, minMs, and trigger fields.Note that subscriptions are specific to a communication channel and all interfaces now require explicit subscription (including BLE and serial interfaces). |
Single topic:subscription?action=update&topic=MyPublishedData&rateHz=10.0&trigger=timeorchange&minMs=100Multiple topics (JSON format): {"cmdName":"subscription","action":"update","pubRecs":[{"name":"Topic1","rateHz":10.0,"trigger":"timeorchange"},{"name":"Topic2","rateHz":0}]}
|
{'req': 'subscription', 'rslt': 'ok'} |
wifipause/<op> |
GET | Pause/resume WiFi operation |
wifipause/pauseor wifipause/resume
|
{"req":"wifipause/pause","rslt":"ok"}or {"req":"wifipause/resume","rslt":"ok"}
|
wifiscan |
GET | Scan for WiFi Access Points. Two operations are supported: start starts a new scan and results returns results of a previous scan. After starting a scan results can be called periodically to get the result of the scan which will either be a indicate the scan is in progress or the scan is complete along with a list of discovered access points. |
wifiscan/startor wifiscan/results
|
wifiscan/startor wifiscan/results
|
blerestart |
GET | Restart BLE sub-system. This will take a few seconds to restart. | blerestart |
{"req":"blerestart","rslt":"ok"} |
espFwUpdate |
POST | Start a firmware update of the main system firmware. Since this is a POSt command it operates normally over WiFi but must be used via RICREST for other comms channels. | espFwUpdate |
|
devman/typeinfo |
GET | Get type information for a device type on a specific bus. The bus parameter can be a bus name or bus number. The type parameter can be a device type name or device type index. |
devman/typeinfo?type=LSM6DSor devman/typeinfo?type=5
|
{"req":"devman/typeinfo?type=LSM6DS","rslt":"ok","devinfo":{"name":"LSM6DS","desc":"6-Axis IMU","manu":"ST","type":"LSM6DS", ... },"dtIdx":5} |
devman/cmdraw |
GET | Send a raw command to a device on a specific bus. The hexWr parameter contains hex-encoded bytes to write. The numToRd parameter specifies how many bytes to read back. |
devman/cmdraw?bus=I2CA&addr=0x6a&hexWr=0F&numToRd=1 |
{"req":"devman/cmdraw?bus=I2CA&addr=0x6a&hexWr=0F&numToRd=1","rslt":"ok"} |
devman/setpollinterval |
GET | Set the polling interval for a bus-connected device. The bus parameter can be a bus name or bus number. The device parameter can be a device ID or device address. The intervalMs parameter is the polling interval in milliseconds. Only works for devices connected via a bus (I2C, Serial, etc.). |
devman/setpollinterval?bus=I2CA&device=0x20&intervalMs=50or devman/setpollinterval?bus=1&device=I2CA_0x20&intervalMs=50
|
{"req":"devman/setpollinterval?bus=I2CA&device=0x20&intervalMs=50","rslt":"ok"}Errors: failBusMissing, failDeviceMissing, failInvalidInterval, failDeviceNotFound, failBusNotFound
|
devman/busname |
GET | Get the bus name from a bus number. Bus numbers start from 1 and match the numbering used in device data JSON/binary messages. Only buses with valid device interfaces are numbered. | devman/busname?busnum=1 |
{"req":"devman/busname?busnum=1","rslt":"ok","busName":"I2CA"}Errors: failInvalidBusNum, failBusNotFound
|
devman/cmdjson |
GET | Send a JSON command to a device. The name parameter specifies the device name and json parameter contains URL-encoded JSON command. Used for devices that accept JSON commands like MotorController. See MotorController Device for detailed command reference. |
devman/cmdjson?name=MotorController&json={"cmd":"motion","mode":"abs","pos":[100,50,25],"speed":75} |
{"req":"devman/cmdjson?name=MotorController&json={...}","rslt":"ok"}Returns: RAFT_OK, RAFT_BUSY, RAFT_INVALID_DATA, RAFT_INVALID_OPERATION, RAFT_CANNOT_START
|
devman/devdata |
GET | Get status/data from a device. The name parameter specifies the device name. Returns device-specific data in JSON format. |
devman/devdata?name=MotorController |
{"req":"devman/devdata?name=MotorController","rslt":"ok","pos":[100.0,50.0,25.0],"steps":[10000,5000,2500],"busy":false,"paused":false} |
devman/demo |
GET | Start a demo device for testing. The type parameter specifies the device type (default: "ACCDEMO"). Optional parameters include rate (sample rate in ms, default: 100), duration (duration in ms, default: 0 = infinite), offlineIntvS (interval between offline periods in seconds, default: 0 = no offline), and offlineDurS (duration of offline period in seconds, default: 10). Note: This endpoint is only available if DEVICE_MANAGER_ENABLE_DEMO_DEVICE is defined. |
devman/demo?type=ACCDEMO&rate=100&duration=60000&offlineIntvS=30&offlineDurS=5 |
{"req":"devman/demo?type=ACCDEMO&rate=100&duration=60000&offlineIntvS=30&offlineDurS=5","rslt":"ok","demoStarted":true,"type":"ACCDEMO","rate":100,"duration":60000,"offlineIntvS":30,"offlineDurS":5}Errors: failDemoDeviceExists
|