Skip to content

Commit

Permalink
Merge remote-tracking branch 'tbnobody/OpenDTU/master' into v23.12.16
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Dec 19, 2023
2 parents fb2ca28 + e085700 commit 7c11a5a
Show file tree
Hide file tree
Showing 261 changed files with 7,293 additions and 2,931 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Rename Factory Firmware
run: mv .pio/build/${{ matrix.environment }}/firmware.factory.bin .pio/build/${{ matrix.environment }}/opendtu-onbattery-${{ matrix.environment }}.factory.bin

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: opendtu-onbattery-${{ matrix.environment }}
path: |
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: artifacts/

Expand Down
58 changes: 57 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,62 @@
"C_Cpp.clang_format_style": "WebKit",
"files.associations": {
"*.tcc": "cpp",
"algorithm": "cpp"
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"variant": "cpp"
}
}
20 changes: 20 additions & 0 deletions docs/DeviceProfiles/CASmo-DTU.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"name": "CASmo-DTU",
"links": [
{"name": "Information", "url": "https://casmo.info/product-details/?product=2"}
],
"nrf24": {
"miso": 19,
"mosi": 23,
"clk": 18,
"irq": 16,
"en": 4,
"cs": 5
},
"led": {
"led0": 25,
"led1": 26
}
}
]
48 changes: 48 additions & 0 deletions docs/DeviceProfiles/blinkyparts_esp32.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
[
{
"name": "NRF, LEDs, Display",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-NRF-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HM-Serie-NRF-Modul/blink237542"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -21,6 +27,12 @@
},
{
"name": "CMT, LEDs, Display",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-CMT-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HMS-und-HMT-Serie-CMT-Modul/blink238342"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": -1,
"mosi": -1,
Expand Down Expand Up @@ -49,6 +61,12 @@
},
{
"name": "NRF, Display",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-NRF-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HM-Serie-NRF-Modul/blink237542"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -65,6 +83,12 @@
},
{
"name": "CMT, Display",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-CMT-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HMS-und-HMT-Serie-CMT-Modul/blink238342"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": -1,
"mosi": -1,
Expand All @@ -89,6 +113,12 @@
},
{
"name": "NRF, LEDs",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-NRF-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HM-Serie-NRF-Modul/blink237542"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -104,6 +134,12 @@
},
{
"name": "CMT, LEDs",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-CMT-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HMS-und-HMT-Serie-CMT-Modul/blink238342"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": -1,
"mosi": -1,
Expand All @@ -127,6 +163,12 @@
},
{
"name": "NRF",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-NRF-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HM-Serie-NRF-Modul/blink237542"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": 19,
"mosi": 23,
Expand All @@ -138,6 +180,12 @@
},
{
"name": "CMT",
"links": [
{"name": "Information", "url": "https://shop.blinkyparts.com/de/OpenDTU-CMT-Deine-Auswertung-fuer-deine-Balkonsolaranlage-kompatibel-zu-Hoymiles-HMS-und-HMT-Serie-CMT-Modul/blink238342"},
{"name": "Manual DE", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_de.pdf"},
{"name": "Manual EN", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/manual/OpenDTU_Breakout_en.pdf"},
{"name": "Schematic", "url": "https://binary-kitchen.github.io/SolderingTutorial/OpenDTU_Breakout/ibom.html"}
],
"nrf24": {
"miso": -1,
"mosi": -1,
Expand Down
25 changes: 25 additions & 0 deletions docs/DeviceProfiles/esp32_stick_poe_a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[
{
"name": "Esp32-Stick-PoE-A",
"links": [
{"name": "Information", "url": "https://github.com/allexoK/Esp32-Stick-Boards-Docs"}
],
"nrf24": {
"miso": 2,
"mosi": 15,
"clk": 14,
"irq": 34,
"en": 12,
"cs": 4
},
"eth": {
"enabled": true,
"phy_addr": 1,
"power": -1,
"mdc": 23,
"mdio": 18,
"type": 0,
"clk_mode": 3
}
}
]
9 changes: 9 additions & 0 deletions docs/DeviceProfiles/lilygo_ttgo_t-internet_poe.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
{
"name": "LILYGO TTGO T-Internet-POE",
"links": [
{"name": "Datasheet", "url": "https://www.lilygo.cc/products/t-internet-poe"}
],
"nrf24": {
"miso": 2,
"mosi": 15,
Expand All @@ -21,6 +24,9 @@
},
{
"name": "LILYGO TTGO T-Internet-POE, nrf24 direct solder",
"links": [
{"name": "Datasheet", "url": "https://www.lilygo.cc/products/t-internet-poe"}
],
"nrf24": {
"miso": 12,
"mosi": 4,
Expand All @@ -41,6 +47,9 @@
},
{
"name": "LILYGO TTGO T-Internet-POE, nrf24 direct solder, SSD1306",
"links": [
{"name": "Datasheet", "url": "https://www.lilygo.cc/products/t-internet-poe"}
],
"nrf24": {
"miso": 12,
"mosi": 4,
Expand Down
3 changes: 3 additions & 0 deletions docs/DeviceProfiles/olimex_esp32_evb.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
{
"name": "Olimex ESP32-EVB",
"links": [
{ "name": "Datasheet", "url": "https://www.olimex.com/Products/IoT/ESP32/ESP32-EVB/open-source-hardware" }
],
"nrf24": {
"miso": 15,
"mosi": 2,
Expand Down
9 changes: 9 additions & 0 deletions docs/DeviceProfiles/olimex_esp32_poe.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
{
"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,
Expand All @@ -21,6 +24,9 @@
},
{
"name": "Olimex ESP32-POE with SSD1306",
"links": [
{"name": "Datasheet", "url": "https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware"}
],
"nrf24": {
"miso": 15,
"mosi": 2,
Expand All @@ -46,6 +52,9 @@
},
{
"name": "Olimex ESP32-POE with SH1106",
"links": [
{"name": "Datasheet", "url": "https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware"}
],
"nrf24": {
"miso": 15,
"mosi": 2,
Expand Down
6 changes: 6 additions & 0 deletions docs/DeviceProfiles/wt32-eth01.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[
{
"name": "WT32-ETH01",
"links": [
{"name": "Datasheet", "url": "http://www.wireless-tag.com/portfolio/wt32-eth01/"}
],
"nrf24": {
"miso": 4,
"mosi": 2,
Expand All @@ -21,6 +24,9 @@
},
{
"name": "WT32-ETH01 with SSD1306",
"links": [
{"name": "Datasheet", "url": "http://www.wireless-tag.com/portfolio/wt32-eth01/"}
],
"nrf24": {
"miso": 4,
"mosi": 2,
Expand Down
10 changes: 7 additions & 3 deletions include/Battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdint.h>
#include <memory>
#include <mutex>
#include <TaskSchedulerDeclarations.h>

#include "BatteryStats.h"

Expand All @@ -19,12 +20,15 @@ class BatteryProvider {

class BatteryClass {
public:
void init();
void loop();
void init(Scheduler&);
void updateSettings();

std::shared_ptr<BatteryStats const> getStats() const;

private:
void loop();

Task _loopTask;

uint32_t _lastMqttPublish = 0;
mutable std::mutex _mutex;
std::unique_ptr<BatteryProvider> _upProvider = nullptr;
Expand Down
Loading

0 comments on commit 7c11a5a

Please sign in to comment.