Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Apr 17, 2023
2 parents 1a0f44d + 40cee1f commit 1e16eca
Show file tree
Hide file tree
Showing 88 changed files with 4,522 additions and 864 deletions.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"DavidAnson.vscode-markdownlint",
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
Expand Down
69 changes: 46 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,28 +193,41 @@ Topics for 3 phases of a power meter is configurable. Given is an example for th

## Currently supported Inverters

* Hoymiles HM-300
* Hoymiles HM-350
* Hoymiles HM-400
* Hoymiles HM-600
* Hoymiles HM-700
* Hoymiles HM-800
* Hoymiles HM-1000
* Hoymiles HM-1200
* Hoymiles HM-1500
* Solenso SOL-H350
* Solenso SOL-H400
* Solenso SOL-H800
* TSUN TSOL-M350 (Maybe depending on firmware/serial number on the inverter)
* TSUN TSOL-M800 (Maybe depending on firmware/serial number on the inverter)
* TSUN TSOL-M1600 (Maybe depending on firmware/serial number on the inverter)
| Model | Required RF Module | DC Inputs | MPP-Tracker | AC Phases |
| --------------------| ------------------ | --------- | ----------- | --------- |
| Hoymiles HM-300 | NRF24L01+ | 1 | 1 | 1 |
| Hoymiles HM-350 | NRF24L01+ | 1 | 1 | 1 |
| Hoymiles HM-400 | NRF24L01+ | 1 | 1 | 1 |
| Hoymiles HM-600 | NRF24L01+ | 2 | 2 | 1 |
| Hoymiles HM-700 | NRF24L01+ | 2 | 2 | 1 |
| Hoymiles HM-800 | NRF24L01+ | 2 | 2 | 1 |
| Hoymiles HM-1000 | NRF24L01+ | 4 | 2 | 1 |
| Hoymiles HM-1200 | NRF24L01+ | 4 | 2 | 1 |
| Hoymiles HM-1500 | NRF24L01+ | 4 | 2 | 1 |
| Hoymiles HMS-300 | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-350 | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-400 | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-450 | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-500 | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-600 | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-700 | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-800 | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-900 | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-1000 | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-1600 | CMT2300A | 4 | 4 | 1 |
| Hoymiles HMS-1800 | CMT2300A | 4 | 4 | 1 |
| Hoymiles HMS-2000 | CMT2300A | 4 | 4 | 1 |
| Hoymiles HMT-1800 | CMT2300A | 6 | 3 | 3 |
| Hoymiles HMT-2250 | CMT2300A | 6 | 3 | 3 |
| Solenso SOL-H350 | NRF24L01+ | 1 | 1 | 1 |
| Solenso SOL-H400 | NRF24L01+ | 1 | 1 | 1 |
| Solenso SOL-H800 | NRF24L01+ | 2 | 2 | 1 |
| TSUN TSOL-M350 | NRF24L01+ | 1 | 1 | 1 |
| TSUN TSOL-M800 | NRF24L01+ | 2 | 2 | 1 |
| TSUN TSOL-M1600 | NRF24L01+ | 4 | 2 | 1 |

**TSUN compatibility remark:**
Compatibility with OpenDTU seems to be related to serial numbers. Current findings indicate that TSUN inverters with a serial number starting with "11" are supported, whereby inverters with a serial number starting with "10" are not.
Firmware version seems to play not a significant role and cannot be read from the stickers. For completeness, the following firmware version have been reported to work with OpenDTU:

* v1.0.8, v1.0.10 TSOL-M800 (DE)
* v1.0.12 TSOL-M1600
Compatibility with OpenDTU is most likly related to the serial number of the inverter. Current findings indicate that TSUN inverters with a serial number starting with "11" are supported, whereby inverters with a serial number starting with "10" are not.

## Features for end users

Expand All @@ -236,6 +249,8 @@ Firmware version seems to play not a significant role and cannot be read from th
* Prometheus API endpoint (/api/prometheus/metrics)
* English, german and french web interface
* Displays (SSD1306, SH1106, PCD8544)
* Status LEDs
* Konfiguration management (export / import configurations)
* Dark Theme

