BLE only AP (#313)

Add BLE only AP option

Fix some smaller stuff
This commit is contained in:
Jonas Niesner
2024-05-08 21:24:10 +02:00
committed by GitHub
parent 1ec762ffdb
commit a20ff17d24
7 changed files with 95 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
name: FW Build / Test (Conditional Job PoC)
name: FW Build / Test
on: [push, pull_request]

View File

@@ -41,6 +41,16 @@ jobs:
run: |
mkdir espbinaries
- name: esp-idf build
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: latest
target: esp32c6
path: 'ARM_Tag_FW/OpenEPaperLink_esp32_C6_AP/'
- name: Add C6 files to release
run: |
cp /home/runner/work/OpenEPaperLink/OpenEPaperLink/ARM_Tag_FW/OpenEPaperLink_esp32_C6_AP/build/OpenEPaperLink_esp32_C6.bin espbinaries/OpenEPaperLink_esp32_C6.bin
# - name: Zip web files
# run: |
# cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_AP-Flasher
@@ -176,6 +186,24 @@ jobs:
cp OpenEPaperLink_Mini_AP_v4/firmware.bin espbinaries/OpenEPaperLink_Mini_AP_v4.bin
cp OpenEPaperLink_Mini_AP_v4/merged-firmware.bin espbinaries/OpenEPaperLink_Mini_AP_v4_full.bin
- name: Build firmware for BLE_ONLY_AP
run: |
cd ESP32_AP-Flasher
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
pio run --environment BLE_ONLY_AP
pio run --target buildfs --environment BLE_ONLY_AP
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/BLE_ONLY_AP
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/BLE_ONLY_AP/boot_app0.bin
cp .pio/build/BLE_ONLY_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/BLE_ONLY_AP/firmware.bin
cp .pio/build/BLE_ONLY_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/BLE_ONLY_AP/bootloader.bin
cp .pio/build/BLE_ONLY_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/BLE_ONLY_AP/partitions.bin
cp .pio/build/BLE_ONLY_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/BLE_ONLY_AP/littlefs.bin
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/BLE_ONLY_AP
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 0x00910000 littlefs.bin
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink
cp BLE_ONLY_AP/firmware.bin espbinaries/BLE_ONLY_AP.bin
cp BLE_ONLY_AP/merged-firmware.bin espbinaries/BLE_ONLY_AP_full.bin
- name: generate release json file
run: |
mkdir jsonfiles

View File

@@ -308,6 +308,54 @@ board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:BLE_ONLY_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
-std=gnu++11
-D ARDUINO_USB_MODE=1
-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
lib_deps =
${env.lib_deps}
build_flags =
-std=gnu++17
${env.build_flags}
-D CORE_DEBUG_LEVEL=0
-D ARDUINO_USB_MODE=0
-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
-D CONFIG_SPIRAM_USE_MALLOC=1
-D POWER_NO_SOFT_POWER
-D BOARD_HAS_PSRAM
-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
-D HAS_BLE_WRITER
-D FLASHER_AP_SS=-1
-D FLASHER_AP_CLK=-1
-D FLASHER_AP_MOSI=-1
-D FLASHER_AP_MISO=-1
-D FLASHER_AP_RESET=-1
-D FLASHER_AP_POWER={-1}
-D FLASHER_AP_TEST=-1
-D FLASHER_AP_TXD=-1
-D FLASHER_AP_RXD=-1
-D FLASHER_DEBUG_TXD=-1
-D FLASHER_DEBUG_RXD=-1
-D FLASHER_DEBUG_PROG=-1
-D FLASHER_LED=-1
-D HAS_RGB_LED
-D FLASHER_RGB_LED=48
-D BLE_ONLY
build_src_filter =
+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>-<espflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the PoE-AP and is work in progress right now !!!
; ----------------------------------------------------------------------------------------

View File

@@ -7,7 +7,6 @@
#define INTERVAL_BLE_SCANNING_SECONDS 60
#define INTERVAL_HANDLE_PENDING_SECONDS 10
#define BUFFER_MAX_SIZE_COMPRESSING 100000
#define BLE_MAIN_STATE_IDLE 0

View File

@@ -150,6 +150,9 @@ void setAPstate(bool isOnline, uint8_t state) {
CRGB::Red,
CRGB::YellowGreen};
rgbIdleColor = colorMap[state];
#ifdef BLE_ONLY
rgbIdleColor = CRGB::Green;
#endif
rgbIdlePeriod = (isOnline ? 767 : 255);
if (isOnline) rgbIdle();
#endif
@@ -744,6 +747,9 @@ void segmentedShowIp() {
}
bool bringAPOnline() {
#ifndef BLE_ONLY
apInfo.state = AP_STATE_NORADIO;
#endif
if (apInfo.state == AP_STATE_NORADIO) return true;
if (apInfo.state == AP_STATE_FLASHING) return false;
setAPstate(false, AP_STATE_OFFLINE);
@@ -788,9 +794,12 @@ bool bringAPOnline() {
}
bool checkRadio() {
#ifndef C6_OTA_FLASHING
#ifdef BLE_ONLY
return false;
#endif
#ifndef C6_OTA_FLASHING
return true;
#endif
#endif
// make a short between FLASHER_AP_TXD and FLASHER_AP_RXD to indicate that no radio is present
// e.g. for flasher only, or just to use the S3 to generate images for smaller AP's
pinMode(FLASHER_AP_TXD, OUTPUT);

View File

@@ -331,6 +331,9 @@ void initAPconfig() {
config.sleepTime1 = APconfig.containsKey("sleeptime1") ? APconfig["sleeptime1"] : 0;
config.sleepTime2 = APconfig.containsKey("sleeptime2") ? APconfig["sleeptime2"] : 0;
config.ble = APconfig.containsKey("ble") ? APconfig["ble"] : 0;
#ifdef BLE_ONLY
config.ble = true;
#endif
// default wifi power 8.5 dbM
// see https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiGeneric.h#L111
config.wifiPower = APconfig.containsKey("wifipower") ? APconfig["wifipower"] : 34;

View File

@@ -1,21 +1,10 @@
# OpenEPaperLink
This is an alternative firmware and protocol for the ZBS243-based Electronic Shelf Labels - ESL / price tags by Solum / Samsung. It can be used to setup E-Paper tags and supply them with content.
This is an alternative firmware and protocol for the multiple Electronic Shelf Labels. It can be used to setup E-Paper tags and supply them with content.
The software in this project consists of two parts: Accesspoint-firmware and Tag firmware.
Additionally, there are various hardware designs for accesspoints and flasher-interfaces to program the tags, preferably using programming jigs
<img width="400" alt="board" src="https://user-images.githubusercontent.com/2544995/227208651-993d11a2-380f-44ae-847c-f8d90296c8cf.png">
## Compatibility
It is currently compatible with the following tags:
* 4.2"
* 2.9"
* 1.54"
* Segmented (work in progress)
On the 2.9" tags, both the UC8151 and SSD1619 display variants are supported
## Aims
- Low power (currently around 9µA with a minimum of 40 second latency)
- Even lower power when there's no AP around
@@ -72,10 +61,10 @@ 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.
- After a PR gets merged to the main branch, the changed code will be compiled.
- On release, files are added to enable OTA
![Test](https://github.com/jjwbruijn/OpenEPaperLink/actions/workflows/build-test.yml/badge.svg)
![Test](https://github.com/jjwbruijn/OpenEPaperLink/actions/workflows/conditional-build-test.yml/badge.svg)
![Release](https://github.com/jjwbruijn/OpenEPaperLink/actions/workflows/release.yml/badge.svg)