diff --git a/platformio.ini b/platformio.ini
index 3bbe5d7..17f9f8b 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -21,6 +21,7 @@ lib_deps =
Arduino_JSON
ESPAsyncWiFiManager
monitor_filters = esp8266_exception_decoder, colorize
+monitor_speed = 115200
[env:lolin32]
platform = espressif32
@@ -36,3 +37,4 @@ lib_deps =
Arduino_JSON
ESPAsyncWiFiManager
monitor_filters = esp32_exception_decoder, colorize
+monitor_speed = 115200
diff --git a/src/main.cpp b/src/main.cpp
index b322e19..07c4aaa 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -13,8 +13,13 @@
#include
// sensor chip select pin definitions
-#define CS_A D2
-#define CS_B D3
+#ifdef ESP32
+ #define CS_A 22
+ #define CS_B 21
+#else
+ #define CS_A D2
+ #define CS_B D3
+#endif
Adafruit_MAX31855 thermocoupleA(CS_A);
@@ -112,8 +117,14 @@ void initSerial() {
Serial.print("serial init\n");
}
void initSPI() {
- SPI.begin();
+ #ifdef ESP32
+ SPIClass hspi(HSPI);
+ hspi.begin();
+ #else
+ SPI.begin();
+ #endif
Serial.printf("SPI init\n");
+ Serial.printf("using pins:\nPOCI: %d\tCLK: %d\nCS_A: %d\tCS_B: %d\n", MISO, SCK, CS_A, CS_B);
}
void initLittleFS() {
LittleFS.begin();
@@ -131,7 +142,7 @@ void initWiFi() {
WiFi.setHostname("therminator");
Serial.printf("wifi init\n");
wm.autoConnect("therminator");
- Serial.printf("hostname: %s\n", String(WiFi.getHostname()).c_str());
+ Serial.printf("connected to %s!\nhostname: %s\nip addr: %s\n", WiFi.SSID().c_str(), String(WiFi.getHostname()).c_str(), WiFi.localIP().toString().c_str());
}
void initWebSocket() {
|