Improve ESP32 support

This commit is contained in:
huskee 2023-12-24 01:24:04 +02:00
parent 53abc53ade
commit 771ca851c8
3 changed files with 27 additions and 12 deletions

View file

@ -14,13 +14,13 @@
<p>
set data update interval (ms):
<select id="upd" onchange="setUpdateInterval();">
<option>10</option>
<option>20</option>
<option>50</option>
<option>100</option>
<option>200</option>
<option selected>500</option>
<option>1000</option>
<option>2000</option>
<option>5000</option>
<option>10000</option>
</select>
</p>
</div>
@ -30,8 +30,10 @@
set chart update interval (ms):
<select id="chartUpd" onchange="location.reload()">
<option>200</option>
<option selected>500</option>
<option>1000</option>
<option>500</option>
<option selected>1000</option>
<option>2000</option>
<option>5000</option>
</select>
</p>
</div>
@ -44,8 +46,8 @@
<circle cx="10" cy="10" r="7" fill="red" />
Sorry, your browser does not support inline SVG.
</svg>
<p>Recording CSV data to <span id="filename"></span> </p
></span><span id="timeLeft"></span>
<p>Recording CSV data to <span id="filename"></span></p></span
><span id="timeLeft"></span>
</div>
<div id="timedCheck">
<input type="checkbox" id="timedRec" /><label for="timedRec"
@ -55,7 +57,7 @@
<span id="timedSettings">
<label for="timer">Stop recording after (min): </label
><input type="text" id="timer" />
</span>
</span>
<table>
<tr>
<td class="chart-container">

View file

@ -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

View file

@ -13,8 +13,13 @@
#include <pinout.h>
// 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() {