Ethernet
The Ethernet component handles the ethernet interface of devices and uses Eth
for RPC method namespace. It uses the key eth
when enumerated in objects including multiple component payloads, like Shelly.GetStatus
. Provides the minimal component interface:
Eth.SetConfig
to update the component's configurationEth.GetConfig
to obtain the component's configurationEth.GetStatus
to obtain the component's status
Methods
Eth.SetConfig
Properties:
Property | Type | Description |
---|---|---|
| object | Configuration that the method takes |
Find more about the config properties in config section
Eth.GetConfig
The Eth.GetConfig method does not own any request properties.Find the response properties in config section
Eth.GetStatus
The Eth.GetStatus method does not own any request properties.Find the response properties in status section
Configuration
The configuration of the Ethernet component shows the current settings of the ethernet connection.
Property | Type | Description |
---|---|---|
| boolean | True if the connection is enabled, false otherwise |
| string | IPv4 mode. Range of values: |
| string or null | IP in the network when |
| string or null | Netmask of the network when |
| string or null | Gateway of the network when |
| string or null | Nameserver to use when |
Status
The status of the Ethernet component contains the IP address which can be used to access the device over ethernet.
Property | Type | Description |
---|---|---|
| string or null | IP of the device in the network |
Examples
Eth.SetConfig example
- Eth.SetConfig HTTP GET Request
- Eth.SetConfig Curl Request
- Eth.SetConfig Mos Request
http://192.168.33.1/rpc/Eth.SetConfig?config={"enable":true}
curl -X POST -d '{"id":1,"method":"Eth.SetConfig","params":{"config":{"enable":true}}}' http://${SHELLY}/rpc
mos --port ${PORT} call Eth.SetConfig '{"config":{"enable":true}}'
Response
- Eth.SetConfig HTTP GET Response
- Eth.SetConfig Curl Response
- Eth.SetConfig Mos Response
{
"restart_required": false
}
{
"id": 1,
"src": "shellypro1-84cca87c1f90",
"params": {
"restart_required": false
}
}
{
"restart_required": false
}
Eth.GetConfig example
- Eth.GetConfig HTTP GET Request
- Eth.GetConfig Curl Request
- Eth.GetConfig Mos Request
http://192.168.33.1/rpc/Eth.GetConfig
curl -X POST -d '{"id":1,"method":"Eth.GetConfig"}' http://${SHELLY}/rpc
mos --port ${PORT} call Eth.GetConfig
Response
- Eth.GetConfig HTTP GET Response
- Eth.GetConfig Curl Response
- Eth.GetConfig Mos Response
{
"enable": true,
"ipv4mode": "dhcp",
"ip": null,
"netmask": null,
"gw": null,
"nameserver": null
}
{
"id": 1,
"src": "shellypro1-84cca87c1f90",
"params": {
"enable": true,
"ipv4mode": "dhcp",
"ip": null,
"netmask": null,
"gw": null,
"nameserver": null
}
}
{
"enable": true,
"ipv4mode": "dhcp",
"ip": null,
"netmask": null,
"gw": null,
"nameserver": null
}
Eth.GetStatus example
- Eth.GetStatus HTTP GET Request
- Eth.GetStatus Curl Request
- Eth.GetStatus Mos Request
http://192.168.33.1/rpc/Eth.GetStatus
curl -X POST -d '{"id":1,"method":"Eth.GetStatus"}' http://${SHELLY}/rpc
mos --port ${PORT} call Eth.GetStatus
Response
- Eth.GetStatus HTTP GET Response
- Eth.GetStatus Curl Response
- Eth.GetStatus Mos Response
{
"ip": null
}
{
"id": 1,
"src": "shellypro1-84cca87c1f90",
"params": {
"ip": null
}
}
{
"ip": null
}