-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Workaround for MSP Connections over BLE #7783
Conversation
@Scavanger to be honest, I'm skeptical about this change. As long as possible, the client should care about this. FC is doing everything like it should be doing. |
@DzikuVx |
@Scavanger which MSP frame overflows the 340 limit? |
@DzikuVx Payload length is 448 bytes + MSP header |
Then maybe we shoult rework how this frame works. Because really, doing chunks on FW not on the serial driver level, is not the best idea |
@DzikuVx I now have three options:
|
To be fair, it's been that way since the dawn of computers LOL... users will never RTFM that's why that whole phrase existed. While i agree with you on this, IIRC BLE wasnt designed for heavy high speed links anyway, at least not on the serial port side.
i think this would be the better way to go about it especially as it's the only frame that is that long.
this will work and will be the easiest to implement, and of course, if we can bump the speed up even more eventually then this will get faster too.. i've not done much with BLE, but I am assuming that handshaking isnt going to be possible with something like XON/XOFF characters (the oldschool way) as i dont think there's anything RTS/CTS or DSR/DTR in BLE ? |
Just wanted to chime in with a few thoughts here.
Not only would they miss the note, but 9600 baud is really pretty low. Especially when most UARTs can handle 115200.
BLE can achieve some surprisingly high speeds. This article talks about how to optimize for throughput and this article talks about theoretical maximums. Under ideal conditions it should be possible to write up to 305,084 bits per second to a GATT attribute - more than 2x the max speed of a serial COM port. Also, don't forget that this is how the SpeedyBee App talks to iNav on iOS and Android.
From my limited understanding so far, I agree that this seems like a better choice if possible. It's unfortunate that this really comes down to the Chrome BLE stack and the older / cheaper BLE modules. I agree in theory that iNav Configurator shouldn't have any knowledge about the transport it's running on. But having a single tiny BLE device that can work with iOS and Android phones as well as full desktop configurator is incredibly valuable. IMO it's valuable enough for a less-than-tasteful software throttle if there's no other workaround. At least until the Chrome API or cheap BLE modules catch up. Thanks for considering this contribution, and THANK YOU sincerely @Scavanger for all your hard work! |
I see a second advantage to this. It would also mean that we can increase the number of available logic conditions. Pilots are asking for more. I did some experimenting a while back, and above 40 (I believe it was) logic conditions, it would lock up Configurator. But looping through each condition, this limit no longer exists. At least because of the MSP frames. One thing to be aware of. If this is to be done, it would be worth merging #7812 first (if the enhancement is wanted), as this changes the current MSP call. |
@MrD-RC I have already modified the MSP command accordingly, so MSP via BLE already works. Only with the CLI will we not be able to avoid tricking on the FC side. The BLE modules (HM-1X/HC-08/09) need, as I said, a short delay (20 - 30 ms) to empty their buffer, i.e. after each new line.
@jbienz |
I agree that this approach has some benefits:
The final item has advantages beyond this particular use case:
|
See #1441
Adds an MSP command so that the configurator can request that MSP frames are sent in chunks with defined size and delay, necessary for connection via some BLE modules.