Open snhirsch opened 6 months ago
It's intended behavior for the basic implementation, the scanner stops while a device is connected and only resumes afterwards. There was never much interest in the autoconnect tool, so a multi device feature was never requested there and I didn't touch it for almost 3 years. That being said, the architecture with asyncio tasks should work well with multiple subprocesses, it's probably enough to remove the scanner stop line. Some extensions are needed just to make this more practical.
Thanks for the explanation! I looked at the code briefly and it doesn't look too bad to implement what you suggest. I am not familiar with Python threading, but I assume it has all the "usual" primitives for inter-thread serialization. Does the runtime quantize print output by line? If so, then your suggestion for prefixing the lines will be fine. I'd prefer them to be labeled by endpoint (e.g. BLE, BLE2, etc) since that's better for human interpretation than MAC addresses. Given the need for cross-platform support, the simpler the better.
I'm not sure if this is a bug or the intended behavior. I have two HM-10 devices active and have created a section in the autoconnect.ini file for each. One gets associated with the BLE virtual port and the other with BLE2. I have created both port pairs: BLE<-->COM7 and BL2<-->COM8. Both work individually if I connect manually, but with the autoconnect.py script only one of them (seemingly at random) is ever connected. After the connect it announces that it's entering the main loop and that's it! Shouldn't it continue the scan and also pickup the other device? Or, am I misunderstanding the purpose of the program?