mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 03:04:25 +01:00
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -185,6 +185,24 @@ jobs:
|
||||
cp ESP32_S3_16_8_YELLOW_AP/firmware.bin espbinaries/ESP32_S3_16_8_YELLOW_AP.bin
|
||||
cp ESP32_S3_16_8_YELLOW_AP/merged-firmware.bin espbinaries/ESP32_S3_16_8_YELLOW_AP_full.bin
|
||||
|
||||
- name: Build firmware for OpenEPaperLink_PoE_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
|
||||
pio run --environment OpenEPaperLink_PoE_AP
|
||||
pio run --target buildfs --environment OpenEPaperLink_PoE_AP
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_PoE_AP
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_PoE_AP/boot_app0.bin
|
||||
cp .pio/build/OpenEPaperLink_PoE_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_PoE_AP/firmware.bin
|
||||
cp .pio/build/OpenEPaperLink_PoE_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_PoE_AP/bootloader.bin
|
||||
cp .pio/build/OpenEPaperLink_PoE_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_PoE_AP/partitions.bin
|
||||
cp .pio/build/OpenEPaperLink_PoE_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_PoE_AP/littlefs.bin
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/OpenEPaperLink_PoE_AP
|
||||
esptool.py --chip esp32 merge_bin -o merged-firmware.bin --flash_mode qio --flash_freq 80m --flash_size 16MB 0x0000 bootloader.bin 0x8000 partitions.bin 0xD000 boot_app0.bin 0x10000 firmware.bin 0x410000 littlefs.bin
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink
|
||||
cp OpenEPaperLink_PoE_AP/firmware.bin espbinaries/OpenEPaperLink_PoE_AP.bin
|
||||
cp OpenEPaperLink_PoE_AP/merged-firmware.bin espbinaries/OpenEPaperLink_PoE_AP_full.bin
|
||||
|
||||
- name: generate release json file
|
||||
run: |
|
||||
mkdir jsonfiles
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "wdt.h"
|
||||
|
||||
int8_t temperature = 0;
|
||||
uint32_t batteryRaw = 0;
|
||||
uint16_t batteryVoltage = 0;
|
||||
uint32_t batteryRaw = 0;
|
||||
uint32_t flashposition = 0;
|
||||
bool lowBattery = false;
|
||||
|
||||
bool disablePinInterruptSleep = false;
|
||||
|
||||
int8_t startHFCLK(void) {
|
||||
@@ -164,9 +164,10 @@ bool interrupted = false;
|
||||
|
||||
// uint8_t ledcfg[12] = {0b00100010,0x78,0b00100100,5,0x03,0b01000011,1,0xC2,0b1100001,10,10,0};
|
||||
// uint8_t ledcfg[12] = {0b00010010,0x7D,0,0,0x03,0xE8,0,0,0,0,0,0};
|
||||
uint8_t ledcfg[12] = {255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
uint8_t ledcfg[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
void setled(uint64_t parta, u_int32_t partb) {
|
||||
flashposition = 0;
|
||||
ledcfg[0] = parta & 0xFF;
|
||||
ledcfg[1] = (parta >> 8) & 0xFF;
|
||||
ledcfg[2] = (parta >> 16) & 0xFF;
|
||||
@@ -248,55 +249,40 @@ void sleepwithinterrupts(uint32_t sleepinterval) {
|
||||
|
||||
void ledflashlogic(uint32_t ms) {
|
||||
watchdog_enable(ms + 1000);
|
||||
uint8_t brightness = ledcfg[0] >> 4 & 0b00001111;
|
||||
uint8_t brightness = (ledcfg[0] >> 4 & 0b00001111) + 1;
|
||||
uint8_t mode = ledcfg[0] & 0b00001111;
|
||||
// lets not blink for short delays
|
||||
if (ms < 2000) mode = 15;
|
||||
if (ms < 2000) mode = 0;
|
||||
if (mode == 1) {
|
||||
uint8_t color = ledcfg[1];
|
||||
uint32_t ledinerv = (ledcfg[2] << 24) + (ledcfg[3] << 16) + (ledcfg[4] << 8) + ledcfg[5];
|
||||
uint32_t sleepinterval = ledinerv;
|
||||
loops = ms / ledinerv;
|
||||
if (loops == 0) {
|
||||
loops = 1;
|
||||
sleepinterval = ms;
|
||||
}
|
||||
if (sleepinterval > ms) sleepinterval = ms;
|
||||
for (uint32_t i = 0; i < loops; i++) {
|
||||
flashled(color, brightness);
|
||||
sleepwithinterrupts(sleepinterval);
|
||||
}
|
||||
}
|
||||
else if (mode == 0) {
|
||||
interrupted = false;
|
||||
uint8_t interloopdelayfactor = 100;
|
||||
u_int8_t loopdelayfactor = 100;
|
||||
uint8_t c1 = ledcfg[1];
|
||||
uint8_t c2 = ledcfg[3];
|
||||
uint8_t c3 = ledcfg[5];
|
||||
uint8_t c2 = ledcfg[4];
|
||||
uint8_t c3 = ledcfg[7];
|
||||
uint8_t loop1delay = (ledcfg[2] >> 4) & 0b00001111;
|
||||
uint8_t loop2delay = (ledcfg[4] >> 4) & 0b00001111;
|
||||
uint8_t loop3delay = (ledcfg[6] >> 4) & 0b00001111;
|
||||
uint8_t loop2delay = (ledcfg[5] >> 4) & 0b00001111;
|
||||
uint8_t loop3delay = (ledcfg[8] >> 4) & 0b00001111;
|
||||
uint8_t loopcnt1 = ledcfg[2] & 0b00001111;
|
||||
uint8_t loopcnt2 = ledcfg[4] & 0b00001111;
|
||||
uint8_t loopcnt3 = ledcfg[6] & 0b00001111;
|
||||
uint8_t ildelay1 = 0;
|
||||
uint8_t ildelay2 = 0;
|
||||
uint8_t ildelay3 = 0;
|
||||
uint8_t grouprepeats = ledcfg[7];
|
||||
uint8_t loopcnt2 = ledcfg[5] & 0b00001111;
|
||||
uint8_t loopcnt3 = ledcfg[8] & 0b00001111;
|
||||
uint8_t ildelay1 = ledcfg[3];
|
||||
uint8_t ildelay2 = ledcfg[6];
|
||||
uint8_t ildelay3 = ledcfg[9];
|
||||
uint8_t grouprepeats = ledcfg[10] + 1;
|
||||
uint8_t spare = ledcfg[11];
|
||||
uint32_t fulllooptime1 = loopcnt1 * loop1delay * loopdelayfactor + ildelay1 * interloopdelayfactor;
|
||||
uint32_t fulllooptime2 = loopcnt2 * loop2delay * loopdelayfactor + ildelay2 * interloopdelayfactor;
|
||||
uint32_t fulllooptime3 = loopcnt3 * loop3delay * loopdelayfactor + ildelay3 * interloopdelayfactor;
|
||||
uint32_t looptimesum = fulllooptime1 + fulllooptime2 + fulllooptime3;
|
||||
if(looptimesum == 0)looptimesum = 2;
|
||||
int fittingrepeats = (int)ms / looptimesum;
|
||||
|
||||
//catch edge case
|
||||
if (grouprepeats == 0) sleepwithinterrupts(ms);
|
||||
|
||||
for (int j = 0; j < fittingrepeats; j++) {
|
||||
if(j > grouprepeats){
|
||||
if(flashposition >= grouprepeats && grouprepeats != 255){
|
||||
brightness = 0;
|
||||
ledcfg[0] = 0xff;
|
||||
ledcfg[0] = 0x00;
|
||||
flashposition = 0;
|
||||
}
|
||||
if (!interrupted) {
|
||||
for (int i = 0; i < loopcnt1; i++) {
|
||||
@@ -324,7 +310,9 @@ void ledflashlogic(uint32_t ms) {
|
||||
sleepwithinterrupts(ildelay3 * interloopdelayfactor);
|
||||
}
|
||||
if (interrupted) break;
|
||||
flashposition++;
|
||||
}
|
||||
if(interrupted)ledcfg[0] = 0x00;
|
||||
} else
|
||||
sleepwithinterrupts(ms);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FW_VERSION 0x0024 // version number (max 2.5.5 :) )
|
||||
#define FW_VERSION_SUFFIX "SET" // suffix, like RC1 or whatever.
|
||||
#define FW_VERSION 0x0025 // version number (max 2.5.5 :) )
|
||||
#define FW_VERSION_SUFFIX "LED" // suffix, like RC1 or whatever.
|
||||
//#define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1007,13 +1007,14 @@ bool processAvailDataInfo(struct AvailDataInfo *avail) {
|
||||
}
|
||||
case DATATYPE_COMMAND_DATA:
|
||||
memcpy(&xferDataInfo, (void *)avail, sizeof(struct AvailDataInfo));
|
||||
powerUp(INIT_RADIO);
|
||||
sendXferComplete();
|
||||
powerDown(INIT_RADIO);
|
||||
if (avail->dataTypeArgument == 4) {
|
||||
Serial.println("LED CMD");
|
||||
setled(xferDataInfo.dataVer, xferDataInfo.dataSize);
|
||||
} else {
|
||||
}
|
||||
powerUp(INIT_RADIO);
|
||||
sendXferComplete();
|
||||
powerDown(INIT_RADIO);
|
||||
if (avail->dataTypeArgument != 4) {
|
||||
executeCommand(xferDataInfo.dataTypeArgument);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -374,9 +374,9 @@ void init_web() {
|
||||
|
||||
server.on("/led_flash", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||
// color picker: https://roger-random.github.io/RGB332_color_wheel_three.js/
|
||||
// http GET to /led_flash?mac=000000000000&pattern=3/0x1C,4,5/0xE0,3,1/0x4F,5,10/5
|
||||
// http://192.168.178.198/led_flash?mac=00007E1F250CB29C&pattern=1/0x1C,1,15/0xE0,1,15/0x4F,1,15/1
|
||||
// (flashDuration/color1,flashCount1,delay1/color2,flashCount2,delay2/color3,flashCount3,delay3/repeats)
|
||||
// http GET to /led_flash?mac=000000000000&pattern=1,3/0x1C,4,5/0xE0,3,1/0x4F,5,10/5/0,0,0/0
|
||||
// http://192.168.178.198/led_flash?mac=00007E1F250CB29C&pattern=1,1/0x1C,1,15/0xE0,1,15/0x4F,1,15/1/0,0,0/0
|
||||
// (mode,flashDuration/color1,flashCount1,flashSpeed1/color2,flashCount2,flashSpeed2/color3,flashCount3,flashSpeed3/repeats/delay1,delay2,delay3/spare)
|
||||
if (request->hasParam("mac")) {
|
||||
String dst = request->getParam("mac")->value();
|
||||
uint8_t mac[8];
|
||||
@@ -387,30 +387,33 @@ void init_web() {
|
||||
String pattern = request->getParam("pattern")->value();
|
||||
struct ledFlash flashData;
|
||||
|
||||
int values[13];
|
||||
int values[18];
|
||||
int numValues = sscanf(
|
||||
pattern.c_str(),
|
||||
"%i/%i,%i,%i/%i,%i,%i/%i,%i,%i/%i",
|
||||
&values[1], &values[2], &values[3], &values[4], &values[5],
|
||||
&values[6], &values[7], &values[8], &values[9], &values[10], &values[11]);
|
||||
"%i,%i/%i,%i,%i/%i,%i,%i/%i,%i,%i/%i/%i,%i,%i/%i",
|
||||
&values[16], &values[1], &values[2], &values[3], &values[4], &values[5],&values[6], &values[7], &values[8], &values[9], &values[10], &values[11], &values[12], &values[13], &values[14], &values[15]);
|
||||
|
||||
if (numValues != 11) {
|
||||
if (numValues != 16) {
|
||||
request->send(400, "text/plain", "Error: wrong number of inputs in pattern");
|
||||
return;
|
||||
} else {
|
||||
flashData.mode = 0;
|
||||
flashData.mode = values[16] & 0x0F;
|
||||
flashData.flashDuration = values[1] & 0x0F;
|
||||
flashData.color1 = values[2];
|
||||
flashData.flashCount1 = values[3] & 0x0F;
|
||||
flashData.delay1 = values[4] & 0x0F;
|
||||
flashData.flashSpeed1 = values[4] & 0x0F;
|
||||
flashData.color2 = values[5];
|
||||
flashData.flashCount2 = values[6] & 0x0F;
|
||||
flashData.delay2 = values[7] & 0x0F;
|
||||
flashData.flashSpeed2 = values[7] & 0x0F;
|
||||
flashData.color3 = values[8];
|
||||
flashData.flashCount3 = values[9] & 0x0F;
|
||||
flashData.delay3 = values[10] & 0x0F;
|
||||
flashData.flashSpeed3 = values[10] & 0x0F;
|
||||
flashData.repeats = values[11];
|
||||
flashData.spare = 0;
|
||||
flashData.delay1 = values[12];
|
||||
flashData.delay2 = values[13];
|
||||
flashData.delay3 = values[14];
|
||||
flashData.spare = values[15];
|
||||
|
||||
|
||||
const uint8_t *payload = reinterpret_cast<const uint8_t *>(&flashData);
|
||||
sendTagCommand(mac, CMD_DO_LEDFLASH, !taginfo->isExternal, payload);
|
||||
|
||||
BIN
binaries/Tag/Newton_M3_22_BWR-tag-31-0025-ota.bin
Normal file
BIN
binaries/Tag/Newton_M3_22_BWR-tag-31-0025-ota.bin
Normal file
Binary file not shown.
BIN
binaries/Tag/Newton_M3_29_BWR-tag-33-0025-ota.bin
Normal file
BIN
binaries/Tag/Newton_M3_29_BWR-tag-33-0025-ota.bin
Normal file
Binary file not shown.
BIN
binaries/Tag/Newton_M3_43_BWR-tag-34-0025-ota.bin
Normal file
BIN
binaries/Tag/Newton_M3_43_BWR-tag-34-0025-ota.bin
Normal file
Binary file not shown.
BIN
binaries/Tag/Newton_M3_60_BWR-tag-35-0025-ota.bin
Normal file
BIN
binaries/Tag/Newton_M3_60_BWR-tag-35-0025-ota.bin
Normal file
Binary file not shown.
BIN
binaries/Tag/Newton_M3_75_BWR-tag-36-0025-ota.bin
Normal file
BIN
binaries/Tag/Newton_M3_75_BWR-tag-36-0025-ota.bin
Normal file
Binary file not shown.
Reference in New Issue
Block a user