Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 4.88 KB

api.md

File metadata and controls

49 lines (30 loc) · 4.88 KB

Server API

Since version 0.9.6 of EnigmaIOT, network connected Gateways may include a REST API to get information and manage nodes.

This enables future development of a web frontend for EnigmaIOT Gateways.

All requests parameters are sent as URL encoded.

All responses are given in JSON format

Gateway information

Entry point Parameters Method Response Comments
/api/gw/info GET version: EnigmaIOT library version
network: EnigmaIOT network name
addresses:
AP: Gateway AP mac address
STA: Gateway STA mac address
channel: WiFi channel used
ap: AP name
bssid: AP mac address
rssi: AP RSSI (dBm)
txpower: Gateway WiFi power (dBm)
dns: DNS Address
Gets gateway network information
/api/gw/nodenumber GET nodeNumber: Number of registered nodes Gets current number of registered nodes
/api/gw/maxnodes GET maxNodes: Maximum number of nodes allowed Gets the maximum number of nodes that can be registered in gateway

Gateway commands

Entry point Parameters Method Response Comments
api/gw/restart confirm=1 PUT gw_restart: <processed | fail> Restarts gateway software. Confirm must be 1
api/gw/reset confirm=1 PUT gw_reset: <processed | fail> Resets gateway configuration. Confirm must be 1

Node information

Entry point Parameters Method Response Comments
/api/gw/nodes GET nodes: <list>
nodeId: Node identifier assigned by gateway
address: Node mac address
name: Node name
Gets a list of registered nodes with nodeId, address and name
/api/node/node nodeid GET version: EnigmaIOT library version
node_id: NodeID
address: Node mac address
Name: Node name
keyValidSince: Time since session key was last refreshed (seconds)
lastMessageTime: Time since last message (seconds)
sleepy: True | False
broadcast: True | False
rssi: Received gateway power from node
packetsHour: Packet rate (pkt/h)
per: Packet error rate (%)
Gets node information given its nodeID
/api/node/node nodename GET version: EnigmaIOT library version
node_id: NodeID
address: Node mac address
Name: Node name
keyValidSince: Time since session key was last refreshed (seconds)
lastMessageTime: Time since last message (seconds)
sleepy: True | False
broadcast: True | False
rssi: Received gateway power from node
packetsHour: Packet rate (pkt/h)
per: Packet error rate (%)
Gets node information given its name
/api/node/node nodeaddr GET version: EnigmaIOT library version
node_id: NodeID
address: Node mac address
Name: Node name
keyValidSince: Time since session key was last refreshed (seconds)
lastMessageTime: Time since last message (seconds)
sleepy: True | False
broadcast: True | False
rssi: Received gateway power from node
packetsHour: Packet rate (pkt/h)
per: Packet error rate (%)
Gets node information given its mac address

Node commands

Entry point Parameters Method Response Comments
/api/node/node nodeid DEL result: Error string Unregisters node given its nodeID
/api/node/node nodename DEL result: Error string Unregisters node given its name
/api/node/node nodeaddr DEL result: Error string Unregisters node given its mac address
/api/node/restart nodename PUT node_restart: Error string Triggers node restart