-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Question] Limiting connections to running hubs #86
Comments
Yes, we plan on making the hub no longer connectable once a program has started. |
Good to hear, could be interesting in shows otherwise 😄 |
I hope this feature is programmable, because there are cases where is useful to interact with the hub when the program run. |
@GianCann right now when you connect to hub while it's running it terminates the running processes. |
No, it's not true (at least with Powered Up Hub). |
Watch this video: Se CPlusHun send data to stdout (with Print command) ad you can connect device to read the data. If you disconnect the tablet and connect another tablet to the same BLE service, you continue to see the data output from the Hub. Only if you send CTRL+C you can stop the program (but you can catch the KeyboardInterrupt exception and manage as you want) |
That was my experience earlier, after pairing with the hub using the web editor the console logged the same message as hitting the stop button |
Seems like you're connecting through some other interface and not the pybrick web editor |
Yes @Nelvarion , |
This seems to be a limitation of the Web Bluetooth specification/implementation. Showing connected devices in the device chooser is by design: WebBluetoothCG/web-bluetooth#266. I haven't found a way to work around it (e.g. the Also see WebBluetoothCG/web-bluetooth#295 |
Can you even reject a connection attempt? What about the ability to manually add an item or array with a pre-defined name in our scripts, populate it with the desired devices MAC(s) and have it cross-checked when a device attempts to connect? |
Chromium doesn't actually create a 2nd connection to the hub. It shares the underlying OS connection between browser windows. So the hub has no way of knowing which browser window requests are coming from. So I don't think we can do anything in the firmware. Chromium has some new advertisement watcher APIs that could allow us scan devices differently, but I haven't really looked into it yet since they are still experimental and not available on all OSes. But that is probably the way forward eventually. Hubs stop advertising when a program is running, so other computers cannot find the hub at that point. The only problem, as I understand it, is multiple connections from the same computer. |
From my perspective as long as the hub is no longer discoverable after starting the program then there's no issue. |
Closing since this is working as much as it technically possible right now. Also see #262. |
Question
Are there any plans on protecting running hubs from outside connections?
Perhaps limiting pairing only to the computer used to flash the hub?
Context
After uploading a script to a hub and letting it run, you can open the editor and hijack the hub, stopping the running program and allowing you to run any other code.
The text was updated successfully, but these errors were encountered: