Open g12r opened 2 years ago
Hello, there are a few more things you could try.
The train filter itself is just a device name filter - based on the "intelino" prefix... so if that wouldn't work, it should still show up in the "Others" section.
I suggest poking a bit further with Bleak (as you already started), that should yield some results.
Btw. did Bleak scan find the train and you just wasn't able to connect?
If that is the case, we have a few more troubleshooting (raw) examples in our other repository (https://github.com/intelino-code/intelino-trainlib-async-py/tree/master/examples). The async library is a dependency of this non-async one.
scan.py
... that is using BleakScanner.discover()
If none of these raw / pure Bleak examples would work (especially if scanning doesn't show anything), there might be some lower-level issue with Bleak on the new M1 :-( ... as we haven't seen any issues on macs before.
I'm curious if this was resolved? Did it repro on any other m1? I have an m1 to hand but it would be a bit of a faff to check if it repros ....
@petrusek maybe this commit fixed it? https://github.com/hbldh/bleak/pull/692 if I am scanning this correctly. looks like #692 went into the 0.14.x releases.
Thanks for the info @guoruicodes Unfortunately we don't advertise any services. Custom (non-standard) services have long uuids and the length of advertisement packets is very limited. This https://github.com/hbldh/bleak/pull/753 shines a ray of hope for our case, we just need to wait for macOS 12.3 to come out of beta.
Any guidance on what to troubleshoot if scan never finds the train? I've made sure it's not connected via Bluetooth, connected to another device, power cycled pc and train. Repeated all of this multiple times, repeated python env setup as well. Train works fine no-screen mode, with the phone app as well.
Attempting this on a m1 MacBook, macOS 12.1, python 3.10.0. Did all of the venv/pip steps, no issues. Terminal will request permissions, so it has it. Tried running from cmd line and PyEnv. I don't seem to be getting any environment issues, no weird exceptions... it just never finds anything.
I tried a test with just Bleak and wasn't able to connect at that layer, but I wasn't able to get it to connect. I was using the guid that shows up in BlueSee as the address to connect, but it wasn't
With Bleak logging on, output is below.
Tried to see if any different behavior via TrainScanner directly...
test2.py:
Same results, nothing found.
Ultimately, it seems like there's a basic issue finding the train at any level. It's working and connecting via other BLE utlls.