-
Notifications
You must be signed in to change notification settings - Fork 66
Device Profiles
It is possible to change hardware settings like pin assignments or ethernet support using a JSON file. The JSON file can be uploaded using the configuration management in the web interface. Select Pin Mapping (pin_mapping.json)
in the recovery section.
When the file is uploaded the ESP performs a reboot. This is required as the pin settings could have changed within the file. By default all the pin assignments are used as compiled into the firmware. In recent releases, less and less default pin assignments are part of the firmware. Please always upload and select the appropriate device profile for your platform.
To change the device profile, navigate to the Device Manager
and selected the appropriate profile. You can see the current (Active) and the new (Selected) in assignment in the table below the combobox.
The JSON file can contain multiple profiles. Each profile requires a name and different parameters. If one parameter is not set, the default value, as compiled into the firmware is used.
Sample files for some boards are provided as part of the project's GIT code repository.
NOTE: These profiles are partially incomplete and merely serve as example snippets.
[
{
"name": "Generic NodeMCU 38 pin",
"nrf24": {
"miso": 19,
"mosi": 23,
"clk": 18,
"irq": 16,
"en": 4,
"cs": 5
},
"victron": {
"rx": 22,
"tx": -1
},
"battery": {
"rx": 27,
"tx": 14
},
"huawei": {
"miso": 12,
"mosi": 13,
"clk": 26,
"irq": 25,
"power": 33,
"cs": 15
},
"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",
"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
}
},
{
"name": "OpenDTU FUSION v2 + JK BMS on RS485 Transceiver",
"battery": {
"rx": 16,
"rxen": 15,
"tx": 45,
"txen": 46
}
},
{
"name": "OpenDTU FUSION v2 + Victron MPPT + Victron SmartShunt",
"nrf24": {
"miso": 48,
"mosi": 35,
"clk": 36,
"irq": 47,
"en": 38,
"cs": 37
},
"cmt": {
"clk": 6,
"cs": 4,
"fcs": 21,
"sdio": 5,
"gpio2": 3,
"gpio3": 8
},
"led": {
"led0": 17,
"led1": 18
},
"battery": {
"rx": 16,
"tx": -1
},
"victron": {
"rx": 22,
"tx": -1
}
}
]
See the upstream project's Wiki for JSON objects and pins that are not specific to features of OpenDTU-OnBattery, but inherited from the upstream project. The table below only lists OpenDTU-OnBattery-specific pins.
Parameter | Data Type | Description |
---|---|---|
victron.rx | integer | Victron MPPT Charger VE.Direct receive pin |
victron.tx | integer | Victron MPPT Charger VE.Direct transmit pin, can be set to -1 for now |
battery.rx | integer | Pylontech battery CAN bus receive pin, JK BMS receive pin or Victron SmartShunt VE.Direct receive pin |
battery.tx | integer | Pylontech battery CAN bus transmit pin, JK BMS transmit pin or Victron SmartShunt VE.Direct transmit pin, can be set to -1 for now |
battery.rxen | integer | JK BMS receive enable pin for RS485 transceiver mode |
battery.txen | integer | JK BMS transmit enable pin for RS485 transceiver mode |
huawei.miso | integer | MISO Pin for Huawei CAN bus interface |
huawei.mosi | integer | MOSI Pin for Huawei CAN bus interface |
huawei.clk | integer | CLK Pin for Huawei CAN bus interface |
huawei.cs | integer | CS Pin for Huawei CAN bus interface |
huawei.irq | integer | IRQ Pin for Huawei CAN bus interface |
huawei.power | integer | Power Pin for Huawei power control (e.g. using slot detect) |
"name": "Victron Pylontech HUAWEI NodeMCU 38 pin",
"nrf24": {
"miso": 19,
"mosi": 23,
"clk": 18,
"irq": 16,
"en": 4,
"cs": 5
},
"victron": {
"rx": 22,
"tx": 21
},
"battery": {
"rx": 27,
"tx": 14
},
"huawei": {
"miso": 12,
"mosi": 13,
"clk": 26,
"irq": 25,
"power": 33,
"cs": 15
},
"eth": {
"enabled": false,
"phy_addr": -1,
"power": -1,
"mdc": -1,
"mdio": -1,
"type": -1,
"clk_mode": -1
}
},
Using an ESP32 board is not a "free card" to add any and every Add-On, without previous consideration. Actually, in most cases it actually is... however, do not expect you can add all modules at the same time.
CaCu15 gives some background explanations:
SPI Bus (Serial Peripheral Interface bus) A four-line, synchronous, serial bus from Motorola that is widely used to connect a microcontroller to peripheral chips on a circuit board.
The ESP32 has 2 SPI buses available.
Several modules used by the OpenDTU, for example
- MCP2515 CAN bus module for the Huawei AC charger
- LRF24L01 Radio Board for HM- Inverters
- CMT2300A Radio Board for HMT-/HMS- Inverters
- various LCD Displays
use "SPI bus" for the connection.
The SPI supports in principle several SPI clients on the same bus, but this must be coded accordingly in the Software.
Currently, there are modules are "hardcoded" to one of the SPI buses:
The MCP2515 is hardcoded to SPI 2, see https://github.com/helgeerbe/OpenDTU-OnBattery/blob/development/docs/hardware_flash.md#mcp2515-can-bus-module
Currently the SPI bus host is hardcoded to number 2. This may change in future. Please note: Using the Huawei AC charger in combination with the CMT2300A radio board is not supported at the moment.
The CMT2300A is also fixed to an SPI, see https://github.com/helgeerbe/OpenDTU-OnBattery/blob/development/docs/hardware_flash.md#cmt2300a-radio-board--see-inverter-table-above-for-supported-inverters
The CMT2300A uses 3-Wire half duplex SPI communication. Due to this fact it currently requires a separate SPI bus. If you want to run the CMT2300A module on the same ESP32 as a NRF24L01+ module or a PCD8544 display, make sure you get a ESP which supports 2 SPI busses. Currently the SPI bus host is hardcoded to number 2. This may change in future.
In short, some combinations of controllers and displays are not supported at the moment.
The picture above and the Pinout examples are illustrative. You can choose which ESP32 PINs you want to use as you like.
Please be aware, however, that you have to take care not to use the input-only pins for output tasks (ESP32 "input-only" pins are: GPIO 34/35/36/39, see picture).
U0 TX/RX and U2 TX/RX may require some attention, too.
U0 TX might be used as output PIN for example but, during Boot, there is debug output on the PIN. Subsequently, an Add-On connected to that PIN may receive unwanted erroneous commands during boot. Just a word of caution.
- Home
- FAQ
- First-Time Installation
- Device Profiles (Pin Config)
- Upgrade from OpenDTU
- Getting Help
- Hilfe erhalten
- Builds & Examples
- ESP32 Versions and Memory
- Victron MPPT solar charger
- VE.Direct
- Victron Smartshunt
- Victron Smart Battery Sense
- Warning on Victron MPPT 100/20
- Pylontech battery
- Pytes battery
- Huawei AC PSU
- SBS Unipower Battery
- Jikong JK BMS
- HOYMILES
- Einschaltstrombegrenzung für Balkonkraftwerke - Inrush current limiter
- Live View
- Farbe des Wechselrichterfensters
- Power Meter
- Dynamic Power Limiter
- Dynamic Power Limiter ‐ (Full) Solar‐Passthrough
- Dynamic Power Limiter Limitations
- DC Voltage ‐ Load correction factor
- Battery
- Battery-Tipps
- 24V Battery issues with Hoymiles
- Home Assistant
- Grafana Dashboard
- XXL Balkonkraftwerk 1500 Watt und mehr! Worauf Ihr achten solltet!
- Wie gefährlich kann ein Balkonkraftwerk werden (FI‐Schutzschalter)
- Hardware Purchase Tipp
- Fan speed controller ‐ add temperature sensing to any fan
- Cable length(s) between battery and inverter
- Kabellänge(n) zwischen Batterie und Wechselrichter
- Diodes ‐ Bypass vs. Blocking Diodes
- Impact of high start-currents to the inverter
- Making Cables for your HOYMILES‐CAUTION