## Features for developers
Expand Down Expand Up @@ -273,7 +288,7 @@ Sample Picture:

Also supported: Board with Ethernet-Connector and Power-over-Ethernet [Olimex ESP32-POE](https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware)

### NRF24L01+ radio board
### NRF24L01+ radio board (See inverter table above for supported inverters)

The PLUS sign is IMPORTANT! There are different variants available, with antenna on the printed circuit board or external antenna.

Expand All @@ -292,11 +307,19 @@ A heavily incomplete list of trusted hardware shops in germany is:

This list is for your convenience only, the project is not related to any of these shops.

### CMT2300A radio board (See inverter table above for supported inverters)

It is important to get a module which supports SPI communicatiton. The following modules are currently supported:

* EBYTE E49-900M20S

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.

### Power supply

Use a power suppy with 5 V and 1 A. The USB cable connected to your PC/Notebook may be powerful enough or may be not.

## Wiring up
## Wiring up the NRF24L01+ module

### Schematic

Expand Down Expand Up @@ -478,7 +501,7 @@ A documentation of the Web API can be found here: [Web-API Documentation](docs/W
* OpenDTU needs access to a working NTP server to get the current date & time.
* If your problem persists, check the [Issues on Github](https://github.com/tbnobody/OpenDTU/issues). Please inspect not only the open issues, also the closed issues contain useful information.
* Another source of information are the [Discussions](https://github.com/tbnobody/OpenDTU/discussions/)
* When flashing with VSCode Plattform.IO fails and also with ESPRESSIF tool a demo bin file cannot be flashed to the ESP32 with error message "A fatal error occurred: MD5 of file does not match data in flash!" than un-wire/unconnect ESP32 from the NRF24L01+ board. Try to flash again and rewire afterwards.
* When flashing with VSCode Plattform.IO fails and also with ESPRESSIF tool a demo bin file cannot be flashed to the ESP32 with error message "A fatal error occurred: MD5 of file does not match data in flash!" than un-wire/unconnect ESP32 from the NRF24L01+ board. Try to flash again and rewire afterwards.

## Related Projects

Expand Down
6 changes: 6 additions & 0 deletions docs/DeviceProfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ The json file can contain multiple profiles. Each profile requires a name and di
| 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. |
Expand Down
102 changes: 98 additions & 4 deletions docs/DeviceProfiles/blinkyparts_esp32.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"name": "LEDs, Display",
"name": "NRF, LEDs, Display",
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -20,7 +20,35 @@
}
},
{
"name": "Only Display",
"name": "CMT, LEDs, Display",
"nrf24": {
"miso": -1,
"mosi": -1,
"clk": -1,
"irq": -1,
"en": -1,
"cs": -1
},
"cmt": {
"clk": 18,
"cs": 4,
"fcs": 5,
"sdio": 23,
"gpio2": 19,
"gpio3": 16
},
"display": {
"type": 3,
"data": 21,
"clk": 22
},
"led": {
"led0": 25,
"led1": 26
}
},
{
"name": "NRF, Display",
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -36,7 +64,31 @@
}
},
{
"name": "Only LEDs",
"name": "CMT, Display",
"nrf24": {
"miso": -1,
"mosi": -1,
"clk": -1,
"irq": -1,
"en": -1,
"cs": -1
},
"cmt": {
"clk": 18,
"cs": 4,
"fcs": 5,
"sdio": 23,
"gpio2": 19,
"gpio3": 16
},
"display": {
"type": 3,
"data": 21,
"clk": 22
}
},
{
"name": "NRF, LEDs",
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -51,7 +103,30 @@
}
},
{
"name": "No Output",
"name": "CMT, LEDs",
"nrf24": {
"miso": -1,
"mosi": -1,
"clk": -1,
"irq": -1,
"en": -1,
"cs": -1
},
"cmt": {
"clk": 18,
"cs": 4,
"fcs": 5,
"sdio": 23,
"gpio2": 19,
"gpio3": 16
},
"led": {
"led0": 25,
"led1": 26
}
},
{
"name": "NRF",
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -60,5 +135,24 @@
"en": 4,
"cs": 5
}
},
{
"name": "CMT",
"nrf24": {
"miso": -1,
"mosi": -1,
"clk": -1,
"irq": -1,
"en": -1,
"cs": -1
},
"cmt": {
"clk": 18,
"cs": 4,
"fcs": 5,
"sdio": 23,
"gpio2": 19,
"gpio3": 16
}
}
]
47 changes: 47 additions & 0 deletions docs/DeviceProfiles/nodemcu_esp32.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,34 @@
"clk_mode": 0
}
},
{
"name": "Generic NodeMCU 32 with CMT2300A",
"nrf24": {
"miso": -1,
"mosi": -1,
"clk": -1,
"irq": -1,
"en": -1,
"cs": -1
},
"cmt": {
"clk": 18,
"cs": 4,
"fcs": 5,
"sdio": 23,
"gpio2": 19,
"gpio3": 16
},
"eth": {
"enabled": false,
"phy_addr": -1,
"power": -1,
"mdc": -1,
"mdio": -1,
"type": 0,
"clk_mode": 0
}
},
{
"name": "Generic NodeMCU 32 with SSD1306",
"nrf24": {
Expand Down Expand Up @@ -68,5 +96,24 @@
"data": 21,
"clk": 22
}
},
{
"name": "Generic NodeMCU 32 with NRF + CMT Module",
"nrf24": {
"miso": 19,
"mosi": 23,
"clk": 18,
"irq": 16,
"en": 4,
"cs": 5
},
"cmt": {
"clk": 12,
"sdio": 14,
"cs": 27,
"fcs": 26,
"gpio2": -1,
"gpio3": -1
}
}
]
8 changes: 5 additions & 3 deletions include/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <Arduino.h>

