Pinetime constantly displays passcode #8

Closed
opened 2022-01-20 14:58:12 +00:00 by johns · 10 comments

Built itd on PinePhone from git (e88dea40fb). PinePhone OS is Mobian.

PineTime is running Infinitime 1.8.0.

Start itd with systemctl --user start itd

itd starts successfully, and connects to the watch. But then the watch quickly starts displaying passcodes, repeatedly in succession, obstructing any other use.

Log below:

Jan 20 09:55:34 mobian systemd[597]: Started InfiniTime Daemon (itd).
Jan 20 09:55:44 mobian itd[72664]: 9:55AM ERR Error getting firmware version error="Operation failed with ATT error: 0x0e"
Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Connected to InfiniTime version=
Jan 20 09:55:44 mobian itd[72664]: 9:55AM ERR Error sending notification to InfiniTime error="not connected"
Jan 20 09:55:44 mobian itd[72664]: 9:55AM ERR Error setting current time on connected InfiniTime error="not connected"
Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Initialized InfiniTime music controls
Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Relaying calls to InfiniTime
Jan 20 09:55:44 mobian dbus-daemon[710]: [session uid=1000 pid=710] Connection :1.2942 (uid=1000 pid=72664 comm="itd ") became a monitor.
Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Relaying notifications to InfiniTime
Jan 20 09:55:44 mobian itd[72664]: 9:55AM WRN Error getting BLE filesystem error="not connected"
Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Started control socket path=/tmp/itd/socket

Built itd on PinePhone from git (e88dea40fbf920558e7655834f28917c2e4dafb8). PinePhone OS is Mobian. PineTime is running Infinitime 1.8.0. Start itd with systemctl --user start itd itd starts successfully, and connects to the watch. But then the watch quickly starts displaying passcodes, repeatedly in succession, obstructing any other use. Log below: Jan 20 09:55:34 mobian systemd[597]: Started InfiniTime Daemon (itd). Jan 20 09:55:44 mobian itd[72664]: 9:55AM ERR Error getting firmware version error="Operation failed with ATT error: 0x0e" Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Connected to InfiniTime version= Jan 20 09:55:44 mobian itd[72664]: 9:55AM ERR Error sending notification to InfiniTime error="not connected" Jan 20 09:55:44 mobian itd[72664]: 9:55AM ERR Error setting current time on connected InfiniTime error="not connected" Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Initialized InfiniTime music controls Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Relaying calls to InfiniTime Jan 20 09:55:44 mobian dbus-daemon[710]: [session uid=1000 pid=710] Connection :1.2942 (uid=1000 pid=72664 comm="itd ") became a monitor. Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Relaying notifications to InfiniTime Jan 20 09:55:44 mobian itd[72664]: 9:55AM WRN Error getting BLE filesystem error="not connected" Jan 20 09:55:44 mobian itd[72664]: 9:55AM INF Started control socket path=/tmp/itd/socket

Not a real solution, but probably a workaround:
Did you try adding your PT to the whitelist in the config file?

Not a real solution, but probably a workaround: Did you try adding your PT to the whitelist in the config file?

This likely has to do with the 1.8.0 infitime feature supporting secure bluetooth pairing.

The general idea is that itd should stop reconnecting when it detects that, so the user can input the pin into itd. Said pin then authenticates itd and should be stored in the config for further use

EDIT: A workaround would be to use something like "bluetoothctl" or another bluetooth manager to pair and connect it, handling the passcode and everything, then run itd (this should only really be needed the first pair)

This likely has to do with the 1.8.0 infitime feature supporting secure bluetooth pairing. The general idea is that itd should stop reconnecting when it detects that, so the user can input the pin into itd. Said pin then authenticates itd and should be stored in the config for further use EDIT: A workaround would be to use something like "bluetoothctl" or another bluetooth manager to pair and connect it, handling the passcode and everything, then run itd (this should only really be needed the first pair)

