Repository navigation
feat(buildlab_scout): add status LEDs and rotary encoder - #34
Open
BuildLabDIY wants to merge 3 commits into
Open
BuildLabDIY wants to merge 3 commits into
BuildLabDIY wants to merge 3 commits into
Conversation
The E22P is not wired like the E22-900M30S. Module pin 6 (GPIO17 on Scout) is EN, a front-end enable that must stay HIGH in both directions, and pin 7 (GPIO3) is T/R CTRL: HIGH for TX, LOW for RX. The E22 envs drive GPIO17 as RXEN, so on an E22P they switch the front end off for every transmission: the node still hears, but its own packets barely leave the antenna. New BuildLab_Scout_E22P_* envs reuse the E22 ones, drop SX126X_RXEN and set P_LORA_RF_EN=17, which the board raises in begin(). On these builds the board reports itself as "BuildLab Scout E22P", so it is clear which firmware is on the device. Radio parameters (22 dBm on the SX1262, TCXO 1.8 V, boosted RX gain) are unchanged, and the E22 envs build as before.
BuildLab Scout boards have six WS2812 LEDs on GPIO13 and a rotary encoder (A=GPIO5, B=GPIO4, push button on GPIO6). This adds support for both in the companion radio envs (E22 and E22P): - ScoutRotaryInput: interrupt-driven quadrature decoder, one Next/Prev event per detent. Turn scrolls, short press = enter, long or double press = back. The first turn while the screen is off only wakes it. - ScoutStatusLeds: LED1 RX flash and heartbeat, LED2 TX, LED3/LED4 unread messages (breathing), LED5 GPS searching, LED6 GPS fix. - Display settings: LED on/off, LED Msg on/off, LED Bright (4 steps), stored in NodePrefs. Shared code changes are behind UI_HAS_STATUS_LEDS / UI_ENCODER_NAV, so other boards are not affected.
With [esp32_ps] the status LEDs do not work as in the 1.17 build and the USB-JTAG port no longer enters download mode on its own. The BOOT button is not reachable in the Scout case, so the port has to work. Same CPU and sleep settings as the 1.17 Scout build.
Author
|
I removed [esp32_ps] from the Scout BLE companion env. The E22P env inherits it. With power saving on, the status LEDs do not work as in the 1.17 build, on both E22 and E22P. The USB-JTAG port also stops entering download mode on its own: Windows shows error 31 for the port, and I could flash only in a short window right after a full power cycle. The BOOT button is not reachable in the Scout case. Without power saving the build defines match the 1.17 Scout build. The power mode item in System settings is hidden, as in other builds without power saving. Tested on E22P: LEDs on an incoming message, BLE PIN, flashing over USB. On E22: BLE PIN. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BuildLab Scout boards ship with six WS2812 LEDs on GPIO13 and a rotary encoder (A on GPIO5, B on GPIO4, push button on GPIO6). The
buildlab_scoutvariant in this repo did not support either one. This PR adds them to the companion radio envs, for both the E22 and the E22P module.Encoder:
ScoutRotaryInput) gives one step per detent.Status LEDs (
ScoutStatusLeds):Display > settings gets three new items: LED (on/off), LED Msg (on/off, controls the unread breathing) and LED Bright (4 steps). They are saved in NodePrefs as
led,led_msgandled_lvl.Changes to shared files (
UITask.*,NodePrefs.h) are behindUI_HAS_STATUS_LEDS/UI_ENCODER_NAV, so other boards build the same code as before. This PR is on top of #33 because it extends the same variant.Tested: I have run the same LED and encoder code on my Scout boards with an earlier South version. On this branch I checked that all
BuildLab_Scout*envs build, and so doheltec_rc32_companion_radio_usbandHeltec_v3_companion_radio_ble.