mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 11:06:49 +01:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aff20e272c | ||
|
|
8078b4aeed | ||
|
|
fd22bc0378 | ||
|
|
63463435cd | ||
|
|
3dd4f23880 | ||
|
|
9891d23db1 | ||
|
|
4ed9d2e2e9 | ||
|
|
a60bc91205 | ||
|
|
9f86c9ef2c | ||
|
|
f7078363a4 | ||
|
|
e0fd1e0f86 | ||
|
|
057cf14298 | ||
|
|
51da22b0d4 | ||
|
|
42a3651075 | ||
|
|
56dfd0c2f0 | ||
|
|
716d9823db | ||
|
|
da6d783e3b | ||
|
|
306e5aaf00 | ||
|
|
5376f2540e |
6
.github/workflows/esp32-build-test.yml
vendored
6
.github/workflows/esp32-build-test.yml
vendored
@@ -44,11 +44,11 @@ jobs:
|
||||
pio run --environment OpenEPaperLink_AP_and_Flasher
|
||||
pio run --target buildfs --environment OpenEPaperLink_AP_and_Flasher
|
||||
|
||||
- name: Build Weemos_AP
|
||||
- name: Build Wemos_d1_mini32_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
pio run --environment Weemos_AP
|
||||
pio run --target buildfs --environment Weemos_AP
|
||||
pio run --environment Wemos_d1_mini32_AP
|
||||
pio run --target buildfs --environment Wemos_d1_mini32_AP
|
||||
|
||||
- name: Build M5Stack_Core_ONE_AP
|
||||
run: |
|
||||
|
||||
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
@@ -49,23 +49,23 @@ jobs:
|
||||
cp Simple_AP/firmware.bin espbinaries/Simple_AP.bin
|
||||
cp Simple_AP/merged-firmware.bin espbinaries/Simple_AP_full.bin
|
||||
|
||||
- name: Build firmware for Weemos_AP
|
||||
- name: Build firmware for Wemos_d1_mini32_AP
|
||||
run: |
|
||||
cd ESP32_AP-Flasher
|
||||
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
|
||||
pio run --environment Weemos_AP
|
||||
pio run --target buildfs --environment Weemos_AP
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/Weemos_AP
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Weemos_AP/boot_app0.bin
|
||||
cp .pio/build/Weemos_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Weemos_AP/firmware.bin
|
||||
cp .pio/build/Weemos_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Weemos_AP/bootloader.bin
|
||||
cp .pio/build/Weemos_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Weemos_AP/partitions.bin
|
||||
cp .pio/build/Weemos_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Weemos_AP/littlefs.bin
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/Weemos_AP
|
||||
pio run --environment Wemos_d1_mini32_AP
|
||||
pio run --target buildfs --environment Wemos_d1_mini32_AP
|
||||
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/Wemos_d1_mini32_AP
|
||||
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Wemos_d1_mini32_AP/boot_app0.bin
|
||||
cp .pio/build/Wemos_d1_mini32_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Wemos_d1_mini32_AP/firmware.bin
|
||||
cp .pio/build/Wemos_d1_mini32_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Wemos_d1_mini32_AP/bootloader.bin
|
||||
cp .pio/build/Wemos_d1_mini32_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Wemos_d1_mini32_AP/partitions.bin
|
||||
cp .pio/build/Wemos_d1_mini32_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/Wemos_d1_mini32_AP/littlefs.bin
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/Wemos_d1_mini32_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 0x290000 littlefs.bin
|
||||
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink
|
||||
cp Weemos_AP/firmware.bin espbinaries/Weemos_AP.bin
|
||||
cp Weemos_AP/merged-firmware.bin espbinaries/Weemos_AP_full.bin
|
||||
cp Wemos_d1_mini32_AP/firmware.bin espbinaries/Wemos_d1_mini32_AP.bin
|
||||
cp Wemos_d1_mini32_AP/merged-firmware.bin espbinaries/Wemos_d1_mini32_AP_full.bin
|
||||
|
||||
- name: Build firmware for M5Stack_Core_ONE_AP
|
||||
run: |
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
},
|
||||
"4": {
|
||||
"0": {
|
||||
"location": [ 10, 130, 2 ],
|
||||
"location": [ 10, 145, "t0_14b_tf" ],
|
||||
"wind": [ 140, 10, "fonts/bahnschrift30" ],
|
||||
"temp": [ 10, 10, "fonts/bahnschrift30" ],
|
||||
"icon": [ 33, 33, "fonts/weathericons78" ],
|
||||
@@ -57,7 +57,7 @@
|
||||
},
|
||||
"8": {
|
||||
"1": {
|
||||
"location": [ 5, 0, 2 ],
|
||||
"location": [ 5, 12, "t0_14b_tf" ],
|
||||
"column": [ 5, 59 ],
|
||||
"day": [ 30, 18, "fonts/twcondensed20", 41, 108 ],
|
||||
"icon": [ 12, 58, "fonts/weathericons30" ],
|
||||
@@ -90,7 +90,7 @@
|
||||
},
|
||||
"10": {
|
||||
"0": {
|
||||
"title": [ 10, 3, 2 ],
|
||||
"title": [ 10, 15, "t0_14b_tf" ],
|
||||
"pos": [ 76, 20 ]
|
||||
},
|
||||
"1": {
|
||||
@@ -122,7 +122,7 @@
|
||||
"1": {
|
||||
"location": [ 5, 5, "fonts/bahnschrift30" ],
|
||||
"title": [ 247, 11, "glasstown_nbp_tf" ],
|
||||
"cols": [ 1, 125, 12 ],
|
||||
"cols": [ 1, 125, 12, "glasstown_nbp_tf" ],
|
||||
"bars": [ 5, 111, 10 ]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,11 +43,13 @@
|
||||
<option value="0">auto</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<p class="tagbuttons">
|
||||
<button id="cfgrefresh">force refresh</button>
|
||||
<button id="cfgclrpending">clear pending</button>
|
||||
<button id="cfgdelete"><img src="data:image/gif;base64,R0lGODlhEAAQAPMAANXV1e3t7d/f39HR0dvb2/Hx8dTU1OLi4urq6mZmZpmZmf///wAAAAAAAAAAAAAAACH5BAEAAAwALAAAAAAQABAAAARBkMlJq71Yrp3ZXkr4WWCYnOZSgQVyEMYwJCq1nHhe20qgCAoA7QLyAYU7njE4JPV+zOSkCEUSFbmTVPPpbjvgTAQAOw==
|
||||
"></button>
|
||||
<button id="cfgtagreboot">reboot</button>
|
||||
<button id="cfgscan">scan</button>
|
||||
<button id="cfgreset">reset settings</button>
|
||||
<button id="cfgdelete" title="remove"><img src="data:image/gif;base64,R0lGODlhEAAQAPMAANXV1e3t7d/f39HR0dvb2/Hx8dTU1OLi4urq6mZmZpmZmf///wAAAAAAAAAAAAAAACH5BAEAAAwALAAAAAAQABAAAARBkMlJq71Yrp3ZXkr4WWCYnOZSgQVyEMYwJCq1nHhe20qgCAoA7QLyAYU7njE4JPV+zOSkCEUSFbmTVPPpbjvgTAQAOw== "></button>
|
||||
</p>
|
||||
</div>
|
||||
<p id="savebar">
|
||||
@@ -157,6 +159,7 @@ Latency will be around 40 seconds.">
|
||||
<div class="actionbox">
|
||||
<div>
|
||||
<div>Currently active tags:</div>
|
||||
<div><span id="temp"></div>
|
||||
<div><span id="runstate"></div>
|
||||
<div><span id="apstatecolor">⬤</span> <span id="apstate">loading</span></div>
|
||||
<div><span id="apconfigbutton">AP config</span></div>
|
||||
@@ -171,9 +174,7 @@ Latency will be around 40 seconds.">
|
||||
<div class="alias"></div>
|
||||
<div class="model"></div>
|
||||
|
||||
<div class="received">
|
||||
RSSI <div class="rssi"></div>, LQI <div class="lqi"></div><div class="temperature"></div><div class="batt"></div>
|
||||
</div>
|
||||
<div class="received"></div>
|
||||
|
||||
<div class="contentmode"></div>
|
||||
<div class="lastseen"></div>
|
||||
|
||||
@@ -120,6 +120,8 @@ select {
|
||||
background-color: #f0e6d3;
|
||||
z-index: 999;
|
||||
box-shadow: 7px 10px 52px -19px rgba(0, 0, 0, 0.63);
|
||||
overflow: auto;
|
||||
max-height: calc(100vh - 75px);
|
||||
}
|
||||
|
||||
#configbox p, #apconfigbox p, #apupdatebox p {
|
||||
@@ -152,6 +154,15 @@ select {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.tagbuttons {
|
||||
flex-flow: wrap;
|
||||
}
|
||||
|
||||
.tagbuttons button {
|
||||
font-size: 0.95em;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
#savebar {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
@@ -482,6 +493,11 @@ ul.messages li.new {
|
||||
background-color: #ffffff;
|
||||
padding: 1px 5px;
|
||||
min-width: 70px;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
#releasetable td:nth-child(2) {
|
||||
word-wrap: nowrap;
|
||||
}
|
||||
|
||||
#releasetable button {
|
||||
|
||||
@@ -94,11 +94,12 @@ function connect() {
|
||||
processTags(msg.tags);
|
||||
}
|
||||
if (msg.sys) {
|
||||
$('#sysinfo').innerHTML = 'free heap: ' + msg.sys.heap + ' bytes ┇ db size: ' + msg.sys.dbsize + ' bytes ┇ db record count: ' + msg.sys.recordcount + ' ┇ active filesystem free: ' + msg.sys.littlefsfree + ' bytes ' + convertSize(msg.sys.littlefsfree);
|
||||
$('#sysinfo').innerHTML = 'free heap: ' + msg.sys.heap + ' bytes ┇ db size: ' + convertSize(msg.sys.dbsize) + " ("+ msg.sys.dbsize + ' bytes) ┇ db record count: ' + msg.sys.recordcount + ' ┇ filesystem free: ' + convertSize(msg.sys.littlefsfree);
|
||||
if (msg.sys.apstate) {
|
||||
$("#apstatecolor").style.color = apstate[msg.sys.apstate].color;
|
||||
$("#apstate").innerHTML = apstate[msg.sys.apstate].state;
|
||||
$("#runstate").innerHTML = runstate[msg.sys.runstate].state;
|
||||
$("#temp").innerHTML = msg.sys.temp.toFixed(1) + '°C';
|
||||
}
|
||||
servertimediff = (Date.now() / 1000) - msg.sys.currtime;
|
||||
}
|
||||
@@ -127,17 +128,15 @@ function connect() {
|
||||
});
|
||||
}
|
||||
|
||||
// Copied from
|
||||
// https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript
|
||||
function convertSize(bytes){
|
||||
function convertSize(bytes) {
|
||||
if (bytes >= 1073741824) { bytes = (bytes / 1073741824).toFixed(2) + " GB"; }
|
||||
else if (bytes >= 1048576) { bytes = (bytes / 1048576).toFixed(2) + " MB"; }
|
||||
else if (bytes >= 1024) { bytes = (bytes / 1024).toFixed(2) + " KB"; }
|
||||
else if (bytes >= 1024) { bytes = (bytes / 1024).toFixed(2) + " kB"; }
|
||||
else if (bytes > 1) { bytes = bytes + " bytes"; }
|
||||
else if (bytes == 1) { bytes = bytes + " byte"; }
|
||||
else { bytes = "0 bytes"; }
|
||||
return "(" + bytes + ")";
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
function processTags(tagArray) {
|
||||
for (const element of tagArray) {
|
||||
@@ -177,14 +176,22 @@ function processTags(tagArray) {
|
||||
if (element.RSSI) {
|
||||
div.dataset.hwtype = element.hwType;
|
||||
$('#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 > 0 ? ", " + element.temperature + "°C": "");
|
||||
if (element.batteryMv == 0 || element.batteryMv == 1337) {
|
||||
$('#tag' + tagmac + ' .batt').innerHTML = "";
|
||||
let statusline = "";
|
||||
if (element.RSSI != 100) {
|
||||
if (element.ch > 0) statusline += `CH ${element.ch}, `;
|
||||
statusline += `RSSI ${element.RSSI}, LQI ${element.LQI}`;
|
||||
} else {
|
||||
$('#tag' + tagmac + ' .batt').innerHTML = ", " + (element.batteryMv >= 2600 ? "≥" : "") + (element.batteryMv / 1000) + "V";
|
||||
statusline = "AP";
|
||||
}
|
||||
if (element.batteryMv != 0 && element.batteryMv != 1337) {
|
||||
statusline += ", " + (element.batteryMv >= 2600 ? "≥" : "") + (element.batteryMv / 1000) + "V";
|
||||
}
|
||||
if (element.ver != 0 && element.ver != 1) {
|
||||
$('#tag' + tagmac + ' .received').title = `fw: ${element.ver}`;
|
||||
} else {
|
||||
$('#tag' + tagmac + ' .received').title = "";
|
||||
}
|
||||
$('#tag' + tagmac + ' .received').innerHTML = statusline;
|
||||
$('#tag' + tagmac + ' .received').style.opacity = "1";
|
||||
} else {
|
||||
$('#tag' + tagmac + ' .model').innerHTML = "waiting for hardware type";
|
||||
@@ -410,6 +417,18 @@ $('#cfgrefresh').onclick = function () {
|
||||
sendCmd($('#cfgmac').dataset.mac, "refresh");
|
||||
}
|
||||
|
||||
$('#cfgtagreboot').onclick = function () {
|
||||
sendCmd($('#cfgmac').dataset.mac, "reboot");
|
||||
}
|
||||
|
||||
$('#cfgscan').onclick = function () {
|
||||
sendCmd($('#cfgmac').dataset.mac, "scan");
|
||||
}
|
||||
|
||||
$('#cfgreset').onclick = function () {
|
||||
sendCmd($('#cfgmac').dataset.mac, "reset");
|
||||
}
|
||||
|
||||
$('#rebootbutton').onclick = function () {
|
||||
showMessage("rebooting AP....", true);
|
||||
fetch("/reboot", {
|
||||
|
||||
@@ -95,13 +95,13 @@ export async function initUpdate() {
|
||||
|
||||
const table = document.createElement('table');
|
||||
const tableHeader = document.createElement('tr');
|
||||
tableHeader.innerHTML = '<th>Release</th><th>Date</th><th>Name</th><th>Author</th><th colspan="2">Update:</th><th>Remark</th>';
|
||||
tableHeader.innerHTML = '<th>Release</th><th>Date</th><th>Name</th><th colspan="2">Update:</th><th>Remark</th>';
|
||||
table.appendChild(tableHeader);
|
||||
|
||||
releaseDetails.forEach(release => {
|
||||
if (release && release.html_url) {
|
||||
const tableRow = document.createElement('tr');
|
||||
let tablerow = `<td><a href="${release.html_url}" target="_new">${release.tag_name}</a></td><td>${release.date}</td><td>${release.name}</td><td>${release.author}</td><td><button onclick="otamodule.updateESP('${release.file_url}', true)">ESP32</button></td><td><button onclick="otamodule.updateWebpage('${release.file_url}','${release.tag_name}', true)">Filesystem</button></td>`;
|
||||
let tablerow = `<td><a href="${release.html_url}" target="_new">${release.tag_name}</a></td><td>${release.date}</td><td>${release.name}</td><td><button onclick="otamodule.updateESP('${release.file_url}', true)">ESP32</button></td><td><button onclick="otamodule.updateWebpage('${release.file_url}','${release.tag_name}', true)">Filesystem</button></td>`;
|
||||
if (release.tag_name == currentVer) {
|
||||
tablerow += "<td>current version</td>";
|
||||
} else if (release.date < formatEpoch(currentBuildtime)) {
|
||||
@@ -245,46 +245,68 @@ export async function updateESP(fileUrl, showConfirm) {
|
||||
|
||||
let binurl, binmd5, binsize;
|
||||
|
||||
try {
|
||||
const response = await fetch("/getexturl?url=" + fileUrl);
|
||||
const data = await response.json();
|
||||
const file = data.binaries.find((entry) => entry.name == env + '.bin');
|
||||
if (file) {
|
||||
binurl = file.url;
|
||||
binmd5 = file.md5;
|
||||
binsize = file.size;
|
||||
console.log(`URL for "${file.name}": ${binurl}`);
|
||||
let retryCount = 0;
|
||||
const maxRetries = 5;
|
||||
|
||||
try {
|
||||
const response = await fetch('/update_ota', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body: new URLSearchParams({
|
||||
url: binurl,
|
||||
md5: binmd5,
|
||||
size: binsize
|
||||
})
|
||||
});
|
||||
while (retryCount < maxRetries) {
|
||||
try {
|
||||
const response = await fetch("/getexturl?url=" + fileUrl);
|
||||
|
||||
if (response.ok) {
|
||||
const result = await response.text();
|
||||
print('OTA update initiated.');
|
||||
} else {
|
||||
print('Failed to initiate OTA update: ' + response.status, "red");
|
||||
}
|
||||
} catch (error) {
|
||||
print('Error during OTA update: ' + error, "red");
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not OK");
|
||||
}
|
||||
} else {
|
||||
print(`File "${fileName}" not found.`, "red");
|
||||
|
||||
const responseBody = await response.text();
|
||||
if (responseBody.trim()[0] !== "{") {
|
||||
throw new Error("Failed to fetch the release info file");
|
||||
}
|
||||
const data = JSON.parse(responseBody);
|
||||
|
||||
const file = data.binaries?.find((entry) => entry.name == env + '.bin');
|
||||
if (file) {
|
||||
binurl = file.url;
|
||||
binmd5 = file.md5;
|
||||
binsize = file.size;
|
||||
console.log(`URL for "${file.name}": ${binurl}`);
|
||||
|
||||
try {
|
||||
const response = await fetch('/update_ota', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body: new URLSearchParams({
|
||||
url: binurl,
|
||||
md5: binmd5,
|
||||
size: binsize
|
||||
})
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const result = await response.text();
|
||||
print('OTA update initiated.');
|
||||
} else {
|
||||
print('Failed to initiate OTA update: ' + response.status, "red");
|
||||
}
|
||||
} catch (error) {
|
||||
print('Error during OTA update: ' + error, "red");
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
print(`No info about "${env}" found in the release.`, "red");
|
||||
}
|
||||
} catch (error) {
|
||||
print('Error: ' + error.message, "yellow");
|
||||
retryCount++;
|
||||
print(`Retrying... attempt ${retryCount}`);
|
||||
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||
}
|
||||
} catch (error) {
|
||||
print('Error: ' + error, "red");
|
||||
print("Something went wrong, try again.");
|
||||
}
|
||||
|
||||
if (retryCount === maxRetries) {
|
||||
print("Reached maximum retry count. Failed to execute the update.", "red");
|
||||
}
|
||||
|
||||
running = false;
|
||||
disableButtons(false);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,10 @@ struct AvailDataReq {
|
||||
uint8_t hwType;
|
||||
uint8_t wakeupReason;
|
||||
uint8_t capabilities;
|
||||
uint16_t tagSoftwareVersion;
|
||||
uint8_t currentChannel;
|
||||
uint8_t customMode;
|
||||
uint8_t reserved[8];
|
||||
} __packed;
|
||||
|
||||
struct espAvailDataReq {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
class tagRecord {
|
||||
public:
|
||||
tagRecord() : mac{0}, alias(""), lastseen(0), nextupdate(0), contentMode(0), pending(false), md5{0}, md5pending{0}, expectedNextCheckin(0), modeConfigJson(""), LQI(0), RSSI(0), temperature(0), batteryMv(0), hwType(0), wakeupReason(0), capabilities(0), lastfullupdate(0), isExternal(false), pendingIdle(0), hasCustomLUT(false), rotate(0), lut(0),
|
||||
tagRecord() : mac{0}, alias(""), lastseen(0), nextupdate(0), contentMode(0), pending(false), md5{0}, md5pending{0}, expectedNextCheckin(0), modeConfigJson(""), LQI(0), RSSI(0), temperature(0), batteryMv(0), hwType(0), wakeupReason(0), capabilities(0), lastfullupdate(0), isExternal(false), pendingIdle(0), hasCustomLUT(false), rotate(0), lut(0), tagSoftwareVersion(0), currentChannel(0),
|
||||
dataType(0), filename(""), data(nullptr), len(0) {}
|
||||
|
||||
uint8_t mac[8];
|
||||
@@ -44,6 +44,8 @@ class tagRecord {
|
||||
bool hasCustomLUT;
|
||||
uint8_t rotate;
|
||||
uint8_t lut;
|
||||
uint16_t tagSoftwareVersion;
|
||||
uint8_t currentChannel;
|
||||
|
||||
uint8_t dataType;
|
||||
String filename;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
class ZBS_interface
|
||||
{
|
||||
public:
|
||||
uint8_t begin(uint8_t SS, uint8_t CLK, uint8_t MOSI, uint8_t MISO, uint8_t RESET, uint8_t* POWER = nullptr, uint8_t powerPins = 1, uint32_t spi_speed = 8000000);
|
||||
uint8_t begin(uint8_t SS, uint8_t CLK, uint8_t MOSI, uint8_t MISO, uint8_t RESET, uint8_t* POWER, uint8_t powerPins, uint32_t spi_speed = 8000000);
|
||||
void setSpeed(uint32_t speed);
|
||||
void set_power(uint8_t state);
|
||||
void enable_debug();
|
||||
|
||||
@@ -27,6 +27,13 @@ board_build.filesystem = littlefs
|
||||
monitor_filters = esp32_exception_decoder
|
||||
monitor_speed = 115200
|
||||
board_build.f_cpu = 240000000L
|
||||
build_flags =
|
||||
-D BUILD_ENV_NAME=$PIOENV
|
||||
-D BUILD_TIME=$UNIX_TIME
|
||||
-D USER_SETUP_LOADED
|
||||
-D DISABLE_ALL_LIBRARY_WARNINGS
|
||||
-D ILI9341_DRIVER
|
||||
-D SMOOTH_FONT
|
||||
|
||||
; ----------------------------------------------------------------------------------------
|
||||
; !!! this configuration expects the Mini_AP
|
||||
@@ -39,8 +46,7 @@ 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
|
||||
${env.build_flags}
|
||||
-D OPENEPAPERLINK_MINI_AP_PCB
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D CONFIG_SPIRAM_USE_MALLOC=1
|
||||
@@ -59,11 +65,6 @@ build_flags =
|
||||
-D FLASHER_AP_TEST=12
|
||||
-D FLASHER_LED=15
|
||||
-D FLASHER_RGB_LED=33
|
||||
-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
|
||||
@@ -82,8 +83,7 @@ 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
|
||||
${env.build_flags}
|
||||
-D OPENEPAPERLINK_NANO_AP_PCB
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D CONFIG_SPIRAM_USE_MALLOC=1
|
||||
@@ -100,11 +100,6 @@ build_flags =
|
||||
-D FLASHER_AP_TEST=36
|
||||
-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
|
||||
@@ -124,8 +119,7 @@ build_unflags =
|
||||
-D ARDUINO_USB_MODE=1
|
||||
-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
|
||||
build_flags =
|
||||
-D BUILD_ENV_NAME=$PIOENV
|
||||
-D BUILD_TIME=$UNIX_TIME
|
||||
${env.build_flags}
|
||||
-D OPENEPAPERLINK_PCB
|
||||
-D ARDUINO_USB_MODE=0
|
||||
-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
|
||||
@@ -165,11 +159,6 @@ build_flags =
|
||||
-D FLASHER_ALT_TEST=13
|
||||
-D FLASHER_LED=21
|
||||
-D FLASHER_RGB_LED=48
|
||||
-D USER_SETUP_LOADED
|
||||
-D DISABLE_ALL_LIBRARY_WARNINGS
|
||||
-D ILI9341_DRIVER
|
||||
-D SMOOTH_FONT
|
||||
-D LOAD_FONT2
|
||||
board_build.flash_mode=qio
|
||||
board_build.arduino.memory_type = qio_opi
|
||||
board_build.psram_type=qspi_opi
|
||||
@@ -185,8 +174,7 @@ board_upload.flash_size = 16MB
|
||||
board = esp32dev
|
||||
board_build.partitions = default.csv
|
||||
build_flags =
|
||||
-D BUILD_ENV_NAME=$PIOENV
|
||||
-D BUILD_TIME=$UNIX_TIME
|
||||
${env.build_flags}
|
||||
-D CORE_DEBUG_LEVEL=0
|
||||
-D SIMPLE_AP
|
||||
-D FLASHER_AP_SS=5
|
||||
@@ -199,11 +187,6 @@ build_flags =
|
||||
-D FLASHER_AP_TXD=17
|
||||
-D FLASHER_AP_RXD=16
|
||||
-D FLASHER_LED=22
|
||||
-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>
|
||||
|
||||
@@ -211,13 +194,15 @@ build_src_filter =
|
||||
; !!! this configuration expects an wemos_d1_mini32
|
||||
;
|
||||
; ----------------------------------------------------------------------------------------
|
||||
[env:Weemos_AP]
|
||||
[env:Wemos_d1_mini32_AP]
|
||||
board = wemos_d1_mini32
|
||||
board_build.partitions = default.csv
|
||||
build_flags =
|
||||
-D BUILD_ENV_NAME=$PIOENV
|
||||
-D BUILD_TIME=$UNIX_TIME
|
||||
${env.build_flags}
|
||||
-D CORE_DEBUG_LEVEL=0
|
||||
|
||||
-D POWER_NO_SOFT_POWER
|
||||
|
||||
-D FLASHER_AP_SS=5
|
||||
-D FLASHER_AP_CLK=18
|
||||
-D FLASHER_AP_MOSI=23
|
||||
@@ -228,11 +213,6 @@ build_flags =
|
||||
-D FLASHER_AP_TXD=16
|
||||
-D FLASHER_AP_RXD=17
|
||||
-D FLASHER_LED=22
|
||||
-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>
|
||||
|
||||
@@ -245,9 +225,10 @@ platform = espressif32
|
||||
board = m5stack-core-esp32
|
||||
board_build.partitions = esp32_sdcard.csv
|
||||
build_flags =
|
||||
-D BUILD_ENV_NAME=$PIOENV
|
||||
-D BUILD_TIME=$UNIX_TIME
|
||||
${env.build_flags}
|
||||
-D CORE_DEBUG_LEVEL=0
|
||||
|
||||
-D POWER_NO_SOFT_POWER
|
||||
-D HAS_SDCARD
|
||||
-D USE_SOFTSPI
|
||||
-D SD_CARD_SS=4
|
||||
@@ -269,6 +250,5 @@ build_flags =
|
||||
-D DISABLE_ALL_LIBRARY_WARNINGS
|
||||
-D ILI9341_DRIVER
|
||||
-D SMOOTH_FONT
|
||||
-D LOAD_FONT2
|
||||
build_src_filter =
|
||||
+<*>-<usbflasher.cpp>-<serialconsole.cpp>
|
||||
|
||||
19
ESP32_AP-Flasher/push_ota.sh
Executable file
19
ESP32_AP-Flasher/push_ota.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
source updateRemote.sh > /dev/null
|
||||
|
||||
if [ -z "$IP" ]
|
||||
then
|
||||
echo "ERROR: Empty IP variable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$PIOENV" ]
|
||||
then
|
||||
echo "ERROR: Empty PIOENV variable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
md5sum .pio/build/$PIOENV/firmware.bin | tee .pio/build/$PIOENV/firmware.md5
|
||||
upload_file .pio/build/$PIOENV/firmware.md5:ota_md5.txt
|
||||
upload_file .pio/build/$PIOENV/firmware.bin:ota.bin
|
||||
@@ -293,7 +293,8 @@ void drawNew(uint8_t mac[8], bool buttonPressed, tagRecord *&taginfo) {
|
||||
taginfo->nextupdate = 3216153600;
|
||||
taginfo->contentMode = Image;
|
||||
break;
|
||||
case 18:
|
||||
|
||||
case 18: // tag config
|
||||
prepareConfigFile(mac, cfgobj);
|
||||
cfgobj["filename"] = "";
|
||||
taginfo->nextupdate = 3216153600;
|
||||
@@ -318,10 +319,14 @@ void drawString(TFT_eSprite &spr, String content, uint16_t posx, uint16_t posy,
|
||||
// drawString(spr,"test",100,10,"bahnschrift30",TC_DATUM,PAL_RED);
|
||||
spr.setTextDatum(align);
|
||||
|
||||
if (font == "2") {
|
||||
spr.setTextFont(2);
|
||||
spr.setTextColor(PAL_BLACK, PAL_WHITE);
|
||||
spr.drawString(content, posx, posy);
|
||||
if (font != "" && !font.startsWith("fonts/")) {
|
||||
U8g2_for_TFT_eSPI u8f;
|
||||
u8f.begin(spr);
|
||||
setU8G2Font(font, u8f);
|
||||
u8f.setForegroundColor(color);
|
||||
u8f.setBackgroundColor(PAL_WHITE);
|
||||
u8f.setCursor(posx, posy);
|
||||
u8f.print(content);
|
||||
} else {
|
||||
if (font != "") spr.loadFont(font, *contentFS);
|
||||
spr.setTextColor(color, PAL_WHITE);
|
||||
@@ -601,7 +606,9 @@ void drawForecast(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, img
|
||||
|
||||
if (loc["rain"]) {
|
||||
int8_t rain = round(doc["daily"]["precipitation_sum"][dag].as<double>());
|
||||
drawString(spr, String(rain) + "mm", dag * loc["column"][1].as<int>() + loc["rain"][0].as<int>(), loc["rain"][1], "", TC_DATUM, (rain > 10 ? PAL_RED : PAL_BLACK));
|
||||
if (rain > 0) {
|
||||
drawString(spr, String(rain) + "mm", dag * loc["column"][1].as<int>() + loc["rain"][0].as<int>(), loc["rain"][1], "", TC_DATUM, (rain > 10 ? PAL_RED : PAL_BLACK));
|
||||
}
|
||||
}
|
||||
|
||||
drawString(spr, String(tmin) + " ", dag * loc["column"][1].as<int>() + loc["day"][0].as<int>(), loc["day"][4], "", TR_DATUM, (tmin < 0 ? PAL_RED : PAL_BLACK));
|
||||
@@ -887,10 +894,7 @@ void drawBuienradar(String &filename, JsonObject &cfgobj, tagRecord *&taginfo, i
|
||||
spr.fillRect(i * loc["cols"][2].as<int>() + loc["bars"][0].as<int>(), loc["bars"][1].as<int>() - (value - 60), loc["bars"][2], (value - 60), (value > 130 ? PAL_RED : PAL_BLACK));
|
||||
|
||||
if (minutes % 15 == 0) {
|
||||
spr.setTextFont(2);
|
||||
spr.setTextColor(PAL_BLACK, PAL_WHITE);
|
||||
u8f.setCursor(i * loc["cols"][2].as<int>() + loc["cols"][0].as<int>(), loc["cols"][1]);
|
||||
u8f.print(timestring);
|
||||
drawString(spr, timestring, i * loc["cols"][2].as<int>() + loc["cols"][0].as<int>(), loc["cols"][1], loc["cols"][3]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,22 +117,33 @@ flasher::~flasher() {
|
||||
Storage.begin();
|
||||
}
|
||||
|
||||
static uint8_t validatePowerPinCount(int8_t *powerPin, uint8_t pinCount) {
|
||||
if (pinCount > 0) {
|
||||
pinCount = powerPinsAP[0] != -1 ? pinCount : 0;
|
||||
}
|
||||
return pinCount;
|
||||
}
|
||||
|
||||
#ifndef FLASHER_AP_SPEED
|
||||
#define FLASHER_AP_SPEED 4000000
|
||||
#endif
|
||||
|
||||
bool flasher::connectTag(uint8_t port) {
|
||||
bool result;
|
||||
uint8_t power_pins = 0;
|
||||
switch (port) {
|
||||
case 0:
|
||||
result = zbs->begin(FLASHER_AP_SS, FLASHER_AP_CLK, FLASHER_AP_MOSI, FLASHER_AP_MISO, FLASHER_AP_RESET, (uint8_t *)powerPinsAP, sizeof(powerPinsAP), FLASHER_AP_SPEED);
|
||||
power_pins = validatePowerPinCount(powerPinsAP, sizeof(powerPinsAP));
|
||||
result = zbs->begin(FLASHER_AP_SS, FLASHER_AP_CLK, FLASHER_AP_MOSI, FLASHER_AP_MISO, FLASHER_AP_RESET, (uint8_t *)powerPinsAP, power_pins, FLASHER_AP_SPEED);
|
||||
break;
|
||||
#ifdef OPENEPAPERLINK_PCB
|
||||
case 1:
|
||||
result = zbs->begin(FLASHER_EXT_SS, FLASHER_EXT_CLK, FLASHER_EXT_MOSI, FLASHER_EXT_MISO, FLASHER_EXT_RESET, (uint8_t *)powerPinsExt, sizeof(powerPinsExt), FLASHER_AP_SPEED);
|
||||
power_pins = validatePowerPinCount(powerPinsExt, sizeof(powerPinsExt));
|
||||
result = zbs->begin(FLASHER_EXT_SS, FLASHER_EXT_CLK, FLASHER_EXT_MOSI, FLASHER_EXT_MISO, FLASHER_EXT_RESET, (uint8_t *)powerPinsExt, power_pins, FLASHER_AP_SPEED);
|
||||
break;
|
||||
case 2:
|
||||
result = zbs->begin(FLASHER_ALT_SS, FLASHER_ALT_CLK, FLASHER_ALT_MOSI, FLASHER_ALT_MISO, FLASHER_ALT_RESET, (uint8_t *)powerPinsAlt, sizeof(powerPinsAlt), FLASHER_AP_SPEED);
|
||||
power_pins = validatePowerPinCount(powerPinsAlt, sizeof(powerPinsAlt));
|
||||
result = zbs->begin(FLASHER_ALT_SS, FLASHER_ALT_CLK, FLASHER_ALT_MOSI, FLASHER_ALT_MISO, FLASHER_ALT_RESET, (uint8_t *)powerPinsAlt, power_pins, FLASHER_AP_SPEED);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
||||
@@ -498,6 +498,8 @@ void processDataReq(struct espAvailDataReq* eadr, bool local) {
|
||||
taginfo->hwType = eadr->adr.hwType;
|
||||
taginfo->wakeupReason = eadr->adr.wakeupReason;
|
||||
taginfo->capabilities = eadr->adr.capabilities;
|
||||
taginfo->currentChannel = eadr->adr.currentChannel;
|
||||
taginfo->tagSoftwareVersion = eadr->adr.tagSoftwareVersion;
|
||||
}
|
||||
if (local) {
|
||||
sprintf(buffer, "<ADR %02X%02X%02X%02X%02X%02X%02X%02X\n\0", eadr->src[7], eadr->src[6], eadr->src[5], eadr->src[4], eadr->src[3], eadr->src[2], eadr->src[1], eadr->src[0]);
|
||||
@@ -594,7 +596,7 @@ bool showAPSegmentedInfo(uint8_t* dst, bool local) {
|
||||
bool sendTagCommand(uint8_t* dst, uint8_t cmd, bool local) {
|
||||
struct pendingData pending = {0};
|
||||
memcpy(pending.targetMac, dst, 8);
|
||||
pending.availdatainfo.dataType = 0xAF;
|
||||
pending.availdatainfo.dataType = DATATYPE_COMMAND_DATA;
|
||||
pending.availdatainfo.dataTypeArgument = cmd;
|
||||
pending.availdatainfo.nextCheckIn = 0;
|
||||
pending.attemptsLeft = 120;
|
||||
|
||||
@@ -75,7 +75,8 @@ void rampTagPower(uint8_t* pin, bool up) {
|
||||
}
|
||||
|
||||
void powerControl(bool powerState, uint8_t* pin, uint8_t pincount) {
|
||||
if (pin[0] == -1) return;
|
||||
if (pincount == 0) return;
|
||||
if (pin == nullptr) return;
|
||||
|
||||
#ifdef POWER_RAMPING
|
||||
if (powerState == true) {
|
||||
|
||||
@@ -134,12 +134,15 @@ void APEnterEarlyReset() {
|
||||
|
||||
// Reset the tag
|
||||
void APTagReset() {
|
||||
uint8_t powerPins = sizeof(APpowerPins);
|
||||
if (powerPins > 0 && APpowerPins[0] == -1)
|
||||
powerPins = 0;
|
||||
pinMode(AP_RESET_PIN, OUTPUT);
|
||||
digitalWrite(AP_RESET_PIN, LOW);
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
powerControl(false, (uint8_t*)APpowerPins, sizeof(APpowerPins));
|
||||
powerControl(false, (uint8_t*)APpowerPins, powerPins);
|
||||
vTaskDelay(300 / portTICK_PERIOD_MS);
|
||||
powerControl(true, (uint8_t*)APpowerPins, sizeof(APpowerPins));
|
||||
powerControl(true, (uint8_t*)APpowerPins, powerPins);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
digitalWrite(AP_RESET_PIN, HIGH);
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -63,7 +63,7 @@ bool hex2mac(const String& hexString, uint8_t* mac) {
|
||||
}
|
||||
|
||||
String tagDBtoJson(uint8_t mac[8], uint8_t startPos) {
|
||||
DynamicJsonDocument doc(2500);
|
||||
DynamicJsonDocument doc(5000);
|
||||
JsonArray tags = doc.createNestedArray("tags");
|
||||
|
||||
for (int16_t c = startPos; c < tagDB.size(); c++) {
|
||||
@@ -85,7 +85,7 @@ String tagDBtoJson(uint8_t mac[8], uint8_t startPos) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (doc.capacity()-doc.memoryUsage() < doc.memoryUsage()/(c+1) + 100) {
|
||||
if (doc.capacity() - doc.memoryUsage() < doc.memoryUsage()/(c+1) + 150) {
|
||||
doc["continu"] = c+1;
|
||||
break;
|
||||
}
|
||||
@@ -119,6 +119,8 @@ void fillNode(JsonObject &tag, tagRecord* &taginfo) {
|
||||
tag["isexternal"] = taginfo->isExternal;
|
||||
tag["rotate"] = taginfo->rotate;
|
||||
tag["lut"] = taginfo->lut;
|
||||
tag["ch"] = taginfo->currentChannel;
|
||||
tag["ver"] = taginfo->tagSoftwareVersion;
|
||||
}
|
||||
|
||||
void saveDB(String filename) {
|
||||
@@ -214,6 +216,8 @@ void loadDB(String filename) {
|
||||
taginfo->isExternal = tag["isexternal"].as<bool>();
|
||||
taginfo->rotate = tag["rotate"] | 0;
|
||||
taginfo->lut = tag["lut"] | 0;
|
||||
taginfo->currentChannel = tag["ch"] | 0;
|
||||
taginfo->tagSoftwareVersion = tag["ver"] | 0;
|
||||
}
|
||||
} else {
|
||||
Serial.print(F("deserializeJson() failed: "));
|
||||
|
||||
@@ -46,23 +46,31 @@ void UDPcomm::processPacket(AsyncUDPPacket packet) {
|
||||
|
||||
switch (packet.data()[0]) {
|
||||
case PKT_AVAIL_DATA_INFO: {
|
||||
espAvailDataReq* adr = (espAvailDataReq*)&packet.data()[1];
|
||||
processDataReq(adr, false);
|
||||
espAvailDataReq adr;
|
||||
memset(&adr, 0, sizeof(espAvailDataReq));
|
||||
memcpy(&adr, &packet.data()[1], std::min(packet.length() - 1, sizeof(espAvailDataReq)));
|
||||
processDataReq(&adr, false);
|
||||
break;
|
||||
}
|
||||
case PKT_XFER_COMPLETE: {
|
||||
espXferComplete* xfc = (espXferComplete*)&packet.data()[1];
|
||||
processXferComplete(xfc, false);
|
||||
espXferComplete xfc;
|
||||
memset(&xfc, 0, sizeof(espXferComplete));
|
||||
memcpy(&xfc, &packet.data()[1], std::min(packet.length() - 1, sizeof(espXferComplete)));
|
||||
processXferComplete(&xfc, false);
|
||||
break;
|
||||
}
|
||||
case PKT_XFER_TIMEOUT: {
|
||||
espXferComplete* xfc = (espXferComplete*)&packet.data()[1];
|
||||
processXferTimeout(xfc, false);
|
||||
espXferComplete xfc;
|
||||
memset(&xfc, 0, sizeof(espXferComplete));
|
||||
memcpy(&xfc, &packet.data()[1], std::min(packet.length() - 1, sizeof(espXferComplete)));
|
||||
processXferTimeout(&xfc, false);
|
||||
break;
|
||||
}
|
||||
case PKT_AVAIL_DATA_REQ: {
|
||||
pendingData* pending = (pendingData*)&packet.data()[1];
|
||||
prepareExternalDataAvail(pending, packet.remoteIP());
|
||||
pendingData pending;
|
||||
memset(&pending, 0, sizeof(pendingData));
|
||||
memcpy(&pending, &packet.data()[1], std::min(packet.length() - 1, sizeof(pendingData)));
|
||||
prepareExternalDataAvail(&pending, packet.remoteIP());
|
||||
break;
|
||||
}
|
||||
case PKT_APLIST_REQ: {
|
||||
@@ -82,18 +90,20 @@ void UDPcomm::processPacket(AsyncUDPPacket packet) {
|
||||
break;
|
||||
}
|
||||
case PKT_APLIST_REPLY: {
|
||||
APlist* APreply = (APlist*)&packet.data()[1];
|
||||
//remove active channel from list
|
||||
APlist APreply;
|
||||
memset(&APreply, 0, sizeof(APlist));
|
||||
memcpy(&APreply, &packet.data()[1], std::min(packet.length() - 1, sizeof(APlist)));
|
||||
// remove active channel from list
|
||||
for (int i = 0; i < 6; i++) {
|
||||
if (channelList[i] == APreply->channelId) channelList[i] = 0;
|
||||
if (channelList[i] == APreply.channelId) channelList[i] = 0;
|
||||
}
|
||||
wsSendAPitem(APreply);
|
||||
wsSendAPitem(&APreply);
|
||||
break;
|
||||
}
|
||||
case PKT_TAGINFO: {
|
||||
uint16_t syncversion = (packet.data()[2] << 8) | packet.data()[1];
|
||||
if (syncversion != SYNC_VERSION) {
|
||||
Serial.println("Got a packet from " + packet.remoteIP().toString() + " with mismatched udp sync version. Update firmware!");
|
||||
wsErr("Got a packet from " + packet.remoteIP().toString() + " with mismatched udp sync version. Update firmware!");
|
||||
} else {
|
||||
TagInfo* taginfoitem = (TagInfo*)&packet.data()[1];
|
||||
updateTaginfoitem(taginfoitem);
|
||||
|
||||
@@ -239,6 +239,7 @@ void processFlasherCommand(struct flasherCommand* cmd) {
|
||||
uint8_t* tempbuffer;
|
||||
uint8_t temp_buff[16];
|
||||
uint32_t spi_speed = 0;
|
||||
uint8_t powerPinCount = 1;
|
||||
static uint32_t curspeed = 0;
|
||||
|
||||
switch (cmd->command) {
|
||||
@@ -267,14 +268,17 @@ void processFlasherCommand(struct flasherCommand* cmd) {
|
||||
curspeed = spi_speed;
|
||||
|
||||
if (cmd->data[0] & 2) {
|
||||
temp_buff[0] = zbs->begin(FLASHER_AP_SS, FLASHER_AP_CLK, FLASHER_AP_MOSI, FLASHER_AP_MISO, FLASHER_AP_RESET, (uint8_t*)powerPins, spi_speed);
|
||||
powerPinCount = powerPins[0] != -1 ? sizeof(powerPins) : 0;
|
||||
temp_buff[0] = zbs->begin(FLASHER_AP_SS, FLASHER_AP_CLK, FLASHER_AP_MOSI, FLASHER_AP_MISO, FLASHER_AP_RESET, (uint8_t*)powerPins, powerPinCount, spi_speed);
|
||||
} else if (cmd->data[0] & 4) {
|
||||
#ifdef OPENEPAPERLINK_PCB
|
||||
temp_buff[0] = zbs->begin(FLASHER_ALT_SS, FLASHER_ALT_CLK, FLASHER_ALT_MOSI, FLASHER_ALT_MISO, FLASHER_ALT_RESET, (uint8_t*)powerPins3, spi_speed);
|
||||
powerPinCount = powerPins3[0] != -1 ? sizeof(powerPins3) : 0;
|
||||
temp_buff[0] = zbs->begin(FLASHER_ALT_SS, FLASHER_ALT_CLK, FLASHER_ALT_MOSI, FLASHER_ALT_MISO, FLASHER_ALT_RESET, (uint8_t*)powerPins3, powerPinCount, spi_speed);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef OPENEPAPERLINK_PCB
|
||||
temp_buff[0] = zbs->begin(FLASHER_EXT_SS, FLASHER_EXT_CLK, FLASHER_EXT_MOSI, FLASHER_EXT_MISO, FLASHER_EXT_RESET, (uint8_t*)powerPins2, spi_speed);
|
||||
powerPinCount = powerPins2[0] != -1 ? sizeof(powerPins2) : 0;
|
||||
temp_buff[0] = zbs->begin(FLASHER_EXT_SS, FLASHER_EXT_CLK, FLASHER_EXT_MOSI, FLASHER_EXT_MISO, FLASHER_EXT_RESET, (uint8_t*)powerPins2, powerPinCount, spi_speed);
|
||||
#endif
|
||||
}
|
||||
sendFlasherAnswer(cmd->command, temp_buff, 1);
|
||||
|
||||
@@ -127,18 +127,32 @@ void wsErr(String text) {
|
||||
if (wsMutex) xSemaphoreGive(wsMutex);
|
||||
}
|
||||
|
||||
size_t dbSize(){
|
||||
size_t size = tagDB.size() * sizeof(tagRecord);
|
||||
for(auto &tag : tagDB) {
|
||||
if (tag->data)
|
||||
size += tag->len;
|
||||
size += tag->modeConfigJson.length();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
void wsSendSysteminfo() {
|
||||
DynamicJsonDocument doc(150);
|
||||
DynamicJsonDocument doc(250);
|
||||
JsonObject sys = doc.createNestedObject("sys");
|
||||
time_t now;
|
||||
time(&now);
|
||||
sys["currtime"] = now;
|
||||
sys["heap"] = ESP.getFreeHeap();
|
||||
sys["recordcount"] = tagDB.size();
|
||||
sys["dbsize"] = tagDB.size() * sizeof(tagRecord);
|
||||
sys["dbsize"] = dbSize();
|
||||
sys["littlefsfree"] = Storage.freeSpace();
|
||||
sys["apstate"] = apInfo.state;
|
||||
sys["runstate"] = config.runStatus;
|
||||
sys["temp"] = temperatureRead();
|
||||
sys["rssi"] = WiFi.RSSI();
|
||||
sys["wifistatus"] = WiFi.status();
|
||||
sys["wifissid"] = WiFi.SSID();
|
||||
|
||||
xSemaphoreTake(wsMutex, portMAX_DELAY);
|
||||
ws.textAll(doc.as<String>());
|
||||
@@ -351,6 +365,15 @@ void init_web() {
|
||||
if (strcmp(cmdValue, "refresh") == 0) {
|
||||
updateContent(mac);
|
||||
}
|
||||
if (strcmp(cmdValue, "reboot") == 0) {
|
||||
sendTagCommand(mac, CMD_DO_REBOOT, !taginfo->isExternal);
|
||||
}
|
||||
if (strcmp(cmdValue, "scan") == 0) {
|
||||
sendTagCommand(mac, CMD_DO_SCAN, !taginfo->isExternal);
|
||||
}
|
||||
if (strcmp(cmdValue, "reset") == 0) {
|
||||
sendTagCommand(mac, CMD_DO_RESET_SETTINGS, !taginfo->isExternal);
|
||||
}
|
||||
request->send(200, "text/plain", "Ok, done");
|
||||
} else {
|
||||
request->send(200, "text/plain", "Error: mac not found");
|
||||
@@ -474,4 +497,4 @@ void doImageUpload(AsyncWebServerRequest *request, String filename, size_t index
|
||||
request->send(500, "text/plain", "parameters incomplete");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@ uint8_t ZBS_interface::begin(uint8_t SS, uint8_t CLK, uint8_t MOSI, uint8_t MISO
|
||||
_MOSI_PIN = MOSI;
|
||||
_MISO_PIN = MISO;
|
||||
_RESET_PIN = RESET;
|
||||
_POWER_PIN = POWER;
|
||||
if (powerPins > 0)
|
||||
_POWER_PIN = POWER;
|
||||
else
|
||||
_POWER_PIN = nullptr;
|
||||
pinMode(_SS_PIN, OUTPUT);
|
||||
pinMode(_RESET_PIN, OUTPUT);
|
||||
digitalWrite(_SS_PIN, HIGH);
|
||||
|
||||
50
ESP32_AP-Flasher/updateRemote.sh
Executable file
50
ESP32_AP-Flasher/updateRemote.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
(return 0 2>/dev/null) && sourced=1 || sourced=0
|
||||
|
||||
if [ $sourced -eq 0 ]; then
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo "No IP address provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IP=$1
|
||||
|
||||
if [ -z "$IP" ]
|
||||
then
|
||||
echo "ERROR: Empty IP"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
upload_file () {
|
||||
for file in "$@"
|
||||
do
|
||||
split=( $(echo $file | tr ":" " ") )
|
||||
echo $split
|
||||
filename=${split[0]}
|
||||
if [ -z ${split[1]} ]; then
|
||||
filepath=$(echo ${filename} | cut -d'/' -f2-)
|
||||
else
|
||||
filepath=${split[1]}
|
||||
fi
|
||||
echo $filename "-->" $filepath
|
||||
|
||||
curl "http://${IP}/edit" -X POST \
|
||||
-H "Origin: http://${IP}" \
|
||||
-H 'Connection: keep-alive' \
|
||||
-H "Referer: http://${IP}/edit" \
|
||||
-F "data=@${filename};filename=\"${filepath}\""
|
||||
echo ""
|
||||
done
|
||||
}
|
||||
|
||||
export -f upload_file
|
||||
|
||||
if [ $sourced -eq 0 ]; then
|
||||
export IP
|
||||
find data -type f -exec bash -c "upload_file {} $IP" \;
|
||||
else
|
||||
echo "You can now call "
|
||||
echo "IP=1.2.3.4 upload_file data/file1.txt data/file2.txt:target.txt"
|
||||
fi
|
||||
Binary file not shown.
BIN
Hardware/2.9-1.54 NanoAP by ATC1441/NanoAP_Case_V4.stl
Normal file
BIN
Hardware/2.9-1.54 NanoAP by ATC1441/NanoAP_Case_V4.stl
Normal file
Binary file not shown.
@@ -11,6 +11,6 @@ The Flex PCB does also fit on the 2.9" Display, the case will not fit then :D
|
||||
|
||||
<img width="600" alt="NanoAP_Flapped" src="NanoAP_Flapped.jpg">
|
||||
|
||||
- The "NanoAP_Case_V3.stl" Case is printed in one go standing up, 0.2mm Layer height no support, infill 20%
|
||||
- The "NanoAP_Case_V4.stl" Case is printed in one go standing up, 0.2mm Layer height no support, infill 20%
|
||||
- The Flex PCB can be ordered via the Gerber File "NanoAP_Gerber.rar"
|
||||
- The Antenna from the Original case needs to be replaced by either a ~3cm wire or the "Antenna_FlexPCB_Gerber.rar"
|
||||
104
LICENSE
Normal file
104
LICENSE
Normal file
@@ -0,0 +1,104 @@
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
|
||||
|
||||
Section 1 – Definitions.
|
||||
|
||||
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
|
||||
Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
|
||||
BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
|
||||
Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||
Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
|
||||
Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
|
||||
License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.
|
||||
Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
|
||||
Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
|
||||
Licensor means the individual(s) or entity(ies) granting rights under this Public License.
|
||||
NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
|
||||
Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
|
||||
Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
|
||||
You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
|
||||
|
||||
Section 2 – Scope.
|
||||
|
||||
License grant.
|
||||
Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
|
||||
reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
|
||||
produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
|
||||
Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
|
||||
Term. The term of this Public License is specified in Section 6(a).
|
||||
Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
|
||||
Downstream recipients.
|
||||
Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
|
||||
Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
|
||||
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
|
||||
No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
Other rights.
|
||||
Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
|
||||
Patent and trademark rights are not licensed under this Public License.
|
||||
To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
|
||||
|
||||
Section 3 – License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
|
||||
|
||||
Attribution.
|
||||
|
||||
If You Share the Licensed Material (including in modified form), You must:
|
||||
retain the following if it is supplied by the Licensor with the Licensed Material:
|
||||
identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
|
||||
a copyright notice;
|
||||
a notice that refers to this Public License;
|
||||
a notice that refers to the disclaimer of warranties;
|
||||
a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||
indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
|
||||
indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
|
||||
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
|
||||
If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
|
||||
ShareAlike.
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
|
||||
The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.
|
||||
You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
|
||||
You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
|
||||
|
||||
Section 4 – Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
|
||||
|
||||
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
|
||||
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
|
||||
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
|
||||
|
||||
Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
|
||||
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
|
||||
|
||||
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
|
||||
|
||||
Section 6 – Term and Termination.
|
||||
|
||||
This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
|
||||
|
||||
Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
|
||||
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
|
||||
upon express reinstatement by the Licensor.
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
|
||||
For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
|
||||
Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||
|
||||
Section 7 – Other Terms and Conditions.
|
||||
|
||||
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
|
||||
Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
|
||||
|
||||
Section 8 – Interpretation.
|
||||
|
||||
For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
|
||||
To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
|
||||
No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
|
||||
Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
|
||||
@@ -76,3 +76,8 @@ Hats off to these legends!
|
||||

|
||||
|
||||

|
||||
|
||||
## License
|
||||
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
|
||||
|
||||
<img width="150" src="https://github.com/jjwbruijn/OpenEPaperLink/assets/2544995/0f3c945f-377e-49a4-a431-cd9e111f997f">
|
||||
|
||||
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.
Binary file not shown.
10
tag_types.h
10
tag_types.h
@@ -6,6 +6,7 @@
|
||||
#define SOLUM_SEG_EU 0xF1
|
||||
#define SOLUM_NODISPLAY 0xFF
|
||||
|
||||
#define CAPABILITY_SUPPORTS_COMPRESSION 0x02
|
||||
#define CAPABILITY_SUPPORTS_CUSTOM_LUTS 0x04
|
||||
#define CAPABILITY_ALT_LUT_SIZE 0x08
|
||||
#define CAPABILITY_HAS_EXT_POWER 0x10
|
||||
@@ -30,4 +31,11 @@
|
||||
|
||||
#define CMD_DO_REBOOT 0
|
||||
#define CMD_DO_SCAN 1
|
||||
#define CMD_DO_RESET_SETTINGS 2
|
||||
#define CMD_DO_RESET_SETTINGS 2
|
||||
|
||||
#define WAKEUP_REASON_TIMED 0
|
||||
#define WAKEUP_REASON_GPIO 2
|
||||
#define WAKEUP_REASON_NFC 3
|
||||
#define WAKEUP_REASON_FIRSTBOOT 0xFC
|
||||
#define WAKEUP_REASON_NETWORK_SCAN 0xFD
|
||||
#define WAKEUP_REASON_WDT_RESET 0xFE
|
||||
@@ -23,8 +23,8 @@ $stackdisturbed = false;
|
||||
$mem = checkmem();
|
||||
while(1){
|
||||
$errlist = array();
|
||||
//exec("make BUILD=zbs154v033 CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist);
|
||||
exec("make BUILD=zbs_segmented_uk CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist);
|
||||
exec("make BUILD=zbs154_ssd1619 CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist);
|
||||
//exec("make BUILD=zbs_segmented_uk CPU=8051 SOC=zbs243 2>&1 | grep error | grep -v make", $errlist);
|
||||
if(checkmem()!=$mem){
|
||||
$stackdisturbed = true;
|
||||
echo "Stack size was $mem, is now ".checkmem()." !!!\n";
|
||||
|
||||
@@ -163,8 +163,9 @@ void fakeTagCheckIn() {
|
||||
adr->lastPacketLQI = 100;
|
||||
adr->lastPacketRSSI = 100;
|
||||
adr->capabilities |= CAPABILITY_HAS_EXT_POWER;
|
||||
adr->tagSoftwareVersion = 1;
|
||||
if (firstboot) {
|
||||
adr->wakeupReason = 0xFC;
|
||||
adr->wakeupReason = WAKEUP_REASON_FIRSTBOOT;
|
||||
firstboot = false;
|
||||
} else {
|
||||
adr->wakeupReason = 0;
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
#include "emulateTag.h"
|
||||
#endif
|
||||
|
||||
#define MAX_PENDING_MACS 55
|
||||
#define MAX_PENDING_MACS 50
|
||||
#define HOUSEKEEPING_INTERVAL 60UL
|
||||
|
||||
struct pendingData __xdata pendingDataArr[MAX_PENDING_MACS];
|
||||
|
||||
// VERSION GOES HERE!
|
||||
uint16_t __xdata version = 0x0016;
|
||||
uint16_t __xdata version = 0x0017;
|
||||
|
||||
#define RAW_PKT_PADDING 2
|
||||
|
||||
@@ -416,9 +416,9 @@ void espNotifyAPInfo() {
|
||||
countSlots();
|
||||
pr("PEN>%02X\n", curPendingData);
|
||||
pr("NOP>%02X\n", curNoUpdate);
|
||||
#if (AP_EMULATE_TAG == 1)
|
||||
fakeTagCheckIn();
|
||||
#endif
|
||||
//#if (AP_EMULATE_TAG == 1)
|
||||
// fakeTagCheckIn(); // removed this for now to ensure IP info is properly displayed; first tag check in now happens after the first round of housekeeping (30s)
|
||||
//#endif
|
||||
}
|
||||
|
||||
// process data from tag
|
||||
@@ -741,6 +741,11 @@ void main(void) {
|
||||
switch (getPacketType(radiorxbuffer)) {
|
||||
case PKT_AVAIL_DATA_REQ:
|
||||
if (ret == 28) {
|
||||
// old version of the AvailDataReq struct, set all the new fields to zero, so it will pass the CRC
|
||||
processAvailDataReq(radiorxbuffer);
|
||||
memset(radiorxbuffer + 1 + sizeof(struct MacFrameBcast) + sizeof(struct oldAvailDataReq), 0, sizeof(struct AvailDataReq) - sizeof(struct oldAvailDataReq) + 2);
|
||||
} else if (ret == 40) {
|
||||
// new version of the AvailDataReq struct
|
||||
processAvailDataReq(radiorxbuffer);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
-muwx
|
||||
-i main.ihx
|
||||
-M
|
||||
-X 0x2000
|
||||
-C 0xfc00
|
||||
-b HOME = 0x0000
|
||||
-b XSEG = 0xe000
|
||||
-b PSEG = 0xe000
|
||||
-b ISEG = 0x0000
|
||||
-b BSEG = 0x0000
|
||||
-k /usr/local/bin/../share/sdcc/lib/large
|
||||
-k /usr/local/share/sdcc/lib/large
|
||||
-l mcs51
|
||||
-l libsdcc
|
||||
-l libint
|
||||
-l liblong
|
||||
-l libfloat
|
||||
main.rel
|
||||
eeprom.rel
|
||||
drawing.rel
|
||||
comms.rel
|
||||
syncedproto.rel
|
||||
userinterface.rel
|
||||
powermgt.rel
|
||||
barcode.rel
|
||||
i2cdevices.rel
|
||||
settings.rel
|
||||
soc/zbs243/soc.rel
|
||||
soc/zbs243/wdt.rel
|
||||
soc/zbs243/sleep.rel
|
||||
soc/zbs243/spi.rel
|
||||
soc/zbs243/uart.rel
|
||||
soc/zbs243/timer.rel
|
||||
soc/zbs243/radio.rel
|
||||
soc/zbs243/flash.rel
|
||||
soc/zbs243/temperature.rel
|
||||
cpu/8051/random.rel
|
||||
cpu/8051/printf.rel
|
||||
soc/zbs243/i2c.rel
|
||||
cpu/8051/asmUtil.rel
|
||||
cpu/8051/cpu.rel
|
||||
board/zbs29_uc8151/board.rel
|
||||
board/zbs29_uc8151/screen.rel
|
||||
|
||||
-e
|
||||
@@ -2,13 +2,6 @@
|
||||
#define _POWERMGT_H_
|
||||
#include <stdint.h>
|
||||
|
||||
#define WAKEUP_REASON_TIMED 0
|
||||
#define WAKEUP_REASON_GPIO 2
|
||||
#define WAKEUP_REASON_NFC 3
|
||||
#define WAKEUP_REASON_FIRSTBOOT 0xFC
|
||||
#define WAKEUP_REASON_NETWORK_SCAN 0xFD
|
||||
#define WAKEUP_REASON_WDT_RESET 0xFE
|
||||
|
||||
#define DETECT_P1_0_NOTHING 0
|
||||
#define DETECT_P1_0_BUTTON 1
|
||||
#define DETECT_P1_0_JIG 2
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FW_VERSION 18 // version number (max 2.5.5 :) )
|
||||
#define FW_VERSION_SUFFIX "-RW" // suffix, like -RC1 or whatever.
|
||||
#define FW_VERSION 19 // version number (max 2.5.5 :) )
|
||||
#define FW_VERSION_SUFFIX "-VER" // suffix, like -RC1 or whatever.
|
||||
// #define DEBUGBLOCKS // uncomment to enable extra debug information on the block transfers
|
||||
// #define PRINT_LUT // uncomment if you want the tag to print the LUT for the current temperature bracket
|
||||
|
||||
|
||||
@@ -196,6 +196,9 @@ static void sendAvailDataReq() {
|
||||
availreq->temperature = temperature;
|
||||
availreq->batteryMv = batteryVoltage;
|
||||
availreq->capabilities = capabilities;
|
||||
availreq->tagSoftwareVersion = fwVersion;
|
||||
availreq->currentChannel = currentChannel;
|
||||
availreq->customMode = tagSettings.customMode;
|
||||
addCRC(availreq, sizeof(struct AvailDataReq));
|
||||
commsTxNoCpy(outBuffer);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
// extern uint8_t __xdata APmac[];
|
||||
// extern uint16_t __xdata batteryVoltage;
|
||||
|
||||
const uint8_t __code fwVersion = FW_VERSION;
|
||||
const uint16_t __code fwVersion = FW_VERSION;
|
||||
const char __code fwVersionSuffix[] = FW_VERSION_SUFFIX;
|
||||
|
||||
extern uint8_t __xdata capabilities;
|
||||
|
||||
@@ -15,7 +15,7 @@ void showLongTermSleep();
|
||||
void showNoEEPROM();
|
||||
void showNoMAC();
|
||||
|
||||
extern const uint8_t __code fwVersion;
|
||||
extern const uint16_t __code fwVersion;
|
||||
extern const char __code fwVersionSuffix[];
|
||||
extern bool __xdata lowBatteryShown;
|
||||
extern bool __xdata noAPShown;
|
||||
|
||||
@@ -31,7 +31,6 @@ enum TagScreenType {
|
||||
TagScreenTypeOther = 0x7f,
|
||||
};
|
||||
|
||||
|
||||
#ifndef __packed
|
||||
#define __packed __attribute__((packed))
|
||||
#endif
|
||||
@@ -110,9 +109,23 @@ struct AvailDataReq {
|
||||
uint16_t batteryMv;
|
||||
uint8_t hwType;
|
||||
uint8_t wakeupReason;
|
||||
uint8_t capabilities; // undefined, as of now
|
||||
uint8_t capabilities;
|
||||
uint16_t tagSoftwareVersion;
|
||||
uint8_t currentChannel;
|
||||
uint8_t customMode;
|
||||
uint8_t reserved[8];
|
||||
} __packed;
|
||||
|
||||
struct oldAvailDataReq {
|
||||
uint8_t checksum;
|
||||
uint8_t lastPacketLQI;
|
||||
int8_t lastPacketRSSI;
|
||||
int8_t temperature;
|
||||
uint16_t batteryMv;
|
||||
uint8_t hwType;
|
||||
uint8_t wakeupReason;
|
||||
uint8_t capabilities;
|
||||
} __packed;
|
||||
|
||||
struct AvailDataInfo {
|
||||
uint8_t checksum;
|
||||
@@ -190,7 +203,6 @@ struct espSetChannelPower {
|
||||
uint8_t power;
|
||||
} __packed;
|
||||
|
||||
|
||||
#define MACFMT "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
#define MACCVT(x) ((const uint8_t*)(x))[7], ((const uint8_t*)(x))[6], ((const uint8_t*)(x))[5], ((const uint8_t*)(x))[4], ((const uint8_t*)(x))[3], ((const uint8_t*)(x))[2], ((const uint8_t*)(x))[1], ((const uint8_t*)(x))[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user