FRM
April 1, 2022, 10:04pm
1
Has anyone had luck with the bluetooth connectivity? My classroom computers have usb bluetooth dongles, and the “serial port over bluetooth” doesn’t show up as an option. Trying to use each COM port gives me an error message for each selectable port. Tutorial video has been watch and directions included followed, and still no connection.
Thanks for any help.
I recently made improvements to Bluetooth uploading in the BrickCode fork.
master ← THEb0nny:bluetooth-download-improvements
opened 12:06PM - 12 Aug 26 UTC
This PR improves Bluetooth deployment to the EV3 over Web Serial and makes the c… onnection and deployment flow more reliable.
Changes
- Rework the Web Serial transport around explicit connection states and a dedicated TransportManager.
- Improve Web Serial port handling, including automatic reuse of previously authorized ports and forced port selection when needed.
- Add handling for connection, permission and Bluetooth RFCOMM port errors, including retry support.
- Support project-specific deployment folders through the new deployFolder project option.
- Add RFCOMM communication support on the EV3 side by using the existing RFCOMM socket inherited from LMS2012.
- Add an RFCOMM receive thread that parses LEGO communication packets and handles multiple packets and fragmented reads.
- Add LEGO opNop handling to verify that the selected Web Serial port is actually connected to an EV3.
- Add PXT APP-specific RFCOMM ping and stop commands.
- Add request/reply handling for RFCOMM commands so the browser can confirm that the PXT APP received the stop command before continuing deployment.
- Detect whether a PXT APP is running before attempting to stop it, then continue with file removal, ELF/RBF upload and program execution.
- Improve command and reply logging in wrap.ts, including LEGO command/reply types, RFCOMM commands and reply statuses.
- Preserve DMESG logs between PXT APP launches to simplify debugging of Bluetooth/RFCOMM communication.
- Improve Bluetooth download troubleshooting instructions and clarify which EV3 applications and views should be closed before retrying.
- Update the Bluetooth download dialog and project initialization flow to support the new Web Serial deployment path.
- Deployment flow
The Web Serial deployment flow now verifies the EV3 connection first, checks whether the PXT APP is running, stops it when necessary, and then uploads the new ELF/RBF files and starts the program.
If the selected serial port does not respond as an EV3, the current deployment attempt is aborted and the transport is reset so that the browser can request a port again on the next attempt.
The changes started from this PR https://github.com/microsoft/pxt-ev3/pull/1035
Try it at https://beta.brickcode.org/