-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Adds MSP to CRSF over TCP (WIFI) feature #1274
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
Conversation
|
@CapnBry make sure you do not have -DDEBUG_LOG otherwise it causes problems with the link. |
Ah crepes, PK, you're right. I did build it with DEBUG_LOG on like a damn fool. Works perfectly like it did when I tried it before the PR. Thank you! |
|
Ah sorry guys, yeah I should have mentioned! Betaflight does not like the debug output getting spit over serial. |
I wonder if on the RXes we could dual use the GPIO0 (boot pad) to be a soft serial for debug output. |
|
Not a bad idea, I've also gotten debug via websockets to work, so that's another option. |
I like the websockets, but the problem is that you can't really run wifi and the radio on the RX at the same time! |
|
Yeah, good point, but I don't think we tested that since you changed over to the async library. We should try it again. |
Ah, true. Perhaps I'll give that go later then. |
|
Can work with Inav? |
|
This doesn't support speedybee, and probably can't. Inav should work too, but there was some upstream changes needed in BF to fix MSP-CRSF encapsulation. Inav will probably be the same |
pkendall64
left a comment
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.
Basically just making the #ifdef's consistent
I am a fool novice, how can I turn off DEBUG_LOG? |
If you are using configurator then I think it's off already. |
|
Can this function also be achieved by connecting to the WIFI of the ELRS TX? |
No, that would require a whole lot more code to make happen, and the performance would be absolutely terrible. The configuration connection expects a pretty high bandwidth and low latency connection since it normally runs over serial. Running it over an extremely high latency link at ~5kbit throughput will cause Betaflight Configurator to timeout repeatedly and make a lot of redundant requests that will be discarded. There would be a lot of work needed in BF Configurator to be even tolerant of a low bandwidth high latency connection. It is just a mountain of work for both projects, and the user experience is going to still be pretty awful due to the link speed limitations like trying to stream full resolution video over a dialup modem. There are plenty of ESP-based ELRS RX that will support this though, so it isn't too much to ask of the user to just spend $15 on a new RX if they want this feature instead of getting it for free on old R9 hardware + TX MSP passthrough and then complaining about how terribly it works. |
adds lib adds msp<->crsf encap and decap lib base libs working lib updates lib updates fix test cases and mspv1 jumbo testing something more Update CRSF.cpp Update CRSF.cpp Add missing functions pushSize, popSize & peekSize Fix CRC8 being limited to 255 bytes size Add missing includes and members Fix unit test Fix compilation on different target platforms working fine with 4.3 RC2 revert unneeded define fix missing logging.h and line feed Fix compilation on non ESP based targets Fix RX as TX target
|
Not yet, I waitìng for the new version, that be add labrary tcp |
|
hmmm. I'm using 2.4.0 firmware version with betafpv nano rx and betaflight can't connect. |
|
This feature will not be available until release 3.0 |
|
Is it available in any other branch so I can merge it in my own?
|
No it's not on any other branch. All the changed files are in this PR, so you could try to put them into a 2.4 if you want to try it for yourself. |
Good to know. Thanks |
|
But as I can see this PR is already marked as merged |
Yes, to the master branch, which will become 3.0 when we are ready. |
So flashing rx with the master branch should make this feature available, right? |
You need to flash TX also or TX won't talk to the RX. At least I think so, OTA protocol has had some updates for 3.0 and I think it breaks compatibility with 2.x |
I guess TX is not needed in order this feature to work, but good to know it also have to be updated |
|
Great work! Hoping a mavlink2crsf (mavlink over expesslrs) version for ardupilot is coming. |
|
What would be needed to get this also working with INAV? |
|
Lost few hours intill I noticed that "Telemetry output" is not enabled in "Receiver tab" in Betaflight configurator in my ad-hoc setup... |
|
What's the baud rate of this serial over wifi connection? I use it for INAV configuration on my big planes and it can be a little slow. But that may be just wifi interference with such small wifi antennas. I was thinking of trying Airport for configuring at the bench. But is Wifi still wayyyy faster than Airport? This PR appears to be the only official documentation of this feature. Maybe after this I'll commit something to the docs. |
This feature does not work with inav. Inav is missing mspV2 support in mspOverCrsf implementation. Inav configurator is sending mspv2 packets. For inav you have to look at esp-link or bronebridge connected to msp uart. |
Slightly slower with eLRS than Crossifre and Tracer, so there was some modification recently in Betaflight to check the serial of the CRSF device - eLRS devices all have the serial EXPRESSLRS which can be used to tune throughput and avoid dropped MSP frames. |
|
I was intrigued by this and noticed that the original comment says "Has also been tested to work with betaflight configurator on Andriod. [sic]" Can anyone shed some light on what Android app works with this? It works very well on my computer at home, but it would be great if could be used at the field with an Android app! |
|
Can I flash firmware with it? |
It's built in to all V3 firmwares |
I mean Betaflight. Can I update betaflight using this? Via wifi? |
No, you cannot update betaflight firmware via the wifi connection. |
|
Hi there, and sorry for reviving such an old PR... |
Yes, MSP V1 Jumbo frames have the payload_size at index 3 set to 255, and the actual size is in the payload at index 5 & 6. Specified in the docs that you link to! |
Ah I totally misread that, thanks. I always thought that the length is set to 255, and then it's immediately followed by the actual size (i.e. before the command). |


Look ma, no cables!
Adds three new abstraction libraries:
msp2crsf
crsf2msp
tcpsocket
The first two libraries convert raw MSP() frames between MSP encapsulated CRSF frames and back. They support MSPv1 MSPV1Jumbo and MSPv2. Frames are automatically chunked into segments and reassembled as is required by the CRSF protocol. Buffers are sized to handle 512B MSP frames. tcpsocket provides an abstraction over the ESPAsyncTCP to buffer in/out frames. This can also be used to send arbitary MSP frames down the CRSF pipe, and we should try to migrate some of the CRSF CMD frames to MSP frames in the future. Eg the VTX commands.
The main immediate application is allowing betaflight configurator to be used wirelessly through any wifi-capable RX ExpressLRS receiver. Currently listens on port 5761 which is default for the TCP socket for BF configurator. The users needs to either type in the address of the receiver on the local network when on home wifi, or enter tcp://10.0.0.1 when in hotspot mode.
Demo:
Has also been tested to work with betaflight configurator on Andriod.
Known issues:
CLI doesn't work (there is currently no way encapsulate MSP frames to CLI)
Presets don't work (requires CLI)
Setting the target address as tcp://elrs_rx in betaflight configurator doesn't work as it doesn't try to resolve hostnames (upstream issue)