Skip to content

Conversation

@laurensvalk
Copy link
Member

@laurensvalk laurensvalk commented Jan 15, 2026

The NUS hasn't been used for a long time in Pybricks Code. We're only keeping it in the firmware because Pybricks Code raises an error if a hub doesn't have it.

Disabling it saves about +400 bytes on Move Hub and Technic Hub and helps simplify the firmware. By removing it we don't run untested code if someone connects to the advertised NUS service that isn't internally wired up to anything.


This is a draft/proposal. Not entirely sure if there are other pieces of the code that need changing too.


This is actually just a 3-line diff if you discount the indent changing.

+ // Nordic UART service is removed starting with Pybricks Profile v1.5.0
+ if (!semver.satisfies(softwareRevision, '^1.5.0')) {
    
    const uartService = ... // original code, indented.
    
+ }

This hasn't been used for a long time in Pybricks Code. We're only keeping it in the firmware because Pybricks Code raises an error otherwise.

Disabling it saves about +400 bytes on Move Hub and Technic Hub and helps simplify the firmware. By removing it we don't run untested code if someone connects to the advertised NUS service.
@dlech
Copy link
Member

dlech commented Jan 15, 2026

Since all of the tests are passing, I think this should be OK.

And given that we are going the AppData direction, I think it is OK to remove this from the firmware. No one has been asking to connect their NUS device to Pybricks hubs, and at the same time people seem OK with implementing Pybricks Profile on their ESP32.

@laurensvalk
Copy link
Member Author

Thanks for having a look.

Indeed. And between Spike hubs, we'll soon have RFCOMM for streaming data when BLE advertising doesn't cut it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants