Skip to content

Conversation

@CapnBry
Copy link
Member

@CapnBry CapnBry commented Jun 2, 2025

This changes the TCP/IP socket used for doing MSP config over wifi to delay allocating its buffers and packet converters the first time a connection is established. Reduces RAM usage by 3632 bytes.

The code is barely changed, just moved all into the TCPSOCKET class. Companion to #3238 for getting back to stable amounts of RAM for the webui. I do solemnly swear this is the last 3.x PR I'll submit.

Testing

Use Betaflight 4.4.3 and Configurator 10.9.0.

It seems the Betaflight Configurator 10.10.0 application has removed the ability to connect to a tcp:// port, or at least I can't figure out what the new secret way is to do so. I had to use 10.9.0 to test. They do still appear to support sockets for SITL (and therefore it should still work), but I'm not sure how to get the 10.10.0 Configurator to accept an IP address, and also the mDNS doesn't autodetect the receiver, which the 10.9.0 Configurator does. An older Android 10.10.0-dev client works too (c97deaf).

I also found Betaflight 4.5.2 to really be troublesome to use a socket connection, so I tested with 4.4.3. The connection happens and data starts coming, but the Setup page never loads on 4.5.x. Even on 4.4.x sometimes it just immediately closes the connection, but reconnecting again it works fine. This happens even on older ExpressLRS versions.

Bugs

The old code was also leaking memory by not freeing the AsyncClient when it disconnected, but they're really small so it wasn't a huge deal. I fixed it anyway.

@haslinghuis
Copy link

In 10.10 you have to enable mDNS discovery in options tab.

@CapnBry
Copy link
Member Author

CapnBry commented Jun 2, 2025

In 10.10 you have to enable mDNS discovery in options tab.

Holy smokes how did you show up here so fast?! 😄 I had seen you mention that somewhere and I turned it on but I still do not see anything discovered (restarting everything multiple times as well). I'm not sure it makes much difference because I think there's a bug, probably on our side, that prevents the connection from working with 4.5.x anyways and I don't plan to look into it for our 3.x branch.

@pkendall64 pkendall64 merged commit a103c27 into ExpressLRS:3.x.x-maintenance Jun 3, 2025
48 checks passed
pkendall64 added a commit to pkendall64/ExpressLRS that referenced this pull request Jul 4, 2025
@CapnBry CapnBry deleted the tcp2crsf-dynamic branch October 25, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants