#Multiple UARTService
1 messages ยท Page 1 of 1 (latest)
Could you post the complete program for both sides of this connection (if they are both CircuitPython), and describe all the devices/computers you are using? Are you running this code on a host computer (using Blinka) or on a CircuitPython board? There have been issues with bleak (used under Blinka for BLE) and duplicate services.
post the programs as text, not screen shots. You can upload files using the + button to the left
This is what's running on as the central as on a nRF52840 Feather Express (where the issue is). It's a heavily modified version of a BLE example.
I have two Circuirt Playground Bluefruit boards running this.
I also have an explanation of what I'm doing, along with all of the code for the bluefruit, and working code for a desktop python app that uses Bleak up on github, if it helps: https://github.com/korn0055/big-red-bluetooth-buzzer
I could only get that desktop app to run reliable on a one of my PCs, which I no longer have. It's not clear how fleshed out support for multiple centrals is with bleak, so what I'm trying to do now is essentially port that app (desktop/button_central.py) to the nRF52840 Feather Express.
Thanks, I will look this over and try to reproduce, not immediately but soon. I'm not sure why the streams are getting linked, and will try to figure that out.
Awesome! I appreciate it!
I did try replacing lib/adafruit_ble/nordic.mpy with the .py version in order to make _server_rx and server_tx instance variables instead of class variables, but ran into some errors.
Let me know if there's anything you think I should try that would help you out. In general, should things work the same if you replace the .mpy with the .py version, or do you need to rebuild the whole bundle?
.py takes precedence. The easiest thing to do is to put the all .py adafruit_ble at the top level (not in the lib directory), then it will completely override what is in lib, due to the sys.path order. You can put in all kinds of print statements, experiment with the code, etc. If you want to turn off the .py version temporarily, just rename the adafruit_ble directory there so it won't be found on import.
That's a great tip! Is there any way to run a debugger on the nrf52?
there is no Python debugger; adding print statements is easy. One reason in CircuitPython we have ctrl-C terminate the current run instead of interrupting it is that the local variables cannot be accessed by name: that is a space & time opimization that MicroPython does that we inherit.