-
Notifications
You must be signed in to change notification settings - Fork 8
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
CRSF Protocol Repo #26
Comments
This would be an amazing initiative! CRSF is the de-facto RC link wire protocol standard, so memorializing it, formally documenting it, and extending it in a thoughtful collaborative way would be a huge benefit to the entire FPV community, and further cement TBS as a thought and market leader in the hobby! |
I am absolutely backing this, 100%. I would love to see CRSF properly listed (perhaps in its own repository?) with its own documentation (regarding specifications on control data, telemetry data, configurations etc) as an open-source protocol. FPV pilots are not the only ones that use CRSF & (by extension) Crossfire & ExpressLRS. I know for a fact that Spektrum did precisely this with their SRXL2 protocol. At this point, it's a win-win for everyone. =^/.~= |
Similar case with mavlink as well: They even have code generators for a range of other languages, and a full online developer docs wiki. |
Noice. =^/,..,^= |
Hi all, Please, we from Bluejay team would like to add some telemetry signals per motor, up to 8 motors. By order of priority we would like to add the signals below to the CRSF protocol telemetry. ESC status, ESC temperature, and ESC current are the most prioritary ones.
We have defined an open spec for extended DSHOT telemetry here: betaflight/betaflight#12170 (comment) Now status information from ESCs can be sent to the flight controller and blackbox. We think that it may be very useful that this info can be also sent and logged in the radio, so pilots can know when something wrong is happening to the motors during/post flight. |
I'm down, and we're open to adding functionality as well as define some rules around how it all must work, predominantly revolving around how frames should be structured when leaving your ecosystem and entering another. I am stretched incredibly thin at this moment (it should improve in about 2 weeks 😂) and thus I will simply not be able to devote a lot of time to the discussions. As a general guideline we will not reserve ranges for certain projects but focus on the use case itself - tribalism is toxic and the protocol should reflect a solid stance against it. E.g. There are no ardupilot reserves in the project, but there are reserved ranges in mavlink. So, I like the Bluejay proposal but it should be discussed with other ESC projects and consider their needs. Then drafts can then be published online and/or sent to me and I will make some time to sit together on a zoom call with those involved in the proposal to hash out some details. Then we move from there. Sounds fair? |
We are up for this too over at Betaflight. It makes sense to have its own repo |
Great news... and 2 weeks is a good time frame :D 100% any proposals needs to be discussed with users to get the best out of any additions to the protocol. This is where a public repo will be beneficial. Proposals like above from BJ can then be bashed out with other ESC developers. |
I'm all for collaboration on this as well. I had written up some protocol documentation mostly because people kept asking about it and it was easier to direct them to a webpage (and never hear from them ever again) than to explain it (and never hear from them again). All information was just from reverse engineering and existing source code, so it is possible it isn't fully accurate. We've also internally started a document about items that need new telemetry IDs and structures as well, so there's even more to contribute in that respect. I also coerced EdgeTX into supporting a non-CRSF-standard extension to the Baro Altitude item to optionally include VSpd in it as well to increase the update rate by not having to send two different telemetry items. We could also consider making other items variable length as well like maybe the battery status one to be Look at me going on about ideas prematurely. Anyway, I am here to help and have written 4 or 5 different CRSF parser implementations in different languages to assist other projects, so I've got a decent amount of experience to contribute. Also +1 to Trappy's sentiment about "reserved ranges for projects" as I have been strongly opposed to making ExpressLRS-specific extensions to CRSF. The beauty of it is that so many projects support the protocol and if it starts to get splintered by over-eager developers just changing things willy-nilly, then everyone suffers a patchwork of partial support and Bad Experience(tm). |
@tbs-trappy sounds great! Do you think it would be possible to publish the existing CRSF spec? |
As a person deeply involved with the FPV/RC scene across many different projects and as a manufacturer (SPRacing) I would like to see CRSF publicly documented, improved and iterated upon.
@tbs-trappy I fully agree with this, to a point where I would like to also see the Additionally, I would also like to see reference implementations of the protocol published. Referring to all the various implementations of the protocol is no-good.
@damosvil what I can foresee happening here is the same thing that happened with MSP and other telemetry protocols (ltm, frsky, smartport, hott, etc), in that over time the data that you want in the telemetry will change, and then people will need to add more things to it and old legacy items will remain around for a long time with no clear deprecation path and lots of code to handle various different iterations of the protocol, which is also a nightmare for testing too. Also, you're forgetting the single MCU, single-uart, 4-in-1 ESC use-case. There are better ways to do this: e.g. FC -> Sends then later, the FC may: FC -> Send a Some telemetry need to be sent at a high rate, some things can be sent less frequently so that flight controllers can manage the workload better, some things need to be sent when they happen. Length-in-bits could be included for each item in the The latter use-case would be for a disarm stats page on the OSD or for recording into flight logs. For your example of an ESC telemetry packet, it can be constructed exactly as you want it, bit-for-bit, given appropriate telemetry items.
and so on. Using a u16 instead of u32 (4 ascii bytes) for the identifier would be ok, but then any code that needed to display the identifiers (like EdgeTX, transmitter modules/backpacks/etc) would need to maintain a list of the identifiers in ASCII (4 bytes) and the corresponding 2 bytes for the u16 identifier which takes up more flash space on already-space-constrained devices. The only hard part is agreeing what should be on the list, but the list can have a reserved range or IDs for development purposes, e.g. Remember that protocols are hard to change once designed, and that there is a high cost to any change to it, as such the protocol should be flexible and future proof. |
Further to the idea of passthough request/response packets, here's a short conversation from discord.
|
For those following along with the telemetry side of things, I wrote a proposal for how to solve the same problem on the DShot telemetry side of things here: |
After thinking about my suggestion, for telemetry, that the approach to the FC telling the devices that can send telemetry what telemetry to send, and how frequently, it occurs to me that the exact same approach can also be taken for the RX channels, basically imagine that conceptually there is no difference between 4x 13-bit RC channels being sent 500 times a second to 4x 4in1 ESC RPM values being sent at 1000 times a second, nor is there any difference between an RC digital switch change event being sent when it occurs to an ESC Desync event being sent when it occurs. Thus, an FC could say to a CRSF receiver:
This removes all the processing overhead of looking at the EDIT: FC would have to choose from a short-list (via discovery) with regards to RC data rates. The OTA link would be unaffected if the FC picks a lower rate and the RX would downsample/filter/average as-appropriate. Note that gyros sensors do this kind of thing via the Output Data Rate (ODR) registers which allows greater application flexibility. |
Based on very little experience at all with CRSF, here's my shortlist of a plan for a potential V4.
|
@tbs-trappy Hello Trappy, |
I am in the middle of something quite major here, as I indicated above. I have privately messaged hydra already. My thing here could take quite some time to resolve, but I will post the highlights of my opinion on this here.
Everything else is a great idea, and I'm definitely for it. Just please keep in mind that there are a large amount of use cases outside of our fairly niche hobby, and CRSF has expanded well into other areas. Apologies for being brief, I will commit more attention as time allows. |
@tbs-trappy Thanks for your answer. Then I think that we all could continue building a proposal, and then if you want to add something later you could still do. |
I agree with both of your points.
|
Agreed. If I could do this right now, I would. If I could give the reasons for why I can't, I would. I need a bit of time, please continue on the new proposals for now I'll be back to my old self hopefully soon. |
Agreed. I actually have much more modest goals than loads of new features - I just want us all to converge first on what exists rather than diverging. A great example is ELRS baudrate vs CRSF baudrate - simple stuff, but convergence benefits us all. Otherwise I have to spend loads of time fixing bugs because of divergence. Simply publishing the spec will pretty much solve this 😄 |
Another one for my CRSF v4 list is:
The spec says:
Note: TBS document formatting makes it even harder to grok! Here's an example bug: CapnBry/CRServoF#28 😒 If there was a good reason for it being the way it is, I'd love it hear it. |
This is pointless breakage. Frame length is perfectly clear and works well - its everything apart from sync and frame length. So when you are decoding it represents the rest of the bytes you have to decode. Making changes like this would create a different protocol and the whole point here is to converge on the existing protocol. |
@andyp1per yeah, I'm aware that would be a breaking change for sure. Just throwing it out there really. I understand that it represents the rest of the bytes you have to decode, if you're receiving into a buffer you have to calculate offsets from the start of the buffer based on the frame length minus 2, which is annoying as the I guess the question in my head is "When is a frame length not a frame length", which with CRSF is currently "100% of the time", as opposed to "never", the latter being the correct answer to the question in my head. Maybe I'm weird, but that's how I see it. |
Not wanting to let this become stale should we look at starting a community repo? There appears to be a few discussions/PRs referencing this thread and a heap of interest. We can open a repo and invite a number of other project members to be a part of it, including TBS as an owner. Addition would require 3-4 approvals to make sure changes are well discussed and thought out? |
@JyeSmith Just start it, I'm sure the community here and TBS will follow. It's also possible to transfer ownership of a repo on github if needed. |
Yeah, I raised an issue in BF regarding this, and also mentioned it to the ELRS guys who have a default of 420000. |
420k baud is the most TBS baud rate I could think of. I would have put money on it. |
and Bertrand Russel is the Pope :D |
Gentle bump since this PR popped up betaflight/betaflight#13119 |
Please post the protocol as we are seeing PRs like the one mentioned above which appears to reference details from the CRSF spec that aren't documented publicly and need to be verified. |
@tbs-trappy I hear crickets... any movement on this? |
i had a talk with him about this yesterday - they are working on it |
So basically the same situation as ever :-D |
I'll write a spec. We can call it CRSFv2. It will be the doc the ELRS team wrote up (CB?), but with the new additions in question, and it will be a single source of truth. |
If anything should be written up, it should be exactly what the current spec is, and then what the formal process should be for making additions with a system of peer review and comments-- like RFCs. Just dumping everyone's ideas directly into a new spec is utter chaos and good luck having any sort of support for new things any more because the spec is so wild that every RX / TX / Handset / FC / Telemetry Monitor supports some of it maybe. Nobody currently understands the protocol but they're going to immediately add things to it? There's also already a CRSFv2, and I believe CRSFv3 (partial). Unless you were making a joke about that. |
I agree with you. This thread is unproductive, and I'm astonished anyone's taking it seriously. |
As I like the way TBS CRSF works very much here is my personal opinion on this:
|
Ok, we've just started a draft. I hope we can get everyone on board: https://github.com/crsf-wg/crsf |
A note from my side. To make is swift, in a series of bullet points ;)
|
I agree take the Current elrs implementation and expand on it. With our cloud builder it’s very easy for it to diverge from CRSF |
is there any progress with extending the CRSF (or ELRSF/ELRS_PROT) extended telemetry |
This is the current WiP => #26 (comment) |
@tbs-trappy |
@offer-shmuely can you elaborate on what telemetry extensions. |
The crsf protocol is missing a lot of telemetry sensors for heli and planes (for quad it may be enough) For planes
For heli
I think it really need to be dynamic
So there is no extra data during flight |
Would need a reference manual for implementation on betaflight firmware side. |
...there's more. Need at least two temperature sensors for cylinder heads on large gassers, which is my current issue with CRSF telemetry. Four cylinder engines are less common, but two cylinders are very common. There should also be multiple current sensors; electric powertrain and other systems like radio. A comment as much to be a nudge on the issue, but more than one temp sensor for sure needed. |
https://github.com/tbs-fpv/tbs-crsf-spec/blob/main/crsf.md 648 days, Mercury has a day length of about 58.65 Earth so this took about 2 weeks on Mercury. |
Hi @tbs-fpv
Over time there have been a number of requests to make additions to the CRSF protocol. Most recently in mind was the addition of the 50mW to power level. Since then there have been more suggestion from various project maintainers, and it will be great to have a central location where these additions can be raised and discussed.
Is TBS interested in opening a repo which outlines the protocols frame type, address etc? Project maintainers from Betaflight, Ardu, ELRS, Rotorflight, BlueJay and more can then open PRs for discussion. It will also be a central point of truth for the protocol which maintainers can reference.
Looking forward to hearing your thoughts.
Cheers
Jye
The text was updated successfully, but these errors were encountered: