Skip to content

Commit

Permalink
added esp32 c3 build
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Struß committed Mar 21, 2023
1 parent d508b41 commit 67fadf1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
13 changes: 12 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build_unflags =
-std=gnu++11

lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer
https://github.com/ss89/ESPAsyncWebServer
bblanchon/ArduinoJson @ ^6.21.0
https://github.com/bertmelis/espMqttClient.git#v1.4.1
nrf24/RF24 @ ^1.4.5
Expand Down Expand Up @@ -139,6 +139,17 @@ build_flags = ${env.build_flags}
-DHOYMILES_PIN_CE=4
-DHOYMILES_PIN_CS=5

[env:seeed_xiao_esp32c3]
; https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started
board = seeed_xiao_esp32c3
build_flags = ${env.build_flags}
-DHOYMILES_PIN_MISO=9
-DHOYMILES_PIN_MOSI=10
-DHOYMILES_PIN_SCLK=8
-DHOYMILES_PIN_IRQ=3
-DHOYMILES_PIN_CE=4
-DHOYMILES_PIN_CS=5


[env:lolin32_lite]
; https://www.makershop.de/plattformen/esp8266/wemos-lolin32/
Expand Down
18 changes: 16 additions & 2 deletions src/InverterSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,25 @@ void InverterSettingsClass::init()
const PinMapping_t& pin = PinMapping.get();

// Initialize inverter communication
MessageOutput.print(F("Initialize Hoymiles interface... "));
MessageOutput.println(F("Initialize Hoymiles interface... "));
if (PinMapping.isValidNrf24Config()) {
SPIClass* spiClass = new SPIClass(HSPI);
MessageOutput.print(F(" Clk pin: "));
MessageOutput.println(pin.nrf24_clk);
MessageOutput.print(F(" Miso pin: "));
MessageOutput.println(pin.nrf24_miso);
MessageOutput.print(F(" Mosi pin: "));
MessageOutput.println(pin.nrf24_mosi);
MessageOutput.print(F(" CS pin: "));
MessageOutput.println(pin.nrf24_cs);
MessageOutput.print(F(" EN pin: "));
MessageOutput.println(pin.nrf24_en);
MessageOutput.print(F(" IRQ pin: "));
MessageOutput.println(pin.nrf24_irq);
SPIClass* spiClass = new SPIClass(FSPI);
MessageOutput.println(F(" begin SPI... "));
spiClass->begin(pin.nrf24_clk, pin.nrf24_miso, pin.nrf24_mosi, pin.nrf24_cs);
Hoymiles.setMessageOutput(&MessageOutput);
MessageOutput.println(F(" init Hoymiles... "));
Hoymiles.init(spiClass, pin.nrf24_en, pin.nrf24_irq);

MessageOutput.println(F(" Setting radio PA level... "));
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void setup()
Serial.begin(SERIAL_BAUDRATE);
while (!Serial)
yield();
sleep(1); // waiting for vs code terminal to be re-connected
MessageOutput.println();
MessageOutput.println(F("Starting OpenDTU"));

Expand Down
2 changes: 2 additions & 0 deletions webapp/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn 1.22.19
nodejs 19.8.1

0 comments on commit 67fadf1

Please sign in to comment.