New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional secondary serial device to ESP32 receivers #2605
base: master
Are you sure you want to change the base?
Conversation
The second serial and protocol should be selectable from the PWM page not the hardware page. The hardware page should only be used to configure the actual hardware layout. Users should not be going to the hardware page to configure normal features. |
9648df1
to
4601472
Compare
I first started thinking this might be an expert option but of course I see your point. To do a proper user UI I need some discussion on how to present this and also on how to implement this. scan.js is not self explanatory. Is there a UI guy we could try to pull in? |
|
Nice. The current changes are looking good. My only comment for now is naming. Most users wont think in zero indexing, so something like "Serial2" or "Serial TX 2" in the Ui might be better? |
Thanks for your review. I think "Serial2 RX" and "Serial2 TX" would be fine. The Serial2 prefix can be used for WebUI protocol selection too. I'd name it "Serial2 Protocol" while keeping the first one at the known "Serial Protocol". But too long for LUA, so how about Protocol (unchanged) and Protocol2? |
Protocol2 get my vote. |
names updated |
d391096
to
26f42b7
Compare
356407e
to
8a9d0ca
Compare
For your info some feedback, I made some tests of this feature on RM ER6 and Betafpv super P + a graupner +T70 esc and I also checked the Sbus output with a MC8 checker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will also need to provide a config upgrader
aebeaf2
to
d0f7b86
Compare
afb8b7c
to
558b75d
Compare
@mha1 One oddity I noticed is that if I set Serial2RX on pin13 and then Serial2TX on pin 14, pin 13 goes back to 50Hz in the web UI. Probably not a big deal. |
ch13/14 on the SuperP? |
bdf12a6
to
9cf8d99
Compare
Yes, SuperP sorry. |
Thanks for pointing out this problem. This needed a little features logic refinement. PWM pins can only be featured as Serial1 or Serial2. Serial1 takes priority. Updated feature logic accordingly. No more Serial2 feature badges on PWM pins for receivers having Serial1 U0RXD/U0TXD assigned to PWM pins: |
5652ccc
to
fd971a4
Compare
…ial pins and protocol
…are defined in hardware.html fixes feature selections not greyed out at initialization
… pin WebUI: show Serial2 mode selection only if Serial2 TX is assigned
- added logic to prevent multiple assignments of SCL/SDA and RX2/TX2
- SBUS driver object needs to know which serial stream it is running on to allow SBUS on one and DJI on the other serial device
changes: - _('is-airport').onchange to call serial and serial1 onchange() - added serial1 protocol to SetDefaults()
…s is handled in SerialIO driver which is always on)
cleanup rebase first shot at LUA and WebUI user interface for selecting scondary serial pins and protocol fixes build checks cosmetics and added comment about DShot not working on GPIO0 PWM testing/fixes (ExpressLRS#2588) * Revert "Fix for 10KHz 0% and 100% on 8285 receviers (ExpressLRS#2496)" This reverts commit 12659fb. * Much simpler handling of 0 high/low times * Optimisation of timing in PWM timer interrupt t * Extend minimum time for next NMI * Rename pin/i to gpio as thats what it really is. cleanup name changes for WebUI and LUA fixed my serial1-config html extension (one </div> too many) added Serial2 feature badge increase-SX1276-SyncPktIntervalDisconnected-for-25Hz (ExpressLRS#2589) Ignore trailing items with 0 duration (ExpressLRS#2612) This fixes spurious channel data for inverted PPM and glitches cleanup rebase fixes build checks cleanup name changes for WebUI and LUA fixed my serial1-config html extension (one </div> too many) added Serial2 feature badge Fix "Not set" UID badge (ExpressLRS#2619) Allow choosing the SubGHz domain for LR1121 modules (ExpressLRS#2618) restrict selection of Serial2 RX/TX to specific pins if Serial2 pins are defined in hardware.html fixes feature selections not greyed out at initialization include fix ExpressLRS#2623 LUA: bind Serial2 RX/TX to pins if defined for target, else allow any pin WebUI: show Serial2 mode selection only if Serial2 TX is assigned proper solution to showing/hiding Serial2 protocol selection. WebUI: prevent multiple I2C SCL/SDA selections (ExpressLRS#2624) * fixes issue ExpressLRS#2623 * do it properly fix antenna value for Diversity/Gemini receivers (ExpressLRS#2622) Fix LR1121 binding (ExpressLRS#2617) * fix LR1121 binding * remove magic LUA script for assigning I2C and Serial2 modes: - added logic to prevent multiple assignments of SCL/SDA and RX2/TX2 add r flag to encode string as raw string to fix deprecation (ExpressLRS#2598) - SBUS Serial2 init with 8E2 instead of 8N2 - SBUS driver object needs to know which serial stream it is running on to allow SBUS on one and DJI on the other serial device cleanup updated to @pkendall64's review comments changes: - _('is-airport').onchange to call serial and serial1 onchange() - added serial1 protocol to SetDefaults() removed duplicate line of code
…s is handled in SerialIO driver which is always on)
fd971a4
to
1653253
Compare
This PR intends to enable more possible use cases mostly for but not limited to fixed wing and helicopter pilots.
As an example consider the classical use cases:
Currently ELRS receivers only allow using one serial interface (I call it the primary one) for the implemented set of protocols (CRSF, CRSF INV, SBUS, SBUS INV, DJI RS PRO HoTT Telemetry) making the above use cases impossible. This PR adds a secondary serial device on ESP32 receivers which enables running an additional protocol. This opens up the possibility to run two different protocols concurrently. In the above uses cases a setup could look like:
Here's an example using a Radiomaster ER6 receiver showing protocol HoTT Telemetry with a GPS/Vario connected on the primary serial (RX and TX used) and SBUS on the secondary serial (only TX used) configured to use the signal pin of channel connector 6 which might be used to feed channel data to a flybarless unit or gyro. ER6 channels 1 to 5 still output PWM data.
The secondary serial device can be configured using the WebUI or LUA script
Extensions to the code base: