2025-12-08 23:13:33 +11:00
|
|
|
[platformio]
|
|
|
|
|
default_envs = default
|
2026-02-22 08:32:03 +01:00
|
|
|
extra_configs = platformio.local.ini
|
2025-12-03 22:00:29 +11:00
|
|
|
|
2026-01-13 00:56:21 +11:00
|
|
|
[crosspoint]
|
2026-02-23 17:59:24 +11:00
|
|
|
version = 1.1.1
|
2026-01-13 00:56:21 +11:00
|
|
|
|
2025-12-08 23:13:33 +11:00
|
|
|
[base]
|
2026-02-22 11:31:33 +02:00
|
|
|
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip
|
2025-12-03 22:00:29 +11:00
|
|
|
board = esp32-c3-devkitm-1
|
|
|
|
|
framework = arduino
|
|
|
|
|
monitor_speed = 115200
|
|
|
|
|
upload_speed = 921600
|
2025-12-15 19:46:52 +11:00
|
|
|
check_tool = cppcheck
|
2025-12-22 03:19:49 +11:00
|
|
|
check_flags = --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=unmatchedSuppression --suppress=*:*/.pio/* --inline-suppr
|
2025-12-15 19:46:52 +11:00
|
|
|
check_skip_packages = yes
|
2025-12-03 22:00:29 +11:00
|
|
|
|
|
|
|
|
board_upload.flash_size = 16MB
|
|
|
|
|
board_upload.maximum_size = 16777216
|
|
|
|
|
board_upload.offset_address = 0x10000
|
|
|
|
|
|
|
|
|
|
build_flags =
|
|
|
|
|
-DARDUINO_USB_MODE=1
|
|
|
|
|
-DARDUINO_USB_CDC_ON_BOOT=1
|
2025-12-17 00:17:49 +11:00
|
|
|
-DEINK_DISPLAY_SINGLE_BUFFER_MODE=1
|
2025-12-30 15:09:30 +10:00
|
|
|
-DDISABLE_FS_H_WARNING=1
|
2025-12-08 23:13:33 +11:00
|
|
|
# https://libexpat.github.io/doc/api/latest/#XML_GE
|
2025-12-06 20:57:24 +11:00
|
|
|
-DXML_GE=0
|
|
|
|
|
-DXML_CONTEXT_BYTES=1024
|
2026-02-15 12:22:42 -05:00
|
|
|
-std=gnu++2a
|
2025-12-31 07:08:31 +09:00
|
|
|
# Enable UTF-8 long file names in SdFat
|
|
|
|
|
-DUSE_UTF8_LONG_NAMES=1
|
2026-02-19 19:51:38 +03:00
|
|
|
# Increase PNG scanline buffer to support up to 2048px wide images
|
2026-02-16 08:56:59 +00:00
|
|
|
# Default is (320*4+1)*2=2562, we need more for larger images
|
2026-02-19 19:51:38 +03:00
|
|
|
-DPNG_MAX_BUFFERED_PIXELS=16416
|
2026-02-22 20:56:13 +11:00
|
|
|
-Wno-bidi-chars
|
2025-12-03 22:00:29 +11:00
|
|
|
|
2026-02-15 12:22:42 -05:00
|
|
|
build_unflags =
|
|
|
|
|
-std=gnu++11
|
|
|
|
|
|
2025-12-08 23:13:33 +11:00
|
|
|
; Board configuration
|
|
|
|
|
board_build.flash_mode = dio
|
|
|
|
|
board_build.flash_size = 16MB
|
|
|
|
|
board_build.partitions = partitions.csv
|
|
|
|
|
|
Add connect to Wifi and File Manager Webserver (#41)
## Summary
- **What is the goal of this PR?**
Implements wireless EPUB file management via a built-in web server,
enabling users to upload, browse, organize, and delete EPUB files from
any device on the same WiFi network without needing a computer cable
connection.
- **What changes are included?**
- **New Web Server**
([`CrossPointWebServer.cpp`](src/CrossPointWebServer.cpp),
[`CrossPointWebServer.h`](src/CrossPointWebServer.h)):
- HTTP server on port 80 with a responsive HTML/CSS interface
- Home page showing device status (version, IP, free memory)
- File Manager with folder navigation and breadcrumb support
- EPUB file upload with progress tracking
- Folder creation and file/folder deletion
- XSS protection via HTML escaping
- Hidden system folders (`.` prefixed, "System Volume Information",
"XTCache")
- **WiFi Screen** ([`WifiScreen.cpp`](src/screens/WifiScreen.cpp),
[`WifiScreen.h`](src/screens/WifiScreen.h)):
- Network scanning with signal strength indicators
- Visual indicators for encrypted (`*`) and saved (`+`) networks
- State machine managing: scanning, network selection, password entry,
connecting, save/forget prompts
- 15-second connection timeout handling
- Integration with web server (starts on connect, stops on exit)
- **WiFi Credential Storage**
([`WifiCredentialStore.cpp`](src/WifiCredentialStore.cpp),
[`WifiCredentialStore.h`](src/WifiCredentialStore.h)):
- Persistent storage in `/sd/.crosspoint/wifi.bin`
- XOR obfuscation for stored passwords (basic protection against casual
reading)
- Up to 8 saved networks with add/remove/update operations
- **On-Screen Keyboard**
([`OnScreenKeyboard.cpp`](src/screens/OnScreenKeyboard.cpp),
[`OnScreenKeyboard.h`](src/screens/OnScreenKeyboard.h)):
- Reusable QWERTY keyboard component with shift support
- Special keys: Shift, Space, Backspace, Done
- Support for password masking mode
- **Settings Screen Integration**
([`SettingsScreen.h`](src/screens/SettingsScreen.h)):
- Added WiFi action to navigate to the new WiFi screen
- **Documentation** ([`docs/webserver.md`](docs/webserver.md)):
- Comprehensive user guide covering WiFi setup, web interface usage,
file management, troubleshooting, and security notes
- See this for more screenshots!
- Working "displays the right way in GitHub" on my repo:
https://github.com/olearycrew/crosspoint-reader/blob/feature/connect-to-wifi/docs/webserver.md
**Video demo**
https://github.com/user-attachments/assets/283e32dc-2d9f-4ae2-848e-01f41166a731
## Additional Context
- **Security considerations**: The web server has no
authentication—anyone on the same WiFi network can access files. This is
documented as a limitation, recommending use only on trusted private
networks. Password obfuscation in the credential store is XOR-based, not
cryptographically secure.
- **Memory implications**: The web server and WiFi stack consume
significant memory. The implementation properly cleans up (stops server,
disconnects WiFi, sets `WIFI_OFF` mode) when exiting the WiFi screen to
free resources.
- **Async operations**: Network scanning and connection use async
patterns with FreeRTOS tasks to prevent blocking the UI. The display
task handles rendering on a dedicated thread with mutex protection.
- **Browser compatibility**: The web interface uses standard
HTML5/CSS3/JavaScript and is tested to work with all modern browsers on
desktop and mobile.
---------
Co-authored-by: Dave Allie <dave@daveallie.com>
2025-12-19 09:05:43 -05:00
|
|
|
extra_scripts =
|
|
|
|
|
pre:scripts/build_html.py
|
feat: User-Interface I18n System (#728)
## Summary
**What is the goal of this PR?**
This PR introduces Internationalization (i18n) support, enabling users
to switch the UI language dynamically.
**What changes are included?**
- Core Logic: Added I18n class (`lib/I18n/I18n.h/cpp`) to manage
language state and string retrieval.
- Data Structures:
- `lib/I18n/I18nStrings.h/cpp`: Static string arrays for each supported
language.
- `lib/I18n/I18nKeys.h`: Enum definitions for type-safe string access.
- `lib/I18n/translations.csv`: single source of truth.
- Documentation: Added `docs/i18n.md` detailing the workflow for
developers and translators.
- New Settings activity:
`src/activities/settings/LanguageSelectActivity.h/cpp`
## Additional Context
This implementation (building on concepts from #505) prioritizes
performance and memory efficiency.
The core approach is to store all localized strings for each language in
dedicated arrays and access them via enums. This provides O(1) access
with zero runtime overhead, and avoids the heap allocations, hashing,
and collision handling required by `std::map` or `std::unordered_map`.
The main trade-off is that enums and string arrays must remain perfectly
synchronized—any mismatch would result in incorrect strings being
displayed in the UI.
To eliminate this risk, I added a Python script that automatically
generates `I18nStrings.h/.cpp` and `I18nKeys.h` from a CSV file, which
will serve as the single source of truth for all translations. The full
design and workflow are documented in `docs/i18n.md`.
### Next Steps
- [x] Python script `generate_i18n.py` to auto-generate C++ files from
CSV
- [x] Populate translations.csv with initial translations.
Currently available translations: English, Español, Français, Deutsch,
Čeština, Português (Brasil), Русский, Svenska.
Thanks, community!
**Status:** EDIT: ready to be merged.
As a proof of concept, the SPANISH strings currently mirror the English
ones, but are fully uppercased.
---
### AI Usage
Did you use AI tools to help write this code? _**< PARTIALLY >**_
I used AI for the black work of replacing strings with I18n references
across the project, and for generating the documentation. EDIT: also
some help with merging changes from master.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: yeyeto2788 <juanernestobiondi@gmail.com>
2026-02-16 15:28:42 +02:00
|
|
|
pre:scripts/gen_i18n.py
|
2026-03-01 02:07:08 +01:00
|
|
|
pre:scripts/git_branch.py
|
Add connect to Wifi and File Manager Webserver (#41)
## Summary
- **What is the goal of this PR?**
Implements wireless EPUB file management via a built-in web server,
enabling users to upload, browse, organize, and delete EPUB files from
any device on the same WiFi network without needing a computer cable
connection.
- **What changes are included?**
- **New Web Server**
([`CrossPointWebServer.cpp`](src/CrossPointWebServer.cpp),
[`CrossPointWebServer.h`](src/CrossPointWebServer.h)):
- HTTP server on port 80 with a responsive HTML/CSS interface
- Home page showing device status (version, IP, free memory)
- File Manager with folder navigation and breadcrumb support
- EPUB file upload with progress tracking
- Folder creation and file/folder deletion
- XSS protection via HTML escaping
- Hidden system folders (`.` prefixed, "System Volume Information",
"XTCache")
- **WiFi Screen** ([`WifiScreen.cpp`](src/screens/WifiScreen.cpp),
[`WifiScreen.h`](src/screens/WifiScreen.h)):
- Network scanning with signal strength indicators
- Visual indicators for encrypted (`*`) and saved (`+`) networks
- State machine managing: scanning, network selection, password entry,
connecting, save/forget prompts
- 15-second connection timeout handling
- Integration with web server (starts on connect, stops on exit)
- **WiFi Credential Storage**
([`WifiCredentialStore.cpp`](src/WifiCredentialStore.cpp),
[`WifiCredentialStore.h`](src/WifiCredentialStore.h)):
- Persistent storage in `/sd/.crosspoint/wifi.bin`
- XOR obfuscation for stored passwords (basic protection against casual
reading)
- Up to 8 saved networks with add/remove/update operations
- **On-Screen Keyboard**
([`OnScreenKeyboard.cpp`](src/screens/OnScreenKeyboard.cpp),
[`OnScreenKeyboard.h`](src/screens/OnScreenKeyboard.h)):
- Reusable QWERTY keyboard component with shift support
- Special keys: Shift, Space, Backspace, Done
- Support for password masking mode
- **Settings Screen Integration**
([`SettingsScreen.h`](src/screens/SettingsScreen.h)):
- Added WiFi action to navigate to the new WiFi screen
- **Documentation** ([`docs/webserver.md`](docs/webserver.md)):
- Comprehensive user guide covering WiFi setup, web interface usage,
file management, troubleshooting, and security notes
- See this for more screenshots!
- Working "displays the right way in GitHub" on my repo:
https://github.com/olearycrew/crosspoint-reader/blob/feature/connect-to-wifi/docs/webserver.md
**Video demo**
https://github.com/user-attachments/assets/283e32dc-2d9f-4ae2-848e-01f41166a731
## Additional Context
- **Security considerations**: The web server has no
authentication—anyone on the same WiFi network can access files. This is
documented as a limitation, recommending use only on trusted private
networks. Password obfuscation in the credential store is XOR-based, not
cryptographically secure.
- **Memory implications**: The web server and WiFi stack consume
significant memory. The implementation properly cleans up (stops server,
disconnects WiFi, sets `WIFI_OFF` mode) when exiting the WiFi screen to
free resources.
- **Async operations**: Network scanning and connection use async
patterns with FreeRTOS tasks to prevent blocking the UI. The display
task handles rendering on a dedicated thread with mutex protection.
- **Browser compatibility**: The web interface uses standard
HTML5/CSS3/JavaScript and is tested to work with all modern browsers on
desktop and mobile.
---------
Co-authored-by: Dave Allie <dave@daveallie.com>
2025-12-19 09:05:43 -05:00
|
|
|
|
2025-12-03 22:00:29 +11:00
|
|
|
; Libraries
|
|
|
|
|
lib_deps =
|
|
|
|
|
BatteryMonitor=symlink://open-x4-sdk/libs/hardware/BatteryMonitor
|
2025-12-06 12:35:41 +11:00
|
|
|
InputManager=symlink://open-x4-sdk/libs/hardware/InputManager
|
2025-12-08 19:48:49 +11:00
|
|
|
EInkDisplay=symlink://open-x4-sdk/libs/display/EInkDisplay
|
2025-12-30 15:09:30 +10:00
|
|
|
SDCardManager=symlink://open-x4-sdk/libs/hardware/SDCardManager
|
2026-01-15 02:22:38 +11:00
|
|
|
bblanchon/ArduinoJson @ 7.4.2
|
|
|
|
|
ricmoo/QRCode @ 0.0.1
|
2026-02-16 08:56:59 +00:00
|
|
|
bitbank2/PNGdec @ ^1.0.0
|
2026-01-15 02:22:38 +11:00
|
|
|
links2004/WebSockets @ 2.7.3
|
2025-12-08 23:13:33 +11:00
|
|
|
|
|
|
|
|
[env:default]
|
|
|
|
|
extends = base
|
|
|
|
|
build_flags =
|
|
|
|
|
${base.build_flags}
|
2026-03-01 02:07:08 +01:00
|
|
|
; CROSSPOINT_VERSION is set by scripts/git_branch.py (includes current branch)
|
2026-02-13 12:16:39 +01:00
|
|
|
-DENABLE_SERIAL_LOG
|
|
|
|
|
-DLOG_LEVEL=2 ; Set log level to debug for development builds
|
|
|
|
|
|
2025-12-08 23:13:33 +11:00
|
|
|
|
|
|
|
|
[env:gh_release]
|
|
|
|
|
extends = base
|
|
|
|
|
build_flags =
|
|
|
|
|
${base.build_flags}
|
2026-01-13 00:56:21 +11:00
|
|
|
-DCROSSPOINT_VERSION=\"${crosspoint.version}\"
|
2026-02-13 12:16:39 +01:00
|
|
|
-DENABLE_SERIAL_LOG
|
|
|
|
|
-DLOG_LEVEL=0 ; Set log level to error for release builds
|
2026-02-06 03:18:47 +11:00
|
|
|
|
|
|
|
|
[env:gh_release_rc]
|
|
|
|
|
extends = base
|
|
|
|
|
build_flags =
|
|
|
|
|
${base.build_flags}
|
2026-02-06 03:49:00 +11:00
|
|
|
-DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\"
|
2026-02-13 12:16:39 +01:00
|
|
|
-DENABLE_SERIAL_LOG
|
|
|
|
|
-DLOG_LEVEL=1 ; Set log level to info for release candidate builds
|
|
|
|
|
|
|
|
|
|
[env:slim]
|
|
|
|
|
extends = base
|
|
|
|
|
build_flags =
|
|
|
|
|
${base.build_flags}
|
|
|
|
|
-DCROSSPOINT_VERSION=\"${crosspoint.version}-slim\"
|
|
|
|
|
; serial output is disabled in slim builds to save space
|
|
|
|
|
-UENABLE_SERIAL_LOG
|