Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit d41ab4b
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 13:16:15 2024 +0100

    remove subghz in platformio.ini

commit dfa1a5c
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 13:15:14 2024 +0100

    Revert "Disable SubGhz support until C6 side is ready."

    This reverts commit 3bc96dc.

commit cdd2607
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 13:14:46 2024 +0100

    Revert "Merge remote-tracking branch 'mine/oepl_pr_1' into oepl_pr_1"

    This reverts commit 39b1938, reversing
    changes made to 3bc96dc.

commit 39b1938
Merge: 3bc96dc 2b62dff
Author: Skip Hansen <skip@gfrn.org>
Date:   Mon Mar 4 03:54:35 2024 -0800

    Merge remote-tracking branch 'mine/oepl_pr_1' into oepl_pr_1

commit 3bc96dc
Author: Skip Hansen <skip@gfrn.org>
Date:   Mon Mar 4 03:43:12 2024 -0800

    Disable SubGhz support until C6 side is ready.

commit 2b62dff
Author: Nic Limper <nic@xs4all.nl>
Date:   Mon Mar 4 11:44:06 2024 +0100

    fix gzip wwwfiles

    to prevent unchanged gzipped files showing up in the commit

commit 0864870
Author: Skip Hansen <skip@gfrn.org>
Date:   Sun Mar 3 16:46:53 2024 -0800

    Added SubGhz channel support to AP Web GUI.
  • Loading branch information
