Improve ESP32 support
This commit is contained in:
parent
53abc53ade
commit
771ca851c8
|
@ -14,13 +14,13 @@
|
||||||
<p>
|
<p>
|
||||||
set data update interval (ms):
|
set data update interval (ms):
|
||||||
<select id="upd" onchange="setUpdateInterval();">
|
<select id="upd" onchange="setUpdateInterval();">
|
||||||
<option>10</option>
|
|
||||||
<option>20</option>
|
|
||||||
<option>50</option>
|
|
||||||
<option>100</option>
|
<option>100</option>
|
||||||
<option>200</option>
|
<option>200</option>
|
||||||
<option selected>500</option>
|
<option selected>500</option>
|
||||||
<option>1000</option>
|
<option>1000</option>
|
||||||
|
<option>2000</option>
|
||||||
|
<option>5000</option>
|
||||||
|
<option>10000</option>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,8 +30,10 @@
|
||||||
set chart update interval (ms):
|
set chart update interval (ms):
|
||||||
<select id="chartUpd" onchange="location.reload()">
|
<select id="chartUpd" onchange="location.reload()">
|
||||||
<option>200</option>
|
<option>200</option>
|
||||||
<option selected>500</option>
|
<option>500</option>
|
||||||
<option>1000</option>
|
<option selected>1000</option>
|
||||||
|
<option>2000</option>
|
||||||
|
<option>5000</option>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,8 +46,8 @@
|
||||||
<circle cx="10" cy="10" r="7" fill="red" />
|
<circle cx="10" cy="10" r="7" fill="red" />
|
||||||
Sorry, your browser does not support inline SVG.
|
Sorry, your browser does not support inline SVG.
|
||||||
</svg>
|
</svg>
|
||||||
<p>Recording CSV data to <span id="filename"></span> </p
|
<p>Recording CSV data to <span id="filename"></span></p></span
|
||||||
></span><span id="timeLeft"></span>
|
><span id="timeLeft"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="timedCheck">
|
<div id="timedCheck">
|
||||||
<input type="checkbox" id="timedRec" /><label for="timedRec"
|
<input type="checkbox" id="timedRec" /><label for="timedRec"
|
||||||
|
|
|
@ -21,6 +21,7 @@ lib_deps =
|
||||||
Arduino_JSON
|
Arduino_JSON
|
||||||
ESPAsyncWiFiManager
|
ESPAsyncWiFiManager
|
||||||
monitor_filters = esp8266_exception_decoder, colorize
|
monitor_filters = esp8266_exception_decoder, colorize
|
||||||
|
monitor_speed = 115200
|
||||||
|
|
||||||
[env:lolin32]
|
[env:lolin32]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
@ -36,3 +37,4 @@ lib_deps =
|
||||||
Arduino_JSON
|
Arduino_JSON
|
||||||
ESPAsyncWiFiManager
|
ESPAsyncWiFiManager
|
||||||
monitor_filters = esp32_exception_decoder, colorize
|
monitor_filters = esp32_exception_decoder, colorize
|
||||||
|
monitor_speed = 115200
|
||||||
|
|
17
src/main.cpp
17
src/main.cpp
|
@ -13,8 +13,13 @@
|
||||||
#include <pinout.h>
|
#include <pinout.h>
|
||||||
|
|
||||||
// sensor chip select pin definitions
|
// sensor chip select pin definitions
|
||||||
#define CS_A D2
|
#ifdef ESP32
|
||||||
#define CS_B D3
|
#define CS_A 22
|
||||||
|
#define CS_B 21
|
||||||
|
#else
|
||||||
|
#define CS_A D2
|
||||||
|
#define CS_B D3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Adafruit_MAX31855 thermocoupleA(CS_A);
|
Adafruit_MAX31855 thermocoupleA(CS_A);
|
||||||
|
@ -112,8 +117,14 @@ void initSerial() {
|
||||||
Serial.print("serial init\n");
|
Serial.print("serial init\n");
|
||||||
}
|
}
|
||||||
void initSPI() {
|
void initSPI() {
|
||||||
|
#ifdef ESP32
|
||||||
|
SPIClass hspi(HSPI);
|
||||||
|
hspi.begin();
|
||||||
|
#else
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
|
#endif
|
||||||
Serial.printf("SPI init\n");
|
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() {
|
void initLittleFS() {
|
||||||
LittleFS.begin();
|
LittleFS.begin();
|
||||||
|
@ -131,7 +142,7 @@ void initWiFi() {
|
||||||
WiFi.setHostname("therminator");
|
WiFi.setHostname("therminator");
|
||||||
Serial.printf("wifi init\n");
|
Serial.printf("wifi init\n");
|
||||||
wm.autoConnect("therminator");
|
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() {
|
void initWebSocket() {
|
||||||
|
|
Loading…
Reference in a new issue