Compare commits
No commits in common. "main" and "3.3.0" have entirely different histories.
13 changed files with 29 additions and 91 deletions
2
data
2
data
|
@ -1 +1 @@
|
|||
Subproject commit 0116cd68cdfdf383823f74e0f9665a1700cf0500
|
||||
Subproject commit 91e60d2f4cd7437075a6e10ea0f395b2650ed531
|
|
@ -4,6 +4,6 @@ dependencies:
|
|||
source:
|
||||
type: idf
|
||||
version: 4.4.7
|
||||
manifest_hash: 1d4ef353a86901733b106a1897b186dbf9fc091a4981f0560ea2f6899b7a3d44
|
||||
manifest_hash: cd2f3ee15e776d949eb4ea4eddc8f39b30c2a7905050850eed01ab4928143cff
|
||||
target: esp32s3
|
||||
version: 1.0.0
|
||||
|
|
|
@ -15,7 +15,7 @@ default_envs = lolin_s3_mini_213epd, lolin_s3_mini_29epd, btclock_rev_b_213epd,
|
|||
[env]
|
||||
|
||||
[btclock_base]
|
||||
platform = espressif32 @ ^6.10.0
|
||||
platform = espressif32 @ ^6.9.0
|
||||
framework = arduino, espidf
|
||||
monitor_speed = 115200
|
||||
monitor_filters = esp32_exception_decoder, colorize
|
||||
|
@ -30,17 +30,17 @@ build_flags =
|
|||
-DLAST_BUILD_TIME=$UNIX_TIME
|
||||
-DARDUINO_USB_CDC_ON_BOOT
|
||||
-DCORE_DEBUG_LEVEL=0
|
||||
-D CONFIG_ASYNC_TCP_STACK_SIZE=16384
|
||||
-D DEFAULT_BOOT_TEXT=\"BTCLOCK\"
|
||||
-fexceptions
|
||||
build_unflags =
|
||||
-Werror=all
|
||||
-fno-exceptions
|
||||
lib_deps =
|
||||
https://github.com/joltwallet/esp_littlefs.git#v1.16.4
|
||||
bblanchon/ArduinoJson@^7.3.0
|
||||
esp32async/ESPAsyncWebServer @ 3.7.0
|
||||
robtillaart/MCP23017@^0.9.0
|
||||
adafruit/Adafruit NeoPixel@^1.12.4
|
||||
https://github.com/joltwallet/esp_littlefs.git
|
||||
bblanchon/ArduinoJson@^7.2.1
|
||||
mathieucarbou/ESPAsyncWebServer @ 3.4.5
|
||||
robtillaart/MCP23017@^0.8.0
|
||||
adafruit/Adafruit NeoPixel@^1.12.3
|
||||
https://github.com/dsbaars/universal_pin#feature/mcp23017_rt
|
||||
https://github.com/dsbaars/GxEPD2#universal_pin
|
||||
https://github.com/tzapu/WiFiManager.git#v2.0.17
|
||||
|
@ -79,10 +79,9 @@ build_flags =
|
|||
-D I2C_SDA_PIN=35
|
||||
-D I2C_SCK_PIN=36
|
||||
-D HAS_FRONTLIGHT
|
||||
-D PCA_OE_PIN=48
|
||||
-D PCA_OE_PIN=45
|
||||
-D PCA_I2C_ADDR=0x42
|
||||
-D IS_HW_REV_B
|
||||
|
||||
lib_deps =
|
||||
${btclock_base.lib_deps}
|
||||
robtillaart/PCA9685@^0.7.1
|
||||
|
@ -101,7 +100,6 @@ build_flags =
|
|||
-D USE_QR
|
||||
-D VERSION_EPD_2_13
|
||||
-D HW_REV=\"REV_A_EPD_2_13\"
|
||||
-D CONFIG_ARDUINO_MAIN_TASK_STACK_SIZE=16384
|
||||
platform_packages =
|
||||
platformio/tool-mklittlefs@^1.203.210628
|
||||
earlephilhower/tool-mklittlefs-rp2040-earlephilhower@^5.100300.230216
|
||||
|
@ -114,7 +112,6 @@ build_flags =
|
|||
-D USE_QR
|
||||
-D VERSION_EPD_2_13
|
||||
-D HW_REV=\"REV_B_EPD_2_13\"
|
||||
-D CONFIG_ARDUINO_MAIN_TASK_STACK_SIZE=16384
|
||||
platform_packages =
|
||||
platformio/tool-mklittlefs@^1.203.210628
|
||||
earlephilhower/tool-mklittlefs-rp2040-earlephilhower@^5.100300.230216
|
||||
|
|
|
@ -132,25 +132,9 @@ void setup()
|
|||
void setupWifi()
|
||||
{
|
||||
WiFi.onEvent(WiFiEvent);
|
||||
|
||||
// wifi_country_t country = {
|
||||
// .cc = "NL",
|
||||
// .schan = 1,
|
||||
// .nchan = 13,
|
||||
// .policy = WIFI_COUNTRY_POLICY_MANUAL
|
||||
// };
|
||||
|
||||
// esp_err_t err = esp_wifi_set_country(&country);
|
||||
// if (err != ESP_OK) {
|
||||
// Serial.printf("Failed to set country: %d\n", err);
|
||||
// }
|
||||
|
||||
WiFi.setAutoConnect(true);
|
||||
WiFi.setAutoReconnect(true);
|
||||
WiFi.begin();
|
||||
|
||||
|
||||
|
||||
if (preferences.getInt("txPower", DEFAULT_TX_POWER))
|
||||
{
|
||||
if (WiFi.setTxPower(
|
||||
|
@ -188,7 +172,6 @@ void setupWifi()
|
|||
wm.setConfigPortalTimeout(preferences.getUInt("wpTimeout", DEFAULT_WP_TIMEOUT));
|
||||
wm.setWiFiAutoReconnect(false);
|
||||
wm.setDebugOutput(false);
|
||||
wm.setCountry("NL");
|
||||
wm.setConfigPortalBlocking(true);
|
||||
|
||||
wm.setAPCallback([&](WiFiManager *wifiManager)
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
#define DEFAULT_LUX_LIGHT_TOGGLE 128
|
||||
#define DEFAULT_FL_OFF_WHEN_DARK true
|
||||
|
||||
#define DEFAULT_FL_ALWAYS_ON true
|
||||
#define DEFAULT_FL_FLASH_ON_UPDATE true
|
||||
#define DEFAULT_FL_ALWAYS_ON false
|
||||
#define DEFAULT_FL_FLASH_ON_UPDATE false
|
||||
|
||||
#define DEFAULT_LED_STATUS false
|
||||
#define DEFAULT_TIMER_ACTIVE true
|
||||
|
@ -60,7 +60,6 @@
|
|||
#define DEFAULT_MINING_POOL_STATS_ENABLED false
|
||||
#define DEFAULT_MINING_POOL_NAME "ocean"
|
||||
#define DEFAULT_MINING_POOL_USER "38Qkkei3SuF1Eo45BaYmRHUneRD54yyTFy" // Random actual Ocean hasher
|
||||
#define DEFAULT_LOCAL_POOL_ENDPOINT "umbrel.local:2019"
|
||||
|
||||
#define DEFAULT_ZAP_NOTIFY_ENABLED false
|
||||
#define DEFAULT_ZAP_NOTIFY_PUBKEY "b5127a08cf33616274800a4387881a9f98e04b9c37116e92de5250498635c422"
|
||||
|
|
|
@ -535,7 +535,7 @@ void LedHandler::frontlightSetBrightness(uint brightness) {
|
|||
}
|
||||
|
||||
for (int ledPin = 0; ledPin <= NUM_SCREENS; ledPin++) {
|
||||
flArray.setPWM(ledPin + 1, 0, brightness);
|
||||
flArray.setPWM(ledPin, 0, brightness);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,7 +543,7 @@ std::vector<uint16_t> LedHandler::frontlightGetStatus() {
|
|||
std::vector<uint16_t> statuses;
|
||||
for (int ledPin = 1; ledPin <= NUM_SCREENS; ledPin++) {
|
||||
uint16_t a = 0, b = 0;
|
||||
flArray.getPWM(ledPin + 1, &a, &b);
|
||||
flArray.getPWM(ledPin, &a, &b);
|
||||
statuses.push_back(round(b - a / 4096));
|
||||
}
|
||||
return statuses;
|
||||
|
@ -576,7 +576,7 @@ void LedHandler::frontlightFadeInAll(int flDelayTime, bool staggered) {
|
|||
} else {
|
||||
for (int dutyCycle = 0; dutyCycle <= maxBrightness; dutyCycle += FL_FADE_STEP) {
|
||||
for (int ledPin = 0; ledPin <= NUM_SCREENS; ledPin++) {
|
||||
flArray.setPWM(ledPin + 1, 0, dutyCycle);
|
||||
flArray.setPWM(ledPin, 0, dutyCycle);
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(flDelayTime));
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ void LedHandler::frontlightFadeOutAll(int flDelayTime, bool staggered) {
|
|||
} else {
|
||||
for (int dutyCycle = preferences.getUInt("flMaxBrightness"); dutyCycle >= 0; dutyCycle -= FL_FADE_STEP) {
|
||||
for (int ledPin = 0; ledPin <= NUM_SCREENS; ledPin++) {
|
||||
flArray.setPWM(ledPin + 1, 0, dutyCycle);
|
||||
flArray.setPWM(ledPin, 0, dutyCycle);
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(flDelayTime));
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ void LedHandler::frontlightFadeIn(uint num, int flDelayTime) {
|
|||
}
|
||||
|
||||
for (int dutyCycle = 0; dutyCycle <= preferences.getUInt("flMaxBrightness"); dutyCycle += 5) {
|
||||
flArray.setPWM(num + 1, 0, dutyCycle);
|
||||
flArray.setPWM(num, 0, dutyCycle);
|
||||
vTaskDelay(pdMS_TO_TICKS(flDelayTime));
|
||||
}
|
||||
}
|
||||
|
@ -639,7 +639,7 @@ void LedHandler::frontlightFadeOut(uint num, int flDelayTime) {
|
|||
}
|
||||
|
||||
for (int dutyCycle = preferences.getUInt("flMaxBrightness"); dutyCycle >= 0; dutyCycle -= 5) {
|
||||
flArray.setPWM(num + 1, 0, dutyCycle);
|
||||
flArray.setPWM(num, 0, dutyCycle);
|
||||
vTaskDelay(pdMS_TO_TICKS(flDelayTime));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ const char* PoolFactory::MINING_POOL_NAME_NODERUNNERS = "noderunners";
|
|||
const char* PoolFactory::MINING_POOL_NAME_BRAIINS = "braiins";
|
||||
const char* PoolFactory::MINING_POOL_NAME_SATOSHI_RADIO = "satoshi_radio";
|
||||
const char* PoolFactory::MINING_POOL_NAME_PUBLIC_POOL = "public_pool";
|
||||
const char* PoolFactory::MINING_POOL_NAME_LOCAL_PUBLIC_POOL = "local_public_pool";
|
||||
const char* PoolFactory::MINING_POOL_NAME_GOBRRR_POOL = "gobrrr_pool";
|
||||
const char* PoolFactory::MINING_POOL_NAME_CKPOOL = "ckpool";
|
||||
const char* PoolFactory::MINING_POOL_NAME_EU_CKPOOL = "eu_ckpool";
|
||||
|
@ -18,7 +17,6 @@ std::unique_ptr<MiningPoolInterface> PoolFactory::createPool(const std::string&
|
|||
{MINING_POOL_NAME_BRAIINS, []() { return std::make_unique<BraiinsPool>(); }},
|
||||
{MINING_POOL_NAME_SATOSHI_RADIO, []() { return std::make_unique<SatoshiRadioPool>(); }},
|
||||
{MINING_POOL_NAME_PUBLIC_POOL, []() { return std::make_unique<PublicPool>(); }},
|
||||
{MINING_POOL_NAME_LOCAL_PUBLIC_POOL, []() { return std::make_unique<LocalPublicPool>(); }},
|
||||
{MINING_POOL_NAME_GOBRRR_POOL, []() { return std::make_unique<GoBrrrPool>(); }},
|
||||
{MINING_POOL_NAME_CKPOOL, []() { return std::make_unique<CKPool>(); }},
|
||||
{MINING_POOL_NAME_EU_CKPOOL, []() { return std::make_unique<EUCKPool>(); }}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "ocean/ocean_pool.hpp"
|
||||
#include "satoshi_radio/satoshi_radio_pool.hpp"
|
||||
#include "public_pool/public_pool.hpp"
|
||||
#include "public_pool/local_public_pool.hpp"
|
||||
#include "gobrrr_pool/gobrrr_pool.hpp"
|
||||
#include "ckpool/ckpool.hpp"
|
||||
#include "ckpool/eu_ckpool.hpp"
|
||||
|
@ -29,7 +28,6 @@ class PoolFactory {
|
|||
MINING_POOL_NAME_SATOSHI_RADIO,
|
||||
MINING_POOL_NAME_BRAIINS,
|
||||
MINING_POOL_NAME_PUBLIC_POOL,
|
||||
MINING_POOL_NAME_LOCAL_PUBLIC_POOL,
|
||||
MINING_POOL_NAME_GOBRRR_POOL,
|
||||
MINING_POOL_NAME_CKPOOL,
|
||||
MINING_POOL_NAME_EU_CKPOOL
|
||||
|
@ -57,7 +55,6 @@ class PoolFactory {
|
|||
static const char* MINING_POOL_NAME_BRAIINS;
|
||||
static const char* MINING_POOL_NAME_SATOSHI_RADIO;
|
||||
static const char* MINING_POOL_NAME_PUBLIC_POOL;
|
||||
static const char* MINING_POOL_NAME_LOCAL_PUBLIC_POOL;
|
||||
static const char* MINING_POOL_NAME_GOBRRR_POOL;
|
||||
static const char* MINING_POOL_NAME_CKPOOL;
|
||||
static const char* MINING_POOL_NAME_EU_CKPOOL;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#include "local_public_pool.hpp"
|
||||
#include "lib/shared.hpp"
|
||||
#include "lib/defaults.hpp"
|
||||
|
||||
std::string LocalPublicPool::getEndpoint() const {
|
||||
return preferences.getString("localPoolEndpoint", DEFAULT_LOCAL_POOL_ENDPOINT).c_str();
|
||||
}
|
||||
|
||||
std::string LocalPublicPool::getApiUrl() const {
|
||||
return "http://" + getEndpoint() + "/api/client/" + poolUser;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "public_pool.hpp"
|
||||
|
||||
class LocalPublicPool : public PublicPool {
|
||||
public:
|
||||
std::string getApiUrl() const override;
|
||||
std::string getDisplayLabel() const override { return "LOCAL/POOL"; }
|
||||
private:
|
||||
std::string getEndpoint() const;
|
||||
};
|
|
@ -41,7 +41,7 @@ void setupNostrNotify(bool asDatasource, bool zapNotify)
|
|||
{relay},
|
||||
{// First filter
|
||||
{
|
||||
{"kinds", {"12203"}},
|
||||
{"kinds", {"1"}},
|
||||
{"since", {String(getMinutesAgo(60))}},
|
||||
{"authors", {pubKey}},
|
||||
}},
|
||||
|
@ -146,7 +146,6 @@ void handleNostrEventCallback(const String &subId, nostr::SignedNostrEvent *even
|
|||
// Use direct value access instead of multiple comparisons
|
||||
String typeValue;
|
||||
uint medianFee = 0;
|
||||
uint blockHeight = 0;
|
||||
|
||||
for (JsonArray tag : tags) {
|
||||
if (tag.size() != 2) continue;
|
||||
|
@ -167,11 +166,6 @@ void handleNostrEventCallback(const String &subId, nostr::SignedNostrEvent *even
|
|||
medianFee = tag[1].as<uint>();
|
||||
}
|
||||
break;
|
||||
case 'b': // blockHeight
|
||||
if (strcmp(key, "block") == 0) {
|
||||
blockHeight = tag[1].as<uint>();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,10 +173,6 @@ void handleNostrEventCallback(const String &subId, nostr::SignedNostrEvent *even
|
|||
if (!typeValue.isEmpty()) {
|
||||
if (typeValue == "priceUsd") {
|
||||
processNewPrice(obj["content"].as<uint>(), CURRENCY_USD);
|
||||
if (blockHeight != 0) {
|
||||
auto& blockNotify = BlockNotify::getInstance();
|
||||
blockNotify.processNewBlock(blockHeight);
|
||||
}
|
||||
}
|
||||
else if (typeValue == "blockHeight") {
|
||||
auto& blockNotify = BlockNotify::getInstance();
|
||||
|
|
|
@ -155,6 +155,10 @@ namespace V2Notify
|
|||
}
|
||||
else if (doc["price"].is<JsonObject>())
|
||||
{
|
||||
if (debugLogEnabled()) {
|
||||
Serial.print(F("processNewPrice "));
|
||||
Serial.println(doc["price"].as<JsonObject>().size());
|
||||
}
|
||||
|
||||
// Iterate through the key-value pairs of the "price" object
|
||||
for (JsonPair kv : doc["price"].as<JsonObject>())
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
static const char* JSON_CONTENT = "application/json";
|
||||
|
||||
static const char *const PROGMEM strSettings[] = {
|
||||
"hostnamePrefix", "mempoolInstance", "nostrPubKey", "nostrRelay", "bitaxeHostname", "miningPoolName", "miningPoolUser", "nostrZapPubkey", "httpAuthUser", "httpAuthPass", "gitReleaseUrl", "poolLogosUrl", "ceEndpoint", "fontName", "localPoolEndpoint"};
|
||||
"hostnamePrefix", "mempoolInstance", "nostrPubKey", "nostrRelay", "bitaxeHostname", "miningPoolName", "miningPoolUser", "nostrZapPubkey", "httpAuthUser", "httpAuthPass", "gitReleaseUrl", "poolLogosUrl", "ceEndpoint", "fontName"};
|
||||
|
||||
static const char *const PROGMEM uintSettings[] = {"minSecPriceUpd", "fullRefreshMin", "ledBrightness", "flMaxBrightness", "flEffectDelay", "luxLightToggle", "wpTimeout"};
|
||||
|
||||
|
@ -30,8 +30,7 @@ TaskHandle_t eventSourceTaskHandle;
|
|||
void setupWebserver()
|
||||
{
|
||||
events.onConnect([](AsyncEventSourceClient *client)
|
||||
{ client->send("welcome", NULL, millis(), 1000);
|
||||
});
|
||||
{ client->send("welcome", NULL, millis(), 1000); });
|
||||
server.addHandler(&events);
|
||||
|
||||
AsyncStaticWebHandler &staticHandler = server.serveStatic("/", LittleFS, "/").setDefaultFile("index.html");
|
||||
|
@ -307,18 +306,14 @@ JsonDocument getLedStatusObject()
|
|||
void eventSourceUpdate() {
|
||||
if (!events.count()) return;
|
||||
|
||||
static JsonDocument doc;
|
||||
doc.clear();
|
||||
|
||||
JsonDocument root = getStatusObject();
|
||||
|
||||
root["leds"] = getLedStatusObject()["data"];
|
||||
JsonDocument doc = getStatusObject();
|
||||
doc["leds"] = getLedStatusObject()["data"];
|
||||
|
||||
// Get current EPD content directly as array
|
||||
std::array<String, NUM_SCREENS> epdContent = EPDManager::getInstance().getCurrentContent();
|
||||
|
||||
// Add EPD content arrays
|
||||
JsonArray data = root["data"].to<JsonArray>();
|
||||
JsonArray data = doc["data"].to<JsonArray>();
|
||||
|
||||
// Copy array elements directly
|
||||
for(const auto& content : epdContent) {
|
||||
|
@ -326,7 +321,7 @@ void eventSourceUpdate() {
|
|||
}
|
||||
|
||||
String buffer;
|
||||
serializeJson(root, buffer);
|
||||
serializeJson(doc, buffer);
|
||||
events.send(buffer.c_str(), "status");
|
||||
}
|
||||
|
||||
|
@ -701,9 +696,6 @@ void onApiSettingsGet(AsyncWebServerRequest *request)
|
|||
root["mempoolInstance"] = preferences.getString("mempoolInstance", DEFAULT_MEMPOOL_INSTANCE);
|
||||
root["mempoolSecure"] = preferences.getBool("mempoolSecure", DEFAULT_MEMPOOL_SECURE);
|
||||
|
||||
// Local pool settings
|
||||
root["localPoolEndpoint"] = preferences.getString("localPoolEndpoint", DEFAULT_LOCAL_POOL_ENDPOINT);
|
||||
|
||||
// Nostr settings (used for NOSTR_SOURCE or when zapNotify is enabled)
|
||||
root["nostrPubKey"] = preferences.getString("nostrPubKey", DEFAULT_NOSTR_NPUB);
|
||||
root["nostrRelay"] = preferences.getString("nostrRelay", DEFAULT_NOSTR_RELAY);
|
||||
|
|
Loading…
Add table
Reference in a new issue