path:
This endpoint gives access to the device name and various network configurations. The network connection itself can be configured here, as well as connections to other servers (SNTP, MQTT).
The listing below shows the whole properties endpoint of an eNetMini.1601 module.
{
"name":"eNetMini1",
"networkInterfaces":[
{
"address":"004086FFFFFF",
"domain":"enetmini.net",
"hostEntries":[
{
"dhcp":false,
"address":"192.168.15.100",
"mask":"255.255.255.0",
"gateway":"0.0.0.0",
"dns":"0.0.0.0",
"Json+typeName":"MkcJsonLib.jHostEntry",
"Json+typeRevision":0
}
],
"Json+typeName":"MkcJsonLib.jNetworkInterface",
"Json+typeRevision":0
}
],
"sntpEntries":[
{
"address":"192.168.15.90",
"enable":false,
"Json+typeName":"MkcJsonLib.jSntpEntry",
"Json+typeRevision":0
}
],
"mqtt":
{
"root":"mkc",
"enable":false,
"address":"192.168.15.90",
"port":1883,
"keepalive":60,
"user":"user_mqtt",
"pass":"pass_mqtt",
"Json+typeName":"MkcJsonLib.jMqttEntry",
"Json+typeRevision":0
},
"Json+typeName":"MkcJsonLib.jProperties",
"Json+typeRevision":0
}
jProperties
This object contains all the network configurations and the device name.
{
"name":"eNetMini1",
"networkInterfaces":[...],
"sntpEntries":[...],
"mqtt":{...},
"Json+typeName":"MkcJsonLib.jProperties",
"Json+typeRevision":0
}
Variable | Description | datatype | writable |
name | The given device name | string | yes |
networkInterfaces | an array containing all network interfaces of the device | array | - |
sntpEntries | an array containing all SNTP client configurations | array | - |
mqtt | an object containing the MQTT client configuration | object | - |
curl read command example:
curl -H "ApiRdKey: rdKey1" 192.168.15.100/api/v1/properties
curl write command example:
curl -X PUT -H "ApiRdKey: rdKey1" -H "ApiWrKey: wrKey1" -d "name=test" 192.168.15.100/api/v1/properties
jNetworkInterface
This object contains the configurations of one network interface.
{
"address":"004086FFFFFF",
"domain":"enetmini.net",
"hostEntries":[...],
"Json+typeName":"MkcJsonLib.jNetworkInterface",
"Json+typeRevision":0
}
Variable | Description | datatype | writable |
address | The MAC address of the device | string | no |
domain | The domain of the device. Used for DNS queries in case of a static configuration | string | yes |
hostEntries | an array containing all network configurations for this network interface | array | - |
curl read command example:
curl -H "ApiRdKey: rdKey1" 192.168.15.100/api/v1/properties/networkInterfaces/0
curl write command example:
curl -X PUT -H "ApiRdKey: rdKey1" -H "ApiWrKey: wrKey1" -d "domain=mydomain.com" 192.168.15.100/api/v1/properties/networkInterfaces/0
jHostEntry
This object contains one network connection configuration.
{
"dhcp":false,
"address":"192.168.15.100",
"mask":"255.255.255.0",
"gateway":"0.0.0.0",
"dns":"0.0.0.0",
"Json+typeName":"MkcJsonLib.jHostEntry",
"Json+typeRevision":0
}
Variable | Description | datatype | writable |
dhcp | switch for enabling the DHCP client | boolean | yes |
address | The IP address for the static/fallback configuration | string | yes |
mask | The subnet mask for the static/fallback configuration | string | yes |
gateway | The gateway for the static/fallback configuration | string | yes |
dns | The address of the DNS server for the static/fallback configuration | string | yes |
curl read command example:
curl -H "ApiRdKey: rdKey1" 192.168.15.100/api/v1/properties/networkInterfaces/0/hostEntries/0
curl write command example:
curl -X PUT -H "ApiRdKey: rdKey1" -H "ApiWrKey: wrKey1" -d "dhcp=false" 192.168.15.100/api/v1/properties/networkInterfaces/0/hostEntries/0
- Note
- A change to this settings will take effect after a reset.
If DHCP client is enabled and the device fails to acquire a network configuration from the DHCP server, it will fallback to the static configuration.
If this happens a reset of the device is required to restart the DHCP client.
jSntpEntry
This object contains a configuration for a connection to a SNTP server.
{
"address":"192.168.15.90",
"enable":false,
"Json+typeName":"MkcJsonLib.jSntpEntry",
"Json+typeRevision":0
}
Variable | Description | datatype | writable |
address | The IP address of the SNTP server | string | yes |
enable | switch for turning the client on/off | boolean | yes |
curl read command example:
curl -H "ApiRdKey: rdKey1" 192.168.15.100/api/v1/properties/sntpEntries/0
curl write command example:
curl -X PUT -H "ApiRdKey: rdKey1" -H "ApiWrKey: wrKey1" -d "enable=true&address=192.168.15.90" 192.168.15.100/api/v1/properties/sntpEntries/0
jMqttEntry
This object contains a configuration for a connection to a MQTT broker.
{
"root":"mkc",
"enable":false,
"address":"192.168.15.90",
"port":1883,
"keepalive":60,
"user":"user_mqtt",
"pass":"pass_mqtt",
"Json+typeName":"MkcJsonLib.jMqttEntry",
"Json+typeRevision":0
}
Variable | Description | datatype | writable |
root | the root topic for the data | string | yes |
enable | switch for turning the client on/off | boolean | yes |
address | the IP address of the MQTT broker | string | yes |
port | the port of the MQTT broker | integer | yes |
keepalive | the keepalive value for the MQTT connection | integer | yes |
user | the username for authentication with the broker | string | yes |
pass | the password for authentication with the broker | string | yes |
for further details about the MQTT connection see MQTT
curl read command example:
curl -H "ApiRdKey: rdKey1" 192.168.15.100/api/v1/properties/mqtt
curl write command example:
curl -X PUT -H "ApiRdKey: rdKey1" -H "ApiWrKey: wrKey1" -d "root=myroottopic" 192.168.15.100/api/v1/properties/mqtt