Skip to content

Commit

Permalink
Added first few pages from old wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Dec 28, 2023
1 parent 162d9ae commit 3053508
Show file tree
Hide file tree
Showing 21 changed files with 808 additions and 16 deletions.
Binary file added docs/assets/images/CMT2300a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/EByte_ML01DP5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/Generic_NRF24L01_PCB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/Generic_NRF24L01_SMA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/Putty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/vscode_serial_monitor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/assets/javascript/tablesort.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
document$.subscribe(function() {
var tables = document.querySelectorAll("article table:not([class])")
tables.forEach(function(table) {
new Tablesort(table)
})
})
12 changes: 12 additions & 0 deletions docs/firmware/compile_cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Compile on the command line with PlatformIO Core

* Install [PlatformIO Core](https://platformio.org/install/cli){target=_blank}
* Clone this repository (you really have to clone it, don't just download the ZIP file. During the build process the git hash gets embedded into the firmware. If you download the ZIP file a build error will occur)
* Adjust the COM port in the file "platformio_override.ini". It occurs twice:
* upload_port
* monitor_port
* build: `platformio run -e generic`
* upload to esp module: `platformio run -e generic -t upload`
* other options:
* clean the sources: `platformio run -e generic -t clean`
* erase flash: `platformio run -e generic -t erase`
15 changes: 15 additions & 0 deletions docs/firmware/compile_vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Compile with Visual Studio Code

* Install [Visual Studio Code](https://code.visualstudio.com/download){target=_blank} (from now named "vscode")
* In Visual Studio Code, install the [PlatformIO Extension](https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide){target=_blank}
* Install git and enable git in vscode - [git download](https://git-scm.com/downloads/){target=_blank} - [Instructions](https://www.jcchouinard.com/install-git-in-vscode/){target=_blank}
* Clone this repository (you really have to clone it, don't just download the ZIP file. During the build process the git hash gets embedded into the firmware. If you download the ZIP file a build error will occur): Inside vscode open the command palette by pressing ++ctrl+shift+p++. Enter `git clone`, add the repository-URL `https://github.com/tbnobody/OpenDTU`. Next you have to choose (or create) a target directory.
* In vscode, choose **File** --> **Open Folder** and select the previously downloaded source code. (You have to select the folder which contains the "platformio.ini" and "platformio_override.ini" file)
* Adjust the COM port in the file "platformio_override.ini" for your USB-to-serial-converter. It occurs twice:
* upload_port
* monitor_port
* Select the arrow button in the blue bottom status bar (PlatformIO: Upload) to compile and upload the firmware. During the compilation, all required libraries are downloaded automatically.
* Under Linux, if the upload fails with error messages "Could not open /dev/ttyUSB0, the port doesn't exist", you can check via ```ls -la /dev/tty*``` to which group your port belongs to, and then add your user this group via ```sudo adduser <yourusername> dialout``` (if you are using ```arch-linux``` use: ```sudo gpasswd -a <yourusername> uucp```, this method requires a logout/login of the affected user).
* There are two videos showing these steps:
* [Git Clone and compilation](https://youtu.be/9cA_esv3zeA){target=_blank}
* [Full installation and compilation](https://youtu.be/xs6TqHn7QWM){target=_blank}
116 changes: 116 additions & 0 deletions docs/firmware/device_profiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# 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. Just 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.

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.

## Structure of the json file

```json
[
{
"name": "Generic NodeMCU 38 pin",
"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
}
},
{
"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
}
}
]
```

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. The example above shows all the currently supported values. Others may follow. Sample files for some boards can be found [here](https://github.com/tbnobody/OpenDTU/tree/master/docs/DeviceProfiles){target=_blank}. This means you can just flash the generic bin file and upload the json file. Then you select your board and everything works hopyfully as expected.

## Implemented configuration values

| Parameter | Data Type | Description |
| ------------- | --------- | ----------- |
| name | string | Unique name of the profile (max 63 characters) |
| 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:<br>* 0 = ETH_PHY_LAN8720<br>* 1 = ETH_PHY_TLK110<br>* 2 = ETH_PHY_RTL8201<br>* 3 = ETH_PHY_DP83848<br>* 4 = ETH_PHY_DM9051<br>* 5 = ETH_PHY_KSZ8041<br>* 6 = ETH_PHY_KSZ8081* |
| eth.clk_mode | number | Possible values:<br>* 0 = ETH_CLOCK_GPIO0_IN<br>* 1 = ETH_CLOCK_GPIO0_OUT<br>* 2 = ETH_CLOCK_GPIO16_OUT<br>* 3 = ETH_CLOCK_GPIO17_OUT |
| display.type | number | Specify type of display. Possible values:<br>* 0 = None (default)<br>* 1 = PCD8544 <br>* 2 = SSD1306 <br>* 3 = SH1106 |
| 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. Blinking = WLAN connected but NTP & MQTT (if enabled) disconnected. On = WLAN, NTP, MQTT connected. Off = Network not connected |
| led.led1 | number | LED pin for inverter indication. On = All inverters reachable & producing. Blinking = All inverters reachable but not producing. Off = At least one inverter is not reachable. Only inverters with polling enabled are considered. |
54 changes: 54 additions & 0 deletions docs/firmware/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Frequently Asked Questions

## :question: How to observe the ESP32 boot process by looking at the serial console?

The serial console which is shown in the WebUI does not show the whole boot process and also not several very critical errors. (Just because in such moments the TCP connection is also interrupted). There are several ways to look at the serial console. First of all, the ESP32 has to be connected via an USB cable to the computer.

* If you are using Windows and installed a pre-compiled .bin file you can use e.g. [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html){target=_blank}
* Download the putty.exe file and run it.
* Enter the correct serial port (e.g. COM3) and the right baud rate: 115200
![Putty](../assets/images/Putty.png)
* Then press "Open"

* If you are compiling the source by yourself using VS Code you can just press the "Serial Monitor" button in the status bar
![VSCode Serial Monitor](../assets/images/vscode_serial_monitor.png){align=right}

## :question: After a firmwware update some new features do not appear in the web interface

Make sure you reloaded the webinterface after the firmware update. This can be achieved, depending on your browser, by pressing either ++f5++, ++ctrl+f5++ or just by clicking on the reload button.

## :question: After a firmwware does not get a proper IP via DHCP

In some cases it is required to perform a power cycle to get it working again.

## :question: A set up inverter does not appear in the live view

Double check whether the inverter type in **Settings** --> **Inverter** reflects your type or if it's unknown. If it's unknown it will not appear in the live view and you most likely inserted a invalid serial number.

## :question: Is it possible to reset the yield total value?

The yield total value comes directly out of the inverter. (Currently) there is no way to reset or change this value. Please consider it as the total kilometer counter in a car. On the other hand it's possible to add a yield offset to each inverter. This can be set up in the inverter properties (**Settings** --> **Inverters** --> **Click on the pen icon**)

## :question: Why get the daily yield values sometimes reset to zero at the evening?

The values are reset if the inverter restarts. At some (cloudy) evenings it can occur that the brightness fluctuates heavily during the dusk. This could lead to multiple restarts of the inverter and therefor zeros in the production values. You can enable the **Yield Day Correction** in the inverter settings.

## :question: OpenDTU shows wrong/unrealistic or just missing values

This is most likely the case because two DTUs are querying the same inverter. This is a not supported behavior and can lead to unexpected effects. Only one DTU is allowed to query a specific inverter.

Please also see [#831](https://github.com/tbnobody/OpenDTU/issues/831){target=_blank}, [#727](https://github.com//tbnobody/OpenDTU/issues/727){target=_blank}

## :question: With HMS-1800 or HMS-2000 the reactive power shows unrealistic value 6.553,5

This seems to be a issue with inverter Firmware 1.0.14. It contains a calculation mistake.

Reactive power seems to scale incorrectly / be calculated incorrectly and runs up with increasing power at sunrise from 0 to 0xFFFF and remains there, which can be observed at slow sunrise and sunset again (only in the very low watt range). Since the PF is calculated from P and Q and Q is insanely high, this results in a PF of almost 0.

Please also see [#926](https://github.com/tbnobody/OpenDTU/issues/926){target=_blank}

## :question: OpenDTU does not build: "error: 'bad_alloc' was not declared in this scope"

The exact reason is not known. But it helps to delete the `~/.platformio/` folder.

Please also see [#719](https://github.com/tbnobody/OpenDTU/issues/719){target=_blank}
1 change: 1 addition & 0 deletions docs/firmware/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Getting Started
48 changes: 48 additions & 0 deletions docs/hardware/cmt2300a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# CMT2300A Module

## Technical details

| Property | Value |
| ---- | ---------- |
| Name | CMT2300A |
| Frequency | 868MHz |
| Product Info | [Link](https://hoperf.com/ic/rf_transceiver/CMT2300A.html) |
| Datasheet | [Link](https://hoperf.com/data/upload/portal/20221031/CMT2300A%20Datasheet%20EN-V1.5-202210.pdf){target=_blank} |

## Description

The CMT2300A module is a 868MHz RF module. It is important to get a module which supports SPI communication. Currently only the [EBYTE E49-900M20S](https://www.ebyte.com/en/pdf-down.aspx?id=2506){target=_blank} is supported as a standalone module, or use the OpenDTUFusion integrated PCB instead.

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.

Buy your hardware from a trusted source, at best from a dealer/online shop in your country where you have support and the right to return non-functional hardware. When you want to buy from Amazon, AliExpress, eBay etc., take note that there is a lot of low-quality or fake hardware offered. Read customer comments and ratings carefully!

A heavily incomplete list of shops is:

* [EBYTE E49-900M20S](https://ebyteiot.com/products/ebyte-e49-900m20s-cmt2300a-868-915mhz-smd-wireless-module-spi-hardware-module-long-range-3km-ipex-stamp-hole-antenna-wireless-module){target=_blank}
* [Antenna](https://www.amazon.de/s?k=B0978Q7N7C){target=_blank}
* [Blinkyparts (incl. breakout board)](https://shop.blinkyparts.com/de/Ebyte-Funkmodul-CMT2300A-868-915MHz-Breakoutboard/blink238542){target=_blank}

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

## Pictures

<figure markdown>
![CMT2300a module](../assets/images/CMT2300a.png){ width="400" }
<figcaption markdown>CMT2300a module</figcaption>
</figure>

## Pin assignment

The connection pins from the CMT2300A module to the ESP32 module can dynamically configured using [Device Profiles](../firmware/device_profiles.md) (prefered method) or at compile time.

| Name in Device Profile | Pin Function | Description | Possible name(s) on PCB |
| ---------------------- | ------------ | ----------- | -------------------- |
| sdio | Digital Input/Output | SPI Data Input/Output | SDIO |
| clk | Digital Input | SPI Clock | SCLK |
| cs | Digital Input | SPI register accesser | CSB |
| fcs | Digital Input | SPI FIFO accesser | FCSB |
| gpio2 | Digital Output | Interrupt pin | GPIO2 |
| gpio3 | Digital Output | Interrupt pin | GPIO3 |
| | Power | Power Supply (1,8V - 3.6V) | VDD, VCC |
| | Power | Ground | VSS, GND |
6 changes: 6 additions & 0 deletions docs/hardware/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Getting Started

OpenDTU supports the ESP32 family of microcontrollers.

Depending on the inverter to be addressed, different RF modules are required. The HM series requires the NRF24L01+ module, while the HMS/HMT series requires the CMT2300A module.
Please see the [inverter overview](../hardware/inverter_overview.md) to see if your inverter is supported and to determine the required RF module.
37 changes: 37 additions & 0 deletions docs/hardware/inverter_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Inverter Overview

| Model | Required RF Module | DC Inputs | MPP-Tracker | AC Phases |
| ---------------------| ------------------ | :-------: | :---------: | :-------: |
| Hoymiles HM-300-1T | NRF24L01+ | 1 | 1 | 1 |
| Hoymiles HM-350-1T | NRF24L01+ | 1 | 1 | 1 |
| Hoymiles HM-400-1T | NRF24L01+ | 1 | 1 | 1 |
| Hoymiles HM-600-2T | NRF24L01+ | 2 | 2 | 1 |
| Hoymiles HM-700-2T | NRF24L01+ | 2 | 2 | 1 |
| Hoymiles HM-800-2T | NRF24L01+ | 2 | 2 | 1 |
| Hoymiles HM-1000-4T | NRF24L01+ | 4 | 2 | 1 |
| Hoymiles HM-1200-4T | NRF24L01+ | 4 | 2 | 1 |
| Hoymiles HM-1500-4T | NRF24L01+ | 4 | 2 | 1 |
| Hoymiles HMS-300-1T | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-350-1T | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-400-1T | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-450-1T | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-500-1T | CMT2300A | 1 | 1 | 1 |
| Hoymiles HMS-600-2T | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-700-2T | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-800-2T | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-900-2T | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-1000-2T | CMT2300A | 2 | 2 | 1 |
| Hoymiles HMS-1600-4T | CMT2300A | 4 | 4 | 1 |
| Hoymiles HMS-1800-4T | CMT2300A | 4 | 4 | 1 |
| Hoymiles HMS-2000-4T | CMT2300A | 4 | 4 | 1 |
| Hoymiles HMT-1600-4T | CMT2300A | 4 | 2 | 3 |
| Hoymiles HMT-1800-4T | CMT2300A | 4 | 2 | 3 |
| Hoymiles HMT-2000-4T | CMT2300A | 4 | 2 | 3 |
| Hoymiles HMT-1800-6T | CMT2300A | 6 | 3 | 3 |
| Hoymiles HMT-2250-6T | 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 |
Loading

0 comments on commit 3053508

Please sign in to comment.