(I'm the OP) Can confirm that pairing and connecting with bluetoothctl works around the issue. Thanks!

(I'm the OP) Can confirm that pairing and connecting with bluetoothctl works around the issue. Thanks!
Owner

Yeah, I had to work around the fact that some DEs don't display the pin prompt properly by making my own bluez agent. The pairing code is currently not working very well. I am planning to work on that as soon as I have time.

Yeah, I had to work around the fact that some DEs don't display the pin prompt properly by making my own bluez agent. The pairing code is currently not working very well. I am planning to work on that as soon as I have time.
Owner

The general idea is that itd should stop reconnecting when it detects that

There is no way to detect the pin having been displayed. The way it works is that when you try to pair, and InfiniTime asks for a pin, it runs a callback that shows the prompt for the pin.

Currently the main issue I have is that my code was designed before the pairing feature, so it doesn't handle that very well. I've been trying to redesign the pairing and reconnect code, but haven't had enough time to debug it.

I should hopefully have some time to do it soon.

> The general idea is that itd should stop reconnecting when it detects that There is no way to detect the pin having been displayed. The way it works is that when you try to pair, and InfiniTime asks for a pin, it runs a callback that shows the prompt for the pin. Currently the main issue I have is that my code was designed before the pairing feature, so it doesn't handle that very well. I've been trying to redesign the pairing and reconnect code, but haven't had enough time to debug it. I should hopefully have some time to do it soon.
Owner

Not a real solution, but probably a workaround:
Did you try adding your PT to the whitelist in the config file?

The whitelist is meant to be used if you have multiple PineTimes and need to make sure it will only try to connect to specific ones. It won't help with this particular issue.

> Not a real solution, but probably a workaround: > Did you try adding your PT to the whitelist in the config file? > The whitelist is meant to be used if you have multiple PineTimes and need to make sure it will only try to connect to specific ones. It won't help with this particular issue.
Owner

I think what I will do for now, since InfiniTime has made pairing optional, is add a config option to disable pairing, and set the default to false until I can fix the code.

I think what I will do for now, since InfiniTime has made pairing optional, is add a config option to disable pairing, and set the default to false until I can fix the code.
Owner

I've rewritten the connect and reconnect code in 4c36144b0b. That should theoretically fix it. Please notify me if it doesn't.

Sorry that it took so long, I've had some mental health issues and I've only just been able to work on this today.

I've rewritten the connect and reconnect code in 4c36144b0b. That should theoretically fix it. Please notify me if it doesn't. Sorry that it took so long, I've had some mental health issues and I've only just been able to work on this today.
Elara6331 added the
Waiting For Info
Bug
labels 2022-02-22 00:22:06 +00:00
Owner

Closing as it appears to be fixed. If it is not, reopen or create a new issue and link to this one.

Closing as it appears to be fixed. If it is not, reopen or create a new issue and link to this one.
Elara6331 removed the
Waiting For Info
label 2022-02-22 19:47:46 +00:00

Built itd-git from AUR (2f14e70721) on Pinephone Pro w/ Manjaro/KDE.

I first started itd with my watch already paired, and the daemon was working just fine. However, upon walking some distance away from my phone, this exact issue (unending successive BLE pair-codes appearing on watch) occurs.

Restarting the daemon only causes it to crash with a single error: FTL Error connecting to InfiniTime error="Authentication Failed". Performing a full re-pair in bluetoothctl fixes this problem (until again walking too far away from the phone, and the process must be repeated).

So long as a close distance to the phone is maintained, this doesn't seem to be an issue.

Built itd-git from AUR (2f14e70721) on Pinephone Pro w/ Manjaro/KDE. I first started `itd` with my watch already paired, and the daemon was working just fine. However, upon walking some distance away from my phone, this exact issue (unending successive BLE pair-codes appearing on watch) occurs. Restarting the daemon only causes it to crash with a single error: `FTL Error connecting to InfiniTime error="Authentication Failed"`. Performing a full re-pair in `bluetoothctl` fixes this problem (until again walking too far away from the phone, and the process must be repeated). So long as a close distance to the phone is maintained, this doesn't seem to be an issue.
Sign in to join this conversation.
No description provided.