Skip to content

Commit

Permalink
Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Jun 22, 2023
2 parents f018a01 + 582867c commit cd1db49
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 149 deletions.
1 change: 1 addition & 0 deletions lib/Hoymiles/src/parser/DevInfoParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const devInfo_t devInfo[] = {
{ { 0x10, 0x10, 0x10, 0x15 }, static_cast<uint16_t>(300 * 0.7), "HM-300" }, // HM-300 factory limitted to 70%

{ { 0x10, 0x20, 0x21, ALL }, 350, "HMS-350" }, // 00
{ { 0x10, 0x20, 0x41, ALL }, 400, "HMS-400" }, // 00
{ { 0x10, 0x10, 0x51, ALL }, 450, "HMS-450" }, // 01
{ { 0x10, 0x10, 0x71, ALL }, 500, "HMS-500" }, // 02
{ { 0x10, 0x21, 0x11, ALL }, 600, "HMS-600" }, // 01
Expand Down
50 changes: 26 additions & 24 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
; https://docs.platformio.org/page/projectconf.html

[platformio]
default_envs = generic
default_envs = generic_esp32
extra_configs =
platformio_override.ini

[env]
; Make sure to NOT add any spaces in the custom_ci_action property
; (also the position in the file is important)
custom_ci_action = generic
custom_ci_action = generic,generic_esp32,generic_esp32s3,generic_esp32s3_usb

framework = arduino
platform = espressif32@6.3.1
Expand All @@ -35,7 +35,7 @@ lib_deps =
bblanchon/ArduinoJson @ ^6.21.2
https://github.com/bertmelis/espMqttClient.git#v1.4.3
nrf24/RF24 @ ^1.4.7
olikraus/U8g2 @ ^2.34.18
olikraus/U8g2 @ ^2.34.22
buelowp/sunset @ ^1.1.7
https://github.com/coryjfowler/MCP_CAN_lib
plerup/EspSoftwareSerial@^8.0.1
Expand All @@ -57,36 +57,38 @@ upload_protocol = esptool
; upload_port = COM4


[env:generic]
[env:generic_esp32]
board = esp32dev
build_flags = ${env.build_flags}
-DHOYMILES_PIN_MISO=19
-DHOYMILES_PIN_MOSI=23
-DHOYMILES_PIN_SCLK=18
-DHOYMILES_PIN_IRQ=16
-DHOYMILES_PIN_CE=4
-DHOYMILES_PIN_CS=5
-DVICTRON_PIN_TX=21
-DVICTRON_PIN_RX=22
-DPYLONTECH_PIN_RX=27
-DPYLONTECH_PIN_TX=14
-DHUAWEI_PIN_MISO=12
-DHUAWEI_PIN_MOSI=13
-DHUAWEI_PIN_SCLK=26
-DHUAWEI_PIN_IRQ=25
-DHUAWEI_PIN_CS=15
-DHUAWEI_PIN_POWER=33


[env:generic_esp32c3]
board = esp32dev
board_build.mcu = esp32c3
custom_patches = esp32c3
build_flags = ${env.build_flags}
-DHOYMILES_PIN_MISO=9
-DHOYMILES_PIN_MOSI=10
-DHOYMILES_PIN_SCLK=8
-DHOYMILES_PIN_IRQ=3


[env:generic_esp32s3]
board = esp32-s3-devkitc-1
build_flags = ${env.build_flags}


[env:generic_esp32s3_usb]
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env.build_flags}
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1


[env:generic]
board = esp32dev
build_flags = ${env.build_flags}
-DHOYMILES_PIN_MISO=19
-DHOYMILES_PIN_MOSI=23
-DHOYMILES_PIN_SCLK=18
-DHOYMILES_PIN_IRQ=16
-DHOYMILES_PIN_CE=4
-DHOYMILES_PIN_CS=5

Expand Down
7 changes: 4 additions & 3 deletions src/InverterSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ void InverterSettingsClass::init()

// Initialize inverter communication
MessageOutput.print("Initialize Hoymiles interface... ");
if (PinMapping.isValidNrf24Config() || PinMapping.isValidCmt2300Config()) {
Hoymiles.setMessageOutput(&MessageOutput);
Hoymiles.init();

Hoymiles.setMessageOutput(&MessageOutput);
Hoymiles.init();

if (PinMapping.isValidNrf24Config() || PinMapping.isValidCmt2300Config()) {
if (PinMapping.isValidNrf24Config()) {
SPIClass* spiClass = new SPIClass(SPI_NRF);
spiClass->begin(pin.nrf24_clk, pin.nrf24_miso, pin.nrf24_mosi, pin.nrf24_cs);
Expand Down
24 changes: 24 additions & 0 deletions src/PinMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,30 @@
#define LED1 -1
#endif

#ifndef HOYMILES_PIN_SCLK
#define HOYMILES_PIN_SCLK -1
#endif

#ifndef HOYMILES_PIN_CS
#define HOYMILES_PIN_CS -1
#endif

#ifndef HOYMILES_PIN_CE
#define HOYMILES_PIN_CE -1
#endif

#ifndef HOYMILES_PIN_IRQ
#define HOYMILES_PIN_IRQ -1
#endif

#ifndef HOYMILES_PIN_MISO
#define HOYMILES_PIN_MISO -1
#endif

#ifndef HOYMILES_PIN_MOSI
#define HOYMILES_PIN_MOSI -1
#endif

#ifndef CMT_CLK
#define CMT_CLK -1
#endif
Expand Down
12 changes: 6 additions & 6 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"devDependencies": {
"@intlify/unplugin-vue-i18n": "^0.11.0",
"@rushstack/eslint-patch": "^1.3.1",
"@rushstack/eslint-patch": "^1.3.2",
"@tsconfig/node18": "^2.0.1",
"@types/bootstrap": "^5.2.6",
"@types/node": "^20.3.1",
Expand All @@ -32,15 +32,15 @@
"@vitejs/plugin-vue": "^4.2.3",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.42.0",
"eslint-plugin-vue": "^9.14.1",
"eslint": "^8.43.0",
"eslint-plugin-vue": "^9.15.0",
"npm-run-all": "^4.1.5",
"sass": "^1.63.4",
"terser": "^5.18.0",
"sass": "^1.63.5",
"terser": "^5.18.1",
"typescript": "^5.1.3",
"vite": "^4.3.9",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-css-injected-by-js": "^3.1.1",
"vue-tsc": "^1.6.5"
"vue-tsc": "^1.8.1"
}
}
Loading

0 comments on commit cd1db49

Please sign in to comment.