nlimper committed Mar 4, 2024
1 parent b527d3e commit 739625f
Show file tree
Hide file tree
Showing 19 changed files with 44 additions and 2 deletions.
Binary file modified ESP32_AP-Flasher/data/www/content_cards.json.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/edit.html.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/flash.js.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/jsontemplate-demo.html.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/main.css.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/main.js.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/ota.js.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/painter.js.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/setup.html.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/setup.js.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/upload-demo.html.gz
Binary file not shown.
Binary file modified ESP32_AP-Flasher/data/www/variables-demo.html.gz
Binary file not shown.
1 change: 1 addition & 0 deletions ESP32_AP-Flasher/include/tag_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class tagRecord {

struct Config {
uint8_t channel;
uint8_t subghzchannel;
char alias[32];
uint8_t led;
uint8_t tft;
Expand Down
7 changes: 5 additions & 2 deletions ESP32_AP-Flasher/src/newproto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,11 @@ void setAPchannel() {
udpsync.getAPList();
} else {
if (curChannel.channel != config.channel) {
curChannel.channel = config.channel;
sendChannelPower(&curChannel);
curChannel.channel = config.channel;
#ifdef HAS_SUBGHZ
curChannel.subghzchannel = config.subghzchannel;
#endif
sendChannelPower(&curChannel);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions ESP32_AP-Flasher/src/tag_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ void initAPconfig() {
configFile.close();
}
config.channel = APconfig.containsKey("channel") ? APconfig["channel"] : 0;
config.subghzchannel = APconfig.containsKey("subghzchannel") ? APconfig["subghzchannel"] : 0;
if (APconfig["alias"]) strlcpy(config.alias, APconfig["alias"], sizeof(config.alias));
config.led = APconfig.containsKey("led") ? APconfig["led"] : 255;
config.tft = APconfig.containsKey("tft") ? APconfig["tft"] : 255;
Expand Down Expand Up @@ -343,6 +344,7 @@ void saveAPconfig() {
fs::File configFile = contentFS->open("/current/apconfig.json", "w");
DynamicJsonDocument APconfig(500);
APconfig["channel"] = config.channel;
APconfig["subghzchannel"] = config.subghzchannel;
APconfig["alias"] = config.alias;
APconfig["led"] = config.led;
APconfig["tft"] = config.tft;
Expand Down
10 changes: 10 additions & 0 deletions ESP32_AP-Flasher/src/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,13 @@ void init_web() {
#else
response->print("\"hasBLE\": \"0\", ");
#endif

#ifdef HAS_SUBGHZ
response->print("\"hasSubGhz\": \"1\", ");
#else
response->print("\"hasSubGhz\": \"0\", ");
#endif

response->print("\"apstate\": \"" + String(apInfo.state) + "\"");

File configFile = contentFS->open("/current/apconfig.json", "r");
Expand Down Expand Up @@ -542,6 +549,9 @@ void init_web() {
if (request->hasParam("channel", true)) {
config.channel = static_cast<uint8_t>(request->getParam("channel", true)->value().toInt());
}
if (request->hasParam("subghzchannel", true)) {
config.subghzchannel = static_cast<uint8_t>(request->getParam("subghzchannel", true)->value().toInt());
}
if (request->hasParam("led", true)) {
config.led = static_cast<uint8_t>(request->getParam("led", true)->value().toInt());
updateBrightnessFromConfig();
Expand Down
18 changes: 18 additions & 0 deletions ESP32_AP-Flasher/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,24 @@ <h3>Access Point config</h3>
<option value="27">27</option>
</select>
</p>
<p title="Enable SubGhz support and select channel. This requires an AP that has an optional CC1101 SubGhz radio module attached.">
<label for="apcfgsubgigchid">SubGhz channel</label>
<select id="apcfgsubgigchid">
<option value="0" selected>disabled</option>
<option value="100">100 - 864.000 Mhz (Europe, etc)</option>
<option value="101">101 - 865.006 Mhz (Europe, etc)</option>
<option value="102">102 - 866.014 Mhz (Europe, etc)</option>
<option value="103">103 - 867.020 Mhz (Europe, etc)</option>
<option value="104">104 - 868.027 Mhz (Europe, etc)</option>
<option value="105">105 - 869.034 Mhz (Europe, etc)</option>
<option value="200">200 - 903.000 Mhz (US, etc)</option>
<option value="201">201 - 907.027 Mhz (US, etc)</option>
<option value="202">202 - 911.054 Mhz (US, etc)</option>
<option value="203">203 - 915.083 Mhz (US, etc)</option>
<option value="204">204 - 919.110 Mhz (US, etc)</option>
<option value="205">205 - 923.138 Mhz (US, etc)</option>
</select>
</p>
<p title="Enable Bluetooth (BLE) support. Only enable this if you have BLE capable tags. Changing this value requires a reboot to take effect.">
<label for="apcfgble">Bluetooth</label>
<select id="apcfgble">
Expand Down
5 changes: 5 additions & 0 deletions ESP32_AP-Flasher/wwwroot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ window.addEventListener("loadConfig", function () {
if (data.hasBLE == 0) {
$("#apcfgble").parentNode.style.display = 'none';
}
if (data.hasSubGhz == 0) {
$("#apcfgsubgigchid").parentNode.style.display = 'none';
}
if (data.savespace) {
}
if (data.apstate) {
Expand Down Expand Up @@ -730,6 +733,7 @@ document.addEventListener("loadTab", function (event) {
apConfig = data;
$('#apcfgalias').value = data.alias;
$('#apcfgchid').value = data.channel;
$('#apcfgsubgigchid').value = data.subghzchannel;
$('#apcfgble').value = data.ble;
$("#apcfgledbrightness").value = data.led;
$("#apcfgtftbrightness").value = data.tft;
Expand Down Expand Up @@ -765,6 +769,7 @@ $('#apcfgsave').onclick = function () {
let formData = new FormData();
formData.append("alias", $('#apcfgalias').value);
formData.append("channel", $('#apcfgchid').value);
formData.append("subghzchannel", $('#apcfgsubgigchid').value);
formData.append('ble', $('#apcfgble').value);
formData.append('led', $('#apcfgledbrightness').value);
formData.append('tft', $('#apcfgtftbrightness').value);
Expand Down
3 changes: 3 additions & 0 deletions oepl-esp-ap-proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ struct espSetChannelPower {
uint8_t checksum;
uint8_t channel;
uint8_t power;
#ifdef HAS_SUBGHZ
uint8_t subghzchannel;
#endif
} __packed;

struct espAvailDataReq {
Expand Down

0 comments on commit 739625f

Please sign in to comment.