mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 04:06:29 +01:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d07df27f0 | ||
|
|
064bd4258c | ||
|
|
8e31a1b8eb | ||
|
|
9598bea315 | ||
|
|
6d2ed6915b | ||
|
|
6ffe967577 | ||
|
|
e169dbab6e | ||
|
|
b9d3289852 | ||
|
|
b0971bd111 | ||
|
|
11193a1fbf | ||
|
|
db88de1f75 | ||
|
|
e9a554a2bf |
96
.github/workflows/release.yml
vendored
96
.github/workflows/release.yml
vendored
@@ -51,81 +51,105 @@ jobs:
|
||||
# tag: ${{ github.ref }}
|
||||
# file_glob: true
|
||||
|
||||
- name: Build firmware for ESP32
|
||||
- name: Build firmware for Simple_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
|
||||
pio run --environment Simple_AP
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32fw
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32fw/boot_app0.bin
|
||||
cp .pio/build/Simple_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32fw/firmware.bin
|
||||
cp .pio/build/Simple_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32fw/bootloader.bin
|
||||
cp .pio/build/Simple_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32fw/partitions.bin
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/Simple_AP
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Simple_AP/boot_app0.bin
|
||||
cp .pio/build/Simple_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Simple_AP/firmware.bin
|
||||
cp .pio/build/Simple_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Simple_AP/bootloader.bin
|
||||
cp .pio/build/Simple_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Simple_AP/partitions.bin
|
||||
|
||||
- name: Build filesystem for ESP32
|
||||
- name: Build filesystem for Simple_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
pio run --target buildfs --environment Simple_AP
|
||||
cp .pio/build/Simple_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32fw/littlefs.bin
|
||||
cp .pio/build/Simple_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Simple_AP/littlefs.bin
|
||||
|
||||
- name: Combine binaries for ESP32
|
||||
- name: Combine binaries for Simple_AP
|
||||
run: |
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32fw
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/Simple_AP
|
||||
esptool.py --chip esp32 merge_bin -o merged-firmware.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin
|
||||
|
||||
- name: Build firmware for ESP32-S2
|
||||
- name: Build firmware for OpenEPaperLink_Mini_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
|
||||
pio run --environment OpenEPaperLink_Mini_AP
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s2fw
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s2fw/boot_app0.bin
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s2fw/firmware.bin
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s2fw/bootloader.bin
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s2fw/partitions.bin
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Mini_AP
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Mini_AP/boot_app0.bin
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Mini_AP/firmware.bin
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Mini_AP/bootloader.bin
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Mini_AP/partitions.bin
|
||||
|
||||
- name: Build filesystem for ESP32-S2
|
||||
- name: Build filesystem for OpenEPaperLink_Mini_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
pio run --target buildfs --environment OpenEPaperLink_Mini_AP
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s2fw/littlefs.bin
|
||||
cp .pio/build/OpenEPaperLink_Mini_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Mini_AP/littlefs.bin
|
||||
|
||||
- name: Combine binaries for ESP32-S2
|
||||
- name: Combine binaries for OpenEPaperLink_Mini_AP
|
||||
run: |
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s2fw
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Mini_AP
|
||||
esptool.py --chip esp32-s2 merge_bin -o merged-firmware.bin --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin 0x290000 littlefs.bin
|
||||
|
||||
- name: Build firmware for ESP32-S3
|
||||
- name: Build firmware for OpenEPaperLink_Nano_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
|
||||
pio run --environment OpenEPaperLink_Nano_AP
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Nano_AP
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Nano_AP/boot_app0.bin
|
||||
cp .pio/build/OpenEPaperLink_Nano_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Nano_AP/firmware.bin
|
||||
cp .pio/build/OpenEPaperLink_Nano_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Nano_AP/bootloader.bin
|
||||
cp .pio/build/OpenEPaperLink_Nano_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Nano_AP/partitions.bin
|
||||
|
||||
- name: Build filesystem for OpenEPaperLink_Nano_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
pio run --target buildfs --environment OpenEPaperLink_Nano_AP
|
||||
cp .pio/build/OpenEPaperLink_Nano_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Nano_AP/littlefs.bin
|
||||
|
||||
- name: Combine binaries for OpenEPaperLink_Nano_AP
|
||||
run: |
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_Nano_AP
|
||||
esptool.py --chip esp32-s2 merge_bin -o merged-firmware.bin --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin 0x290000 littlefs.bin
|
||||
|
||||
- name: Build firmware for OpenEPaperLink_AP_and_Flasher
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
|
||||
pio run --environment OpenEPaperLink_AP_and_Flasher
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s3fw
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s3fw/boot_app0.bin
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s3fw/firmware.bin
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s3fw/bootloader.bin
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s3fw/partitions.bin
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_AP_and_Flasher
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_AP_and_Flasher/boot_app0.bin
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_AP_and_Flasher/firmware.bin
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_AP_and_Flasher/bootloader.bin
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_AP_and_Flasher/partitions.bin
|
||||
|
||||
- name: Build filesystem for ESP32-S3
|
||||
- name: Build filesystem for OpenEPaperLink_AP_and_Flasher
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
pio run --target buildfs --environment OpenEPaperLink_AP_and_Flasher
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s3fw/littlefs.bin
|
||||
cp .pio/build/OpenEPaperLink_AP_and_Flasher/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_AP_and_Flasher/littlefs.bin
|
||||
|
||||
- name: Combine binaries for ESP32-S3
|
||||
- name: Combine binaries for OpenEPaperLink_AP_and_Flasher
|
||||
run: |
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/esp32s3fw
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_AP_and_Flasher
|
||||
esptool.py --chip esp32-s3 merge_bin -o merged-firmware.bin --flash_mode dio --flash_freq 80m --flash_size 16MB 0x0000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin 0x00c90000 littlefs.bin
|
||||
|
||||
- name: move binaries
|
||||
run: |
|
||||
mkdir espbinaries
|
||||
cp esp32fw/firmware.bin espbinaries/Simple_AP.bin
|
||||
cp esp32s2fw/firmware.bin espbinaries/OpenEPaperLink_Mini_AP.bin
|
||||
cp esp32s3fw/firmware.bin espbinaries/OpenEPaperLink_AP_and_Flasher.bin
|
||||
cp esp32fw/merged-firmware.bin espbinaries/Simple_AP_full.bin
|
||||
cp esp32s2fw/merged-firmware.bin espbinaries/OpenEPaperLink_Mini_AP_full.bin
|
||||
cp esp32s3fw/merged-firmware.bin espbinaries/OpenEPaperLink_AP_and_Flasher_full.bin
|
||||
cp Simple_AP/firmware.bin espbinaries/Simple_AP.bin
|
||||
cp OpenEPaperLink_Mini_AP/firmware.bin espbinaries/OpenEPaperLink_Mini_AP.bin
|
||||
cp OpenEPaperLink_Nano_AP/firmware.bin espbinaries/OpenEPaperLink_Nano_AP.bin
|
||||
cp OpenEPaperLink_AP_and_Flasher/firmware.bin espbinaries/OpenEPaperLink_AP_and_Flasher.bin
|
||||
cp Simple_AP/merged-firmware.bin espbinaries/Simple_AP_full.bin
|
||||
cp OpenEPaperLink_Mini_AP/merged-firmware.bin espbinaries/OpenEPaperLink_Mini_AP_full.bin
|
||||
cp OpenEPaperLink_Nano_AP/merged-firmware.bin espbinaries/OpenEPaperLink_Nano_AP_full.bin
|
||||
cp OpenEPaperLink_AP_and_Flasher/merged-firmware.bin espbinaries/OpenEPaperLink_AP_and_Flasher_full.bin
|
||||
|
||||
- name: generate release json file
|
||||
run: |
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ESP32_AP-Flasher/data/fonts/calibrib100.vlw
Normal file
BIN
ESP32_AP-Flasher/data/fonts/calibrib100.vlw
Normal file
Binary file not shown.
BIN
ESP32_AP-Flasher/data/fonts/calibrib120.vlw
Normal file
BIN
ESP32_AP-Flasher/data/fonts/calibrib120.vlw
Normal file
Binary file not shown.
BIN
ESP32_AP-Flasher/data/fonts/calibrib150.vlw
Normal file
BIN
ESP32_AP-Flasher/data/fonts/calibrib150.vlw
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ESP32_AP-Flasher/data/fonts/calibrib60.vlw
Normal file
BIN
ESP32_AP-Flasher/data/fonts/calibrib60.vlw
Normal file
Binary file not shown.
Binary file not shown.
BIN
ESP32_AP-Flasher/data/fonts/calibrib80.vlw
Normal file
BIN
ESP32_AP-Flasher/data/fonts/calibrib80.vlw
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ESP32_AP-Flasher/data/fonts/twcondensed20.vlw
Normal file
BIN
ESP32_AP-Flasher/data/fonts/twcondensed20.vlw
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15
ESP32_AP-Flasher/data/update_actions.json
Normal file
15
ESP32_AP-Flasher/data/update_actions.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"deletefile": [
|
||||
"/fonts/calibrib62.vlw",
|
||||
"/fonts/GillSC16.vlw",
|
||||
"/fonts/GillSC20.vlw",
|
||||
"/fonts/numbers1-1.vlw",
|
||||
"/fonts/numbers1-2.vlw",
|
||||
"/fonts/numbers2-1.vlw",
|
||||
"/fonts/numbers2-2.vlw",
|
||||
"/fonts/numbers3-1.vlw",
|
||||
"/fonts/numbers3-2.vlw",
|
||||
"/fonts/tw20.vlw",
|
||||
"/fonts/twbold20.vlw"
|
||||
]
|
||||
}
|
||||
@@ -166,9 +166,10 @@
|
||||
{
|
||||
"id": 16,
|
||||
"name": "Buienradar",
|
||||
"desc": "Dutch rain predictions for the next two hours. Only works for Dutch locations.",
|
||||
"desc": "Dutch rain predictions for the next two hours. Only works for locations in the Netherlands and Belgium.",
|
||||
"hwtype": [
|
||||
1
|
||||
1,
|
||||
17
|
||||
],
|
||||
"param": [
|
||||
{
|
||||
@@ -331,7 +332,7 @@
|
||||
"id": 12,
|
||||
"name": "Remote content",
|
||||
"desc": "Content is generated by a different Access Point",
|
||||
"hwtype": []
|
||||
"hwtype": []
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
@@ -393,7 +394,7 @@
|
||||
"name": "bytes",
|
||||
"desc": "76 bytes, formatted as 0x00,0x00,...",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -151,7 +151,7 @@ Latency will be around 40 seconds.">
|
||||
<div class="model"></div>
|
||||
|
||||
<div class="received">
|
||||
RSSI <div class="rssi"></div>, LQI <div class="lqi"></div>, <div class="temperature"></div>°C, <div class="batt"></div>V
|
||||
RSSI <div class="rssi"></div>, LQI <div class="lqi"></div><div class="temperature"></div><div class="batt"></div>
|
||||
</div>
|
||||
|
||||
<div class="contentmode"></div>
|
||||
|
||||
@@ -276,10 +276,7 @@ select {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.received div {
|
||||
padding-left: 3px;
|
||||
padding-right: 1px;
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.contentmode {
|
||||
|
||||
@@ -159,8 +159,12 @@ function processTags(tagArray) {
|
||||
$('#tag' + tagmac + ' .model').innerHTML = models[element.hwType];
|
||||
$('#tag' + tagmac + ' .rssi').innerHTML = element.RSSI;
|
||||
$('#tag' + tagmac + ' .lqi').innerHTML = element.LQI;
|
||||
$('#tag' + tagmac + ' .temperature').innerHTML = element.temperature;
|
||||
$('#tag' + tagmac + ' .batt').innerHTML = element.batteryMv / 1000;
|
||||
$('#tag' + tagmac + ' .temperature').innerHTML = (element.temperature > 0 ? ", " + element.temperature + "°C": "");
|
||||
if (element.batteryMv == 0 || element.batteryMv == 1337) {
|
||||
$('#tag' + tagmac + ' .batt').innerHTML = "";
|
||||
} else {
|
||||
$('#tag' + tagmac + ' .batt').innerHTML = ", " + (element.batteryMv >= 2600 ? "≥" : "") + (element.batteryMv / 1000) + "V";
|
||||
}
|
||||
$('#tag' + tagmac + ' .received').style.opacity = "1";
|
||||
} else {
|
||||
$('#tag' + tagmac + ' .model').innerHTML = "waiting for hardware type";
|
||||
|
||||
@@ -151,6 +151,23 @@ export async function updateWebpage(fileUrl, tagname, showReload) {
|
||||
consoleDiv.scrollTop = consoleDiv.scrollHeight;
|
||||
|
||||
print("Updating littleFS partition...");
|
||||
|
||||
try {
|
||||
const response = await fetch("/update_actions", {
|
||||
method: "POST",
|
||||
body: ''
|
||||
});
|
||||
if (response.ok) {
|
||||
const data = await response.text();
|
||||
} else {
|
||||
print(`error performing update actions: ${response.status}`, "red");
|
||||
errors++;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`error calling update actions:` + error, "red");
|
||||
errors++;
|
||||
}
|
||||
|
||||
fetch("/getexturl?url=" + fileUrl)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
@@ -265,6 +282,7 @@ export async function updateESP(fileUrl, showConfirm) {
|
||||
}
|
||||
} catch (error) {
|
||||
print('Error: ' + error, "red");
|
||||
print("Something went wrong, try again.");
|
||||
}
|
||||
|
||||
running = false;
|
||||
|
||||
@@ -24,7 +24,7 @@ void drawNumber(String &filename, int32_t count, int32_t thresholdred, tagRecord
|
||||
void drawWeather(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgParam &imageParams);
|
||||
void drawForecast(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, imgParam &imageParams);
|
||||
void drawIdentify(String &filename, tagRecord *&taginfo, imgParam &imageParams);
|
||||
bool getImgURL(String &filename, String URL, time_t fetched, imgParam &imageParams, String MAC);
|
||||
int getImgURL(String &filename, String URL, time_t fetched, imgParam &imageParams, String MAC);
|
||||
bool getRssFeed(String &filename, String URL, String title, tagRecord *&taginfo, imgParam &imageParams);
|
||||
bool getCalFeed(String &filename, String URL, String title, tagRecord *&taginfo, imgParam &imageParams);
|
||||
void drawQR(String &filename, String qrcontent, String title, tagRecord *&taginfo, imgParam &imageParams);
|
||||
|
||||
@@ -10,3 +10,4 @@ void handleUpdateOTA(AsyncWebServerRequest* request);
|
||||
void firmwareUpdateTask(void* parameter);
|
||||
void updateFirmware(const char* url, const char* expectedMd5, size_t size);
|
||||
void handleRollback(AsyncWebServerRequest* request);
|
||||
void handleUpdateActions(AsyncWebServerRequest* request);
|
||||
|
||||
@@ -76,6 +76,56 @@ board_upload.maximum_ram_size = 327680
|
||||
board_upload.flash_size = 4MB
|
||||
|
||||
|
||||
[env:OpenEPaperLink_Nano_AP]
|
||||
platform = https://github.com/platformio/platform-espressif32.git
|
||||
board=lolin_s2_mini
|
||||
board_build.partitions = default.csv
|
||||
build_unflags =
|
||||
-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
|
||||
build_flags =
|
||||
-D BUILD_ENV_NAME=$PIOENV
|
||||
-D BUILD_TIME=$UNIX_TIME
|
||||
-D OPENEPAPERLINK_NANO_AP_PCB
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D CONFIG_SPIRAM_USE_MALLOC=1
|
||||
-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
|
||||
;-D DEBUG_VERSION
|
||||
|
||||
;-D HAS_RGB_LED
|
||||
-D BOARD_HAS_PSRAM
|
||||
;-D HAS_USB
|
||||
|
||||
-D FLASHER_AP_SS=38
|
||||
-D FLASHER_AP_CLK=40
|
||||
-D FLASHER_AP_MOSI=39
|
||||
-D FLASHER_AP_MISO=33
|
||||
-D FLASHER_AP_RESET=37
|
||||
-D FLASHER_AP_POWER=18
|
||||
-D FLASHER_AP_POWER2=21
|
||||
-D FLASHER_AP_POWER3=16
|
||||
-D FLASHER_AP_POWER4=17
|
||||
-D FLASHER_AP_TXD=35
|
||||
-D FLASHER_AP_RXD=36
|
||||
-D FLASHER_AP_TEST=34
|
||||
-D FLASHER_LED=15
|
||||
-D FLASHER_RGB_LED=-1
|
||||
|
||||
-D USER_SETUP_LOADED
|
||||
-D DISABLE_ALL_LIBRARY_WARNINGS
|
||||
-D ILI9341_DRIVER
|
||||
-D SMOOTH_FONT
|
||||
-D LOAD_FONT2
|
||||
|
||||
build_src_filter =
|
||||
+<*>-<usbflasher.cpp>-<serialconsole.cpp>
|
||||
|
||||
board_build.psram_type=qspi_opi
|
||||
board_upload.maximum_size = 4194304
|
||||
;board_upload.maximum_ram_size = 2097152
|
||||
board_upload.maximum_ram_size = 327680
|
||||
board_upload.flash_size = 4MB
|
||||
|
||||
|
||||
; ----------------------------------------------------------------------------------------
|
||||
; !!! this configuration expects the 16MB Flash / 8MB Ram version of the ESP32-S3-DevkitC1
|
||||
;
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
#include "web.h"
|
||||
#include "language.h"
|
||||
|
||||
// #define PAL_BLACK 0
|
||||
// #define PAL_WHITE 9
|
||||
// #define PAL_RED 2
|
||||
#define PAL_BLACK TFT_BLACK
|
||||
#define PAL_WHITE TFT_WHITE
|
||||
#define PAL_RED TFT_RED
|
||||
@@ -206,14 +203,19 @@ void drawNew(uint8_t mac[8], bool buttonPressed, tagRecord *&taginfo) {
|
||||
|
||||
case ImageUrl:
|
||||
|
||||
if (getImgURL(filename, cfgobj["url"], (time_t)cfgobj["#fetched"], imageParams, String(hexmac))) {
|
||||
taginfo->nextupdate = now + 60 * (cfgobj["interval"].as<int>() < 5 ? 5 : cfgobj["interval"].as<int>());
|
||||
{
|
||||
int httpcode = getImgURL(filename, cfgobj["url"], (time_t)cfgobj["#fetched"], imageParams, String(hexmac));
|
||||
if (httpcode == 200) {
|
||||
taginfo->nextupdate = now + 60 * (cfgobj["interval"].as<int>() < 3 ? 3 : cfgobj["interval"].as<int>());
|
||||
updateTagImage(filename, mac, cfgobj["interval"].as<int>(), taginfo, imageParams);
|
||||
cfgobj["#fetched"] = now;
|
||||
} else if (httpcode == 304) {
|
||||
taginfo->nextupdate = now + 60 * (cfgobj["interval"].as<int>() < 3 ? 3 : cfgobj["interval"].as<int>());
|
||||
} else {
|
||||
taginfo->nextupdate = now + 300;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
case RSSFeed:
|
||||
|
||||
@@ -270,8 +272,8 @@ void drawNew(uint8_t mac[8], bool buttonPressed, tagRecord *&taginfo) {
|
||||
case 16: // buienradar
|
||||
|
||||
drawBuienradar(filename, cfgobj, taginfo, imageParams);
|
||||
taginfo->nextupdate = now + (cfgobj["timetolive"].as<int>() < 5 ? 5 : cfgobj["timetolive"].as<int>())* 60;
|
||||
updateTagImage(filename, mac, (cfgobj["timetolive"].as<int>() < 5 ? 5 : cfgobj["timetolive"].as<int>()), taginfo, imageParams);
|
||||
taginfo->nextupdate = now + (cfgobj["ttl"].as<int>() < 5 ? 5 : cfgobj["ttl"].as<int>()) * 60;
|
||||
updateTagImage(filename, mac, (cfgobj["ttl"].as<int>() < 5 ? 5 : cfgobj["ttl"].as<int>()), taginfo, imageParams);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -298,16 +300,8 @@ void drawString(TFT_eSprite &spr, String content, uint16_t posx, uint16_t posy,
|
||||
}
|
||||
|
||||
void initSprite(TFT_eSprite &spr, int w, int h) {
|
||||
// spr.setColorDepth(4); // 4 bits per pixel, uses indexed color
|
||||
spr.setColorDepth(8);
|
||||
spr.createSprite(w, h);
|
||||
/*
|
||||
uint16_t cmap[16];
|
||||
cmap[PAL_BLACK] = TFT_BLACK;
|
||||
cmap[PAL_RED] = TFT_RED;
|
||||
cmap[PAL_WHITE] = TFT_WHITE;
|
||||
spr.createPalette(cmap, 16);
|
||||
*/
|
||||
if (spr.getPointer() == nullptr) {
|
||||
wsErr("Failed to create sprite");
|
||||
}
|
||||
@@ -336,22 +330,18 @@ void drawDate(String &filename, tagRecord *&taginfo, imgParam &imageParams) {
|
||||
|
||||
if (taginfo->hwType == SOLUM_29_SSD1619 || taginfo->hwType == SOLUM_29_UC8151) {
|
||||
initSprite(spr, 296, 128);
|
||||
if (getCurrentLanguage() == 0 && timeinfo.tm_wday == 3) {
|
||||
drawString(spr, languageDays[getCurrentLanguage()][timeinfo.tm_wday], 296 / 2, 10, "fonts/calibrib50", TC_DATUM, PAL_RED);
|
||||
} else {
|
||||
drawString(spr, languageDays[getCurrentLanguage()][timeinfo.tm_wday], 296 / 2, 10, "fonts/calibrib62", TC_DATUM, PAL_RED);
|
||||
}
|
||||
drawString(spr, languageDays[getCurrentLanguage()][timeinfo.tm_wday], 296 / 2, 10, "fonts/calibrib60", TC_DATUM, PAL_RED);
|
||||
drawString(spr, String(timeinfo.tm_mday) + " " + languageMonth[getCurrentLanguage()][timeinfo.tm_mon], 296 / 2, 73, "fonts/calibrib50", TC_DATUM);
|
||||
|
||||
} else if (taginfo->hwType == SOLUM_154_SSD1619) {
|
||||
initSprite(spr, 152, 152);
|
||||
drawString(spr, languageDays[getCurrentLanguage()][timeinfo.tm_wday], 152 / 2, 10, "fonts/calibrib30", TC_DATUM);
|
||||
drawString(spr, String(languageMonth[getCurrentLanguage()][timeinfo.tm_mon]), 152 / 2, 120, "fonts/calibrib30", TC_DATUM);
|
||||
drawString(spr, String(timeinfo.tm_mday), 152 / 2, 42, "fonts/numbers2-1", TC_DATUM, PAL_RED);
|
||||
drawString(spr, String(timeinfo.tm_mday), 152 / 2, 42, "fonts/calibrib100", TC_DATUM, PAL_RED);
|
||||
|
||||
} else if (taginfo->hwType == SOLUM_42_SSD1619) {
|
||||
initSprite(spr, 400, 300);
|
||||
drawString(spr, languageDays[getCurrentLanguage()][timeinfo.tm_wday], 400 / 2, 30, "fonts/calibrib62", TC_DATUM, PAL_RED);
|
||||
drawString(spr, languageDays[getCurrentLanguage()][timeinfo.tm_wday], 400 / 2, 30, "fonts/calibrib60", TC_DATUM, PAL_RED);
|
||||
drawString(spr, String(timeinfo.tm_mday) + " " + languageMonth[getCurrentLanguage()][timeinfo.tm_mon], 400 / 2, 113, "fonts/calibrib50", TC_DATUM);
|
||||
}
|
||||
|
||||
@@ -360,26 +350,21 @@ void drawDate(String &filename, tagRecord *&taginfo, imgParam &imageParams) {
|
||||
}
|
||||
|
||||
void drawNumber(String &filename, int32_t count, int32_t thresholdred, tagRecord *&taginfo, imgParam &imageParams) {
|
||||
|
||||
if (taginfo->hwType == SOLUM_SEG_UK) {
|
||||
imageParams.symbols = 0x00;
|
||||
if (count > 19999) {
|
||||
sprintf(imageParams.segments, "over flow");
|
||||
return;
|
||||
} else if (count > 9999) {
|
||||
imageParams.symbols = 0x02;
|
||||
sprintf(imageParams.segments, "%04d", count - 10000);
|
||||
} else {
|
||||
if (count > 9999) {
|
||||
imageParams.symbols = 0x02;
|
||||
if (taginfo->contentMode == CountHours) {
|
||||
sprintf(imageParams.segments, "%04d hour", count - 10000);
|
||||
} else {
|
||||
sprintf(imageParams.segments, "%04d days", count - 10000);
|
||||
}
|
||||
} else {
|
||||
if (taginfo->contentMode == CountHours) {
|
||||
sprintf(imageParams.segments, "%4d hour", count);
|
||||
} else {
|
||||
sprintf(imageParams.segments, "%4d days", count);
|
||||
}
|
||||
}
|
||||
sprintf(imageParams.segments, "%4d", count);
|
||||
}
|
||||
if (taginfo->contentMode == CountHours) {
|
||||
strcat(imageParams.segments, " hour");
|
||||
} else {
|
||||
strcat(imageParams.segments, " days");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -396,9 +381,10 @@ void drawNumber(String &filename, int32_t count, int32_t thresholdred, tagRecord
|
||||
} else {
|
||||
spr.setTextColor(PAL_BLACK, PAL_WHITE);
|
||||
}
|
||||
String font = "fonts/numbers1-2";
|
||||
if (count > 999) font = "fonts/numbers2-2";
|
||||
if (count > 9999) font = "fonts/numbers3-2";
|
||||
String font = "fonts/calibrib150";
|
||||
if (count > 99) font = "fonts/calibrib150";
|
||||
if (count > 999) font = "fonts/calibrib120";
|
||||
if (count > 9999) font = "fonts/calibrib100";
|
||||
spr.loadFont(font, LittleFS);
|
||||
spr.drawString(String(count), 296 / 2, 128 / 2 + 10);
|
||||
spr.unloadFont();
|
||||
@@ -411,9 +397,10 @@ void drawNumber(String &filename, int32_t count, int32_t thresholdred, tagRecord
|
||||
} else {
|
||||
spr.setTextColor(PAL_BLACK, PAL_WHITE);
|
||||
}
|
||||
String font = "fonts/numbers1-1";
|
||||
if (count > 99) font = "fonts/numbers2-1";
|
||||
if (count > 999) font = "fonts/numbers3-1";
|
||||
String font = "fonts/calibrib120";
|
||||
if (count > 99) font = "fonts/calibrib80";
|
||||
if (count > 999) font = "fonts/calibrib50";
|
||||
if (count > 9999) font = "fonts/calibrib50";
|
||||
spr.loadFont(font, LittleFS);
|
||||
spr.drawString(String(count), 152 / 2, 152 / 2 + 7);
|
||||
spr.unloadFont();
|
||||
@@ -426,9 +413,10 @@ void drawNumber(String &filename, int32_t count, int32_t thresholdred, tagRecord
|
||||
} else {
|
||||
spr.setTextColor(PAL_BLACK, PAL_WHITE);
|
||||
}
|
||||
String font = "fonts/numbers1-2";
|
||||
if (count > 999) font = "fonts/numbers2-2";
|
||||
if (count > 9999) font = "fonts/numbers3-2";
|
||||
String font = "fonts/calibrib150";
|
||||
if (count > 99) font = "fonts/calibrib150";
|
||||
if (count > 999) font = "fonts/calibrib120";
|
||||
if (count > 9999) font = "fonts/calibrib100";
|
||||
spr.loadFont(font, LittleFS);
|
||||
spr.drawString(String(count), 400 / 2, 300 / 2 + 7);
|
||||
spr.unloadFont();
|
||||
@@ -674,7 +662,7 @@ void drawForecast(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, img
|
||||
for (uint8_t dag = 0; dag < 5; dag++) {
|
||||
time_t weatherday = doc["daily"]["time"][dag].as<time_t>();
|
||||
struct tm *datum = localtime(&weatherday);
|
||||
drawString(spr, String(languageDaysShort[getCurrentLanguage()][datum->tm_wday]), dag * 59 + 30, 18, "fonts/twbold20", TC_DATUM, PAL_BLACK);
|
||||
drawString(spr, String(languageDaysShort[getCurrentLanguage()][datum->tm_wday]), dag * 59 + 30, 18, "fonts/twcondensed20", TC_DATUM, PAL_BLACK);
|
||||
|
||||
uint8_t weathercode = doc["daily"]["weathercode"][dag].as<int>();
|
||||
if (weathercode > 40) weathercode -= 40;
|
||||
@@ -698,7 +686,7 @@ void drawForecast(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, img
|
||||
int8_t tmax = round(doc["daily"]["temperature_2m_max"][dag].as<double>());
|
||||
uint8_t wind = windSpeedToBeaufort(doc["daily"]["windspeed_10m_max"][dag].as<double>());
|
||||
|
||||
spr.loadFont("fonts/GillSC20", LittleFS);
|
||||
spr.loadFont("fonts/twcondensed20", LittleFS);
|
||||
drawString(spr, String(tmin) + " ", dag * 59 + 30, 108, "", TR_DATUM, (tmin < 0 ? PAL_RED : PAL_BLACK));
|
||||
drawString(spr, String(" ") + String(tmax), dag * 59 + 30, 108, "", TL_DATUM, (tmax < 0 ? PAL_RED : PAL_BLACK));
|
||||
drawString(spr, String(" ") + String(wind), dag * 59 + 30, 43, "", TL_DATUM, (wind > 5 ? PAL_RED : PAL_BLACK));
|
||||
@@ -719,7 +707,7 @@ void drawForecast(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, img
|
||||
for (uint8_t dag = 0; dag < 5; dag++) {
|
||||
time_t weatherday = doc["daily"]["time"][dag].as<time_t>();
|
||||
struct tm *datum = localtime(&weatherday);
|
||||
drawString(spr, String(languageDaysShort[getCurrentLanguage()][datum->tm_wday]), dag * 59 + 30, 18, "fonts/twbold20", TC_DATUM, PAL_BLACK);
|
||||
drawString(spr, String(languageDaysShort[getCurrentLanguage()][datum->tm_wday]), dag * 59 + 30, 18, "fonts/twcondensed20", TC_DATUM, PAL_BLACK);
|
||||
|
||||
uint8_t weathercode = doc["daily"]["weathercode"][dag].as<int>();
|
||||
if (weathercode > 40) weathercode -= 40;
|
||||
@@ -743,7 +731,7 @@ void drawForecast(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, img
|
||||
int8_t tmax = round(doc["daily"]["temperature_2m_max"][dag].as<double>());
|
||||
uint8_t wind = windSpeedToBeaufort(doc["daily"]["windspeed_10m_max"][dag].as<double>());
|
||||
|
||||
spr.loadFont("fonts/GillSC20", LittleFS);
|
||||
spr.loadFont("fonts/twcondensed20", LittleFS);
|
||||
drawString(spr, String(tmin) + " ", dag * 59 + 30, 108, "", TR_DATUM, (tmin < 0 ? PAL_RED : PAL_BLACK));
|
||||
drawString(spr, String(" ") + String(tmax), dag * 59 + 30, 108, "", TL_DATUM, (tmax < 0 ? PAL_RED : PAL_BLACK));
|
||||
drawString(spr, String(" ") + String(wind), dag * 59 + 30, 43, "", TL_DATUM, (wind > 5 ? PAL_RED : PAL_BLACK));
|
||||
@@ -788,7 +776,7 @@ void drawIdentify(String &filename, tagRecord *&taginfo, imgParam &imageParams)
|
||||
spr.deleteSprite();
|
||||
}
|
||||
|
||||
bool getImgURL(String &filename, String URL, time_t fetched, imgParam &imageParams, String MAC) {
|
||||
int getImgURL(String &filename, String URL, time_t fetched, imgParam &imageParams, String MAC) {
|
||||
// https://images.klari.net/kat-bw29.jpg
|
||||
|
||||
LittleFS.begin();
|
||||
@@ -811,11 +799,11 @@ bool getImgURL(String &filename, String URL, time_t fetched, imgParam &imagePara
|
||||
if (httpCode != 304) {
|
||||
wsErr("http " + URL + " " + String(httpCode));
|
||||
} else {
|
||||
wsLog("http " + URL + " " + String(httpCode));
|
||||
Serial.println("http 304, image is not changed " + URL);
|
||||
}
|
||||
}
|
||||
http.end();
|
||||
return (httpCode == 200 || httpCode == 304);
|
||||
return httpCode;
|
||||
}
|
||||
|
||||
#ifdef CONTENT_RSS
|
||||
@@ -928,7 +916,7 @@ bool getCalFeed(String &filename, String URL, String title, tagRecord *&taginfo,
|
||||
struct tm timeinfo;
|
||||
localtime_r(&now, &timeinfo);
|
||||
static char dateString[40];
|
||||
strftime(dateString, sizeof(dateString), " - %d.%m.%Y", &timeinfo);
|
||||
strftime(dateString, sizeof(dateString), "%d.%m.%Y", &timeinfo);
|
||||
|
||||
HTTPClient http;
|
||||
http.begin(URL);
|
||||
@@ -963,6 +951,7 @@ bool getCalFeed(String &filename, String URL, String title, tagRecord *&taginfo,
|
||||
u8f.setBackgroundColor(PAL_WHITE);
|
||||
u8f.setCursor(5, 16);
|
||||
u8f.print(title);
|
||||
u8f.setCursor(180, 16);
|
||||
u8f.print(dateString);
|
||||
|
||||
int n = doc.size();
|
||||
@@ -999,6 +988,7 @@ bool getCalFeed(String &filename, String URL, String title, tagRecord *&taginfo,
|
||||
u8f.setBackgroundColor(PAL_WHITE);
|
||||
u8f.setCursor(5, 16);
|
||||
u8f.print(title);
|
||||
u8f.setCursor(280, 16);
|
||||
u8f.print(dateString);
|
||||
|
||||
int n = doc.size();
|
||||
@@ -1156,7 +1146,9 @@ void drawBuienradar(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, i
|
||||
char *formatHttpDate(time_t t) {
|
||||
static char buf[40];
|
||||
struct tm *timeinfo;
|
||||
timeinfo = gmtime(&t);
|
||||
timeinfo = localtime(&t); // Get the local time
|
||||
time_t utcTime = mktime(timeinfo); // Convert to UTC
|
||||
timeinfo = gmtime(&utcTime);
|
||||
strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S GMT", timeinfo);
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void setup() {
|
||||
showColorPattern(CRGB::Aqua, CRGB::Green, CRGB::Blue);
|
||||
#endif
|
||||
|
||||
#ifdef OPENEPAPERLINK_MINI_AP_PCB
|
||||
#if defined(OPENEPAPERLINK_MINI_AP_PCB) || defined(OPENEPAPERLINK_NANO_AP_PCB)
|
||||
APEnterEarlyReset();
|
||||
// this allows us to view the booting process. After the device showing up, you have 3 seconds to open a terminal on the COM port
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -30,7 +30,11 @@ void jpg2buffer(String filein, String fileout, imgParam &imageParams) {
|
||||
}
|
||||
Serial.println("jpeg conversion " + String(w) + "x" + String(h));
|
||||
|
||||
#ifdef BOARD_HAS_PSRAM
|
||||
spr.setColorDepth(16);
|
||||
#else
|
||||
spr.setColorDepth(8);
|
||||
#endif
|
||||
spr.createSprite(w, h);
|
||||
if (spr.getPointer() == nullptr) {
|
||||
//no heap space for 8bpp, fallback to 1bpp
|
||||
|
||||
@@ -39,12 +39,12 @@ void handleSysinfoRequest(AsyncWebServerRequest* request) {
|
||||
doc["rollback"] = Update.canRollBack();
|
||||
|
||||
size_t bufferSize = measureJson(doc) + 1;
|
||||
AsyncResponseStream *response = request->beginResponseStream("application/json", bufferSize);
|
||||
AsyncResponseStream* response = request->beginResponseStream("application/json", bufferSize);
|
||||
serializeJson(doc, *response);
|
||||
request->send(response);
|
||||
};
|
||||
|
||||
void handleCheckFile(AsyncWebServerRequest *request) {
|
||||
void handleCheckFile(AsyncWebServerRequest* request) {
|
||||
if (!request->hasParam("path")) {
|
||||
request->send(400);
|
||||
return;
|
||||
@@ -86,7 +86,7 @@ void handleGetExtUrl(AsyncWebServerRequest* request) {
|
||||
String url = request->getParam("url")->value();
|
||||
HTTPClient http;
|
||||
http.begin(url);
|
||||
http.setConnectTimeout(4000);
|
||||
http.setConnectTimeout(5000);
|
||||
http.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS);
|
||||
int httpResponseCode = http.GET();
|
||||
if (httpResponseCode > 0) {
|
||||
@@ -110,7 +110,7 @@ void handleGetExtUrl(AsyncWebServerRequest* request) {
|
||||
}
|
||||
}
|
||||
|
||||
void handleLittleFSUpload(AsyncWebServerRequest *request, String filename, size_t index, uint8_t *data, size_t len, bool final) {
|
||||
void handleLittleFSUpload(AsyncWebServerRequest* request, String filename, size_t index, uint8_t* data, size_t len, bool final) {
|
||||
bool error = false;
|
||||
if (!index) {
|
||||
String path;
|
||||
@@ -183,9 +183,9 @@ void updateFirmware(const char* url, const char* expectedMd5, size_t size) {
|
||||
|
||||
config.runStatus = RUNSTATUS_STOP;
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
//xSemaphoreTake(tagDBOwner, portMAX_DELAY);
|
||||
// xSemaphoreTake(tagDBOwner, portMAX_DELAY);
|
||||
saveDB("/current/tagDB.json");
|
||||
//destroyDB();
|
||||
// destroyDB();
|
||||
|
||||
HTTPClient httpClient;
|
||||
|
||||
@@ -222,7 +222,7 @@ void updateFirmware(const char* url, const char* expectedMd5, size_t size) {
|
||||
wsSerial("Reboot system now");
|
||||
wsSerial("[reboot]");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
//ESP.restart();
|
||||
// ESP.restart();
|
||||
} else {
|
||||
wsSerial("Error updating firmware:");
|
||||
wsSerial(Update.errorString());
|
||||
@@ -241,9 +241,9 @@ void updateFirmware(const char* url, const char* expectedMd5, size_t size) {
|
||||
}
|
||||
|
||||
httpClient.end();
|
||||
//loadDB("/current/tagDB.json");
|
||||
// loadDB("/current/tagDB.json");
|
||||
config.runStatus = RUNSTATUS_RUN;
|
||||
//xSemaphoreGive(tagDBOwner);
|
||||
// xSemaphoreGive(tagDBOwner);
|
||||
}
|
||||
|
||||
void handleRollback(AsyncWebServerRequest* request) {
|
||||
@@ -255,7 +255,7 @@ void handleRollback(AsyncWebServerRequest* request) {
|
||||
wsSerial("Reboot system now");
|
||||
wsSerial("[reboot]");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
//ESP.restart();
|
||||
// ESP.restart();
|
||||
} else {
|
||||
wsSerial("Rollback failed");
|
||||
request->send(400, "Rollback failed");
|
||||
@@ -264,4 +264,26 @@ void handleRollback(AsyncWebServerRequest* request) {
|
||||
wsSerial("Rollback not allowed");
|
||||
request->send(400, "Rollback not allowed");
|
||||
}
|
||||
}
|
||||
|
||||
void handleUpdateActions(AsyncWebServerRequest* request) {
|
||||
wsSerial("Performing cleanup");
|
||||
File file = LittleFS.open("/update_actions.json", "r");
|
||||
if (!file) {
|
||||
wsSerial("No update_actions.json present");
|
||||
request->send(200, "No update actions needed");
|
||||
return;
|
||||
}
|
||||
StaticJsonDocument<1000> doc;
|
||||
DeserializationError error = deserializeJson(doc, file);
|
||||
JsonArray deleteFiles = doc["deletefile"].as<JsonArray>();
|
||||
for (const auto& filePath : deleteFiles) {
|
||||
if (LittleFS.remove(filePath.as<const char*>())) {
|
||||
wsSerial("deleted file: " + filePath.as<String>());
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
wsSerial("Cleanup finished");
|
||||
request->send(200, "Clean up finished");
|
||||
LittleFS.remove("/update_actions.json");
|
||||
}
|
||||
@@ -11,12 +11,33 @@
|
||||
|
||||
#ifdef SIMPLE_AP
|
||||
void simpleAPPower(bool state) {
|
||||
pinMode(FLASHER_AP_POWER, INPUT);
|
||||
pinMode(FLASHER_AP_POWER2, INPUT);
|
||||
digitalWrite(FLASHER_AP_POWER, state);
|
||||
digitalWrite(FLASHER_AP_POWER2, state);
|
||||
pinMode(FLASHER_AP_POWER, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER2, OUTPUT);
|
||||
if (FLASHER_AP_POWER >= 0 && FLASHER_AP_POWER2 >= 0) {
|
||||
pinMode(FLASHER_AP_POWER, INPUT);
|
||||
pinMode(FLASHER_AP_POWER2, INPUT);
|
||||
digitalWrite(FLASHER_AP_POWER, state);
|
||||
digitalWrite(FLASHER_AP_POWER2, state);
|
||||
pinMode(FLASHER_AP_POWER, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER2, OUTPUT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OPENEPAPERLINK_NANO_AP_PCB
|
||||
void simpleAPPower(bool state) {
|
||||
if (FLASHER_AP_POWER >= 0 && FLASHER_AP_POWER2 >= 0 && FLASHER_AP_POWER3 >= 0 && FLASHER_AP_POWER4 >= 0) {
|
||||
pinMode(FLASHER_AP_POWER, INPUT);
|
||||
pinMode(FLASHER_AP_POWER2, INPUT);
|
||||
pinMode(FLASHER_AP_POWER3, INPUT);
|
||||
pinMode(FLASHER_AP_POWER4, INPUT);
|
||||
digitalWrite(FLASHER_AP_POWER, state);
|
||||
digitalWrite(FLASHER_AP_POWER2, state);
|
||||
digitalWrite(FLASHER_AP_POWER3, state);
|
||||
digitalWrite(FLASHER_AP_POWER4, state);
|
||||
pinMode(FLASHER_AP_POWER, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER2, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER3, OUTPUT);
|
||||
pinMode(FLASHER_AP_POWER4, OUTPUT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -55,4 +76,9 @@ void rampTagPower(uint8_t pin, bool up) {
|
||||
delay(500);
|
||||
simpleAPPower(up);
|
||||
#endif
|
||||
#ifdef OPENEPAPERLINK_NANO_AP_PCB
|
||||
simpleAPPower(false);
|
||||
delay(500);
|
||||
simpleAPPower(up);
|
||||
#endif
|
||||
}
|
||||
@@ -133,14 +133,13 @@ void APEnterEarlyReset() {
|
||||
void APTagReset() {
|
||||
pinMode(AP_RESET_PIN, OUTPUT);
|
||||
digitalWrite(AP_RESET_PIN, LOW);
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
rampTagPower(AP_POWER_PIN, false);
|
||||
vTaskDelay(300 / portTICK_PERIOD_MS);
|
||||
rampTagPower(AP_POWER_PIN, true);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
rampTagPower(AP_POWER_PIN, true);
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
digitalWrite(AP_RESET_PIN, HIGH);
|
||||
rampTagPower(AP_POWER_PIN, true);
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
// Send data to the AP
|
||||
@@ -582,7 +581,7 @@ bool bringAPOnline() {
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
uint32_t bootTimeout = millis();
|
||||
bool APrdy = false;
|
||||
while ((!APrdy) && (millis() - bootTimeout < 5 * 1000)) {
|
||||
while ((!APrdy) && (millis() - bootTimeout < 10 * 1000)) {
|
||||
APrdy = sendPing();
|
||||
vTaskDelay(300 / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ void saveDB(String filename) {
|
||||
if (c > 0) {
|
||||
file.write(',');
|
||||
}
|
||||
serializeJson(doc, file);
|
||||
serializeJsonPretty(doc, file);
|
||||
}
|
||||
file.write(']');
|
||||
|
||||
@@ -156,7 +156,7 @@ void saveDB(String filename) {
|
||||
void loadDB(String filename) {
|
||||
StaticJsonDocument<1000> doc;
|
||||
|
||||
Serial.println("start reading DB from file");
|
||||
Serial.println("reading DB from file");
|
||||
long t = millis();
|
||||
|
||||
LittleFS.begin();
|
||||
@@ -221,9 +221,6 @@ void loadDB(String filename) {
|
||||
}
|
||||
|
||||
readfile.close();
|
||||
Serial.println(millis() - t);
|
||||
Serial.println("finished reading file");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -290,6 +287,6 @@ void saveAPconfig() {
|
||||
APconfig["language"] = config.language;
|
||||
APconfig["maxsleep"] = config.maxsleep;
|
||||
APconfig["stopsleep"] = config.stopsleep;
|
||||
serializeJson(APconfig, configFile);
|
||||
serializeJsonPretty(APconfig, configFile);
|
||||
configFile.close();
|
||||
}
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
extern uint8_t data_to_send[];
|
||||
|
||||
//const char *http_username = "admin";
|
||||
//const char *http_password = "admin";
|
||||
// const char *http_username = "admin";
|
||||
// const char *http_password = "admin";
|
||||
AsyncWebServer server(80);
|
||||
AsyncWebSocket ws("/ws");
|
||||
|
||||
@@ -136,8 +136,8 @@ void wsSendSysteminfo() {
|
||||
sys["recordcount"] = tagDB.size();
|
||||
sys["dbsize"] = tagDB.size() * sizeof(tagRecord);
|
||||
sys["littlefsfree"] = LittleFS.totalBytes() - LittleFS.usedBytes();
|
||||
sys["apstate"] = apInfo.state;
|
||||
sys["runstate"] = config.runStatus;
|
||||
sys["apstate"] = apInfo.state;
|
||||
sys["runstate"] = config.runStatus;
|
||||
|
||||
xSemaphoreTake(wsMutex, portMAX_DELAY);
|
||||
ws.textAll(doc.as<String>());
|
||||
@@ -228,15 +228,22 @@ void init_web() {
|
||||
|
||||
WiFiManager wm;
|
||||
bool res;
|
||||
#if defined(OPENEPAPERLINK_MINI_AP_PCB) || defined(OPENEPAPERLINK_NANO_AP_PCB)
|
||||
WiFi.setTxPower(WIFI_POWER_15dBm);
|
||||
#endif
|
||||
wm.setWiFiAutoReconnect(true);
|
||||
res = wm.autoConnect("OpenEPaperLink Setup");
|
||||
if (!res) {
|
||||
Serial.println("Failed to connect");
|
||||
ESP.restart();
|
||||
}
|
||||
#if defined(OPENEPAPERLINK_MINI_AP_PCB) || defined(OPENEPAPERLINK_NANO_AP_PCB)
|
||||
WiFi.setTxPower(WIFI_POWER_19_5dBm);
|
||||
#endif
|
||||
Serial.print("Connected! IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
//server.addHandler(new SPIFFSEditor(LittleFS, http_username, http_password));
|
||||
// server.addHandler(new SPIFFSEditor(LittleFS, http_username, http_password));
|
||||
server.addHandler(new SPIFFSEditor(LittleFS));
|
||||
|
||||
ws.onEvent(onEvent);
|
||||
@@ -267,8 +274,10 @@ void init_web() {
|
||||
if (request->hasParam("mac")) {
|
||||
String dst = request->getParam("mac")->value();
|
||||
uint8_t mac[8];
|
||||
if (hex2mac(dst,mac)) {
|
||||
if (hex2mac(dst, mac)) {
|
||||
json = tagDBtoJson(mac);
|
||||
} else {
|
||||
json = "{\"error\": \"malformatted parameter\"}";
|
||||
}
|
||||
} else {
|
||||
uint8_t startPos = 0;
|
||||
@@ -354,7 +363,6 @@ void init_web() {
|
||||
|
||||
server.on("/save_apcfg", HTTP_POST, [](AsyncWebServerRequest *request) {
|
||||
if (request->hasParam("alias", true) && request->hasParam("channel", true)) {
|
||||
|
||||
String aliasValue = request->getParam("alias", true)->value();
|
||||
size_t aliasLength = aliasValue.length();
|
||||
if (aliasLength > 31) aliasLength = 31;
|
||||
@@ -393,11 +401,11 @@ void init_web() {
|
||||
server.on("/sysinfo", HTTP_GET, handleSysinfoRequest);
|
||||
server.on("/check_file", HTTP_GET, handleCheckFile);
|
||||
server.on("/getexturl", HTTP_GET, handleGetExtUrl);
|
||||
server.on("/rollback", HTTP_POST, handleRollback);
|
||||
server.on("/update_actions", HTTP_POST, handleUpdateActions);
|
||||
server.on("/update_ota", HTTP_POST, [](AsyncWebServerRequest *request) {
|
||||
handleUpdateOTA(request);
|
||||
});
|
||||
server.on("/rollback", HTTP_POST, handleRollback);
|
||||
|
||||
server.on(
|
||||
"/littlefs_put", HTTP_POST, [](AsyncWebServerRequest *request) {
|
||||
request->send(200);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<img width="600" alt="atc1441_jig2" src="atc1441_jig2.jpg">
|
||||
|
||||
- The Jig is printed in 3 parts, and uses the 1.3mm Pogo Pins
|
||||
- The Jig is printed in 3 parts, and uses the 1.5mm Pogo Pins like P100-H2
|
||||
- The Screws to connect the main and bottom body together need to be screwed in quite hard anything from 1-3mm should work
|
||||
- The body and screws are designed for the ESP32 Lolin32 Lite board
|
||||
|
||||
|
||||
12
README.md
12
README.md
@@ -35,8 +35,8 @@ After programming the ESP32, make sure to also program the filesystem. This will
|
||||
* [Mini AP](https://github.com/jjwbruijn/OpenEPaperLink/tree/master/Hardware/OpenEPaperLink%20Mini%20AP)
|
||||
* [Combined Flasher and AP](https://github.com/jjwbruijn/OpenEPaperLink/tree/master/Hardware/OpenEPaperLink%20AP%20and%20Flasher)
|
||||
* [ATC1441's ZBS flasher page](https://github.com/atc1441/ZBS_Flasher)
|
||||
* [Tags specs](https://github.com/jjwbruijn/OpenEPaperLink/blob/master/Tags-specs/)
|
||||
* [Tags troubleshooting](https://github.com/jjwbruijn/OpenEPaperLink/blob/master/Tags-specs/troubleshooting.md)
|
||||
* [Tags specs](https://github.com/jjwbruijn/OpenEPaperLink/wiki#tags)
|
||||
* [Tags troubleshooting](https://github.com/jjwbruijn/OpenEPaperLink/wiki/Troubleshooting-Tags)
|
||||
|
||||
## The protocol explained
|
||||
- The tag checks in with the AP every 40+ seconds. Actual check-in interval is highly dependent on RF conditions, or if the AP tells the tag to delay the next check-in
|
||||
@@ -70,7 +70,9 @@ After programming the ESP32, make sure to also program the filesystem. This will
|
||||
Hats off to these legends!
|
||||
|
||||
## Automated Builds
|
||||
- After a PR gets merged to the main branch, the ESP32 code will automatically be compiled. This can take up to 20 minutes.
|
||||
- Information about the latest builds can be found below
|
||||
<img alt="builds" src="https://openepaperlink.de/build/img.php">
|
||||
- After a PR gets merged to the main branch, the ESP32 code will automatically be compiled.
|
||||
- On release, files are added to enable OTA
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Reference in New Issue
Block a user