#define CONFIG_FILENAME "/config.json"
#define CONFIG_VERSION 0x00011800 // 0.1.24 // make sure to clean all after change
#define CONFIG_VERSION 0x00011900 // 0.1.24 // make sure to clean all after change

#define WIFI_MAX_SSID_STRLEN 32
#define WIFI_MAX_PASSWORD_STRLEN 64
Expand All @@ -23,7 +23,7 @@

#define INV_MAX_NAME_STRLEN 31
#define INV_MAX_COUNT 10
#define INV_MAX_CHAN_COUNT 4
#define INV_MAX_CHAN_COUNT 6

#define CHAN_MAX_NAME_STRLEN 31

Expand Down Expand Up @@ -98,7 +98,9 @@ struct CONFIG_T {

uint64_t Dtu_Serial;
uint32_t Dtu_PollInterval;
uint8_t Dtu_PaLevel;
uint8_t Dtu_NrfPaLevel;
int8_t Dtu_CmtPaLevel;
uint32_t Dtu_CmtFrequency;

bool Mqtt_Hass_Enabled;
bool Mqtt_Hass_Retain;
Expand Down
9 changes: 9 additions & 0 deletions include/PinMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ struct PinMapping_t {
int8_t nrf24_irq;
int8_t nrf24_en;
int8_t nrf24_cs;

int8_t cmt_clk;
int8_t cmt_cs;
int8_t cmt_fcs;
int8_t cmt_gpio2;
int8_t cmt_gpio3;
int8_t cmt_sdio;

int8_t eth_phy_addr;
bool eth_enabled;
int eth_power;
Expand Down Expand Up @@ -50,6 +58,7 @@ class PinMappingClass {
PinMapping_t& get();

bool isValidNrf24Config();
bool isValidCmt2300Config();
bool isValidEthConfig();
bool isValidVictronConfig();
bool isValidBatteryConfig();
Expand Down
1 change: 1 addition & 0 deletions include/WebApi_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum WebApiError {
DtuSerialZero,
DtuPollZero,
DtuInvalidPowerLevel,
DtuInvalidCmtFrequency,

ConfigBase = 3000,
ConfigNotDeleted,
Expand Down
Loading

0 comments on commit 1e16eca

Please sign in to comment.