Device Profiles
Sample Profiles
Ready-to-use device profiles can be found in the code repository.
Summary
Perform these steps to configure pin assignments for your board:
- Upload an appropriate device profile (JSON file).
- Afterwards, select a profile in the Web UI Device-Manager.
Details
It is required to setup hardware settings like pin assignments or Ethernet support using a JSON file. This tells OpenDTU what peripherals are connected and how they are connected. The JSON file is uploaded using the configuration management (Settings --> Config Management) in the web interface. Select "Pin Mapping (pin_mapping.json)" in the dropdown menu of the "Restore" section and choose the file to upload, then click the "Restore" button.
After the file was uploaded, the ESP performs a reboot. This is required as the pin settings could have changed within the file and pin assignments are initialized when booting.
To initially select or to change a device profile, navigate to Settings --> Device-Manager and select the appropriate profile. When changing the device profile, the ESP reboots. You can see the current (Active) and the new (Selected) pin assignment in the table below the combobox.
The JSON file can contain multiple profiles. Each profile requires a name and
the respective parameters. If any parameter is not set, the default value -1
("not in use") will be effective.
Structure of the JSON file
Examples
These profiles are partially incomplete and merely serve as example snippets.
[
{
"name": "Generic NodeMCU 38 pin with SSD1306 display",
"nrf24": {
"miso": 19,
"mosi": 23,
"clk": 18,
"irq": 16,
"en": 4,
"cs": 5
},
"display": {
"type": 2,
"data": 21,
"clk": 22
},
"eth": {
"enabled": false,
"phy_addr": -1,
"power": -1,
"mdc": -1,
"mdio": -1,
"type": -1,
"clk_mode": -1
}
},
{
"name": "Generic NodeMCU 38 pin with SSD1306",
"nrf24": {
"miso": 19,
"mosi": 23,
"clk": 18,
"irq": 16,
"en": 4,
"cs": 5
},
"eth": {
"enabled": false,
"phy_addr": -1,
"power": -1,
"mdc": -1,
"mdio": -1,
"type": -1,
"clk_mode": -1
},
"display": {
"type": 2,
"data": 21,
"clk": 22
}
},
{
"name": "Olimex ESP32-POE",
"links": [
{"name": "Datasheet", "url": "https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware"}
],
"nrf24": {
"miso": 15,
"mosi": 2,
"clk": 14,
"irq": 13,
"en": 16,
"cs": 5
},
"eth": {
"enabled": true,
"phy_addr": 0,
"power": 12,
"mdc": 23,
"mdio": 18,
"type": 0,
"clk_mode": 3
}
}
]
Note
Please be aware that numerical values used in the profile .json
file are
ESP chip GPIO numbers (NOT physical Pin numbers).
Implemented configuration values
Parameter | Data Type | Description |
---|---|---|
name | string | Unique name of the profile (max 63 characters) |
links | array | Must contain a object with the properties name and url. For each object a button is shown in the Device-Manager |
nrf24.miso | number | MISO Pin |
nrf24.mosi | number | MOSI Pin |
nrf24.clk | number | Clock Pin |
nrf24.irq | number | Interrupt Pin |
nrf24.en | number | Enable Pin |
nrf24.cs | number | Chip Select Pin |
cmt.sdio | number | SDIO Pin |
cmt.clk | number | CLK Pin |
cmt.cs | number | CS Pin |
cmt.fcs | number | FCS Pin |
cmt.gpio2 | number | GPIO2 Pin (optional) |
cmt.gpio3 | number | GPIO3 Pin (optional) |
eth.enabled | boolean | Enable/Disable the ethernet stack |
eth.phy_addr | number | Unique PHY addr |
eth.power | number | Power Pin (if available). Use -1 for not assigned pins. |
eth.mdc | number | Serial Management Interface MDC Pin. Use -1 for not assigned pins. |
eth.mdio | number | Serial Management Interface MDIO Pin. Use -1 for not assigned pins. |
eth.type | number | Possible values:
|
eth.clk_mode | number | Possible values:
|
w5500.mosi | number | Use -1 for not assigned pins. |
w5500.miso | number | Use -1 for not assigned pins. |
w5500.sclk | number | Use -1 for not assigned pins. |
w5500.cs | number | Use -1 for not assigned pins. |
w5500.int | number | Use -1 for not assigned pins. |
w5500.rst | number | Use -1 for not assigned pins. |
display.type | number | Specify type of display. Possible values:
|
display.data | number | Data Pin (e.g. SDA for i2c displays) required for all displays. Use 255 for not assigned pins. |
display.clk | number | Clock Pin (e.g. SCL for i2c displays) required for SSD1306 and SH1106. Use 255 for not assigned pins. |
display.cs | number | Chip Select Pin required for PCD8544. Use 255 for not assigned pins. |
display.reset | number | Reset Pin required for PCD8544, optional for all other displays. Use 255 for not assigned pins. |
led.led0 | number | LED pin for network indication.
|
led.led1 | number | LED pin for inverter indication.
|