taitberlette / wasp-os-companion

A simple companion application for wasp-os devices.
43 stars 18 forks source link

app can't connect to PineTime #7

Open junefish opened 1 year ago

junefish commented 1 year ago

I have a sealed PineTime that I just flashed to Wasp OS following these instructions. I can pair it fine with Siglo (on Linux) or Gadgetbridge (on Android), but wasp-os companion just says "failed to connect" when I hit the refresh button, without any other options.

I turned off bluetooth on my laptop, and deleted the watch from the list of devices in Gadgetbridge, to make sure neither interfered with the companion app.

I'm not sure what logs or other info would be helpful here but I made screen recordings:

dgallichan commented 11 months ago

I have exactly the same problem - and being new to anything like Dart, etc, it's very difficult for me to see in the code how it even determines if it can find a WaspOS device nearby or not...

taitberlette commented 11 months ago

Hi there! I'm so sorry to say that it's been quite a while since I've worked on this project, and unfortunately I am not able to put too much time into this project right now.

The code for the app is in two parts: the flutter/dart user interface, and a java backend that manages the Bluetooth connection to the watch. The two communicate using method channels in device.dart and MainActivity.java. The activity in MainActivity.java acts a bridge to the service in MyService.java, so the Bluetooth code can still run in the background when the activity (app) is closed. All the code relating to connecting to the watch is found in the service, although the code is rather messy. The watch is identified by it's name here, and then it calls the method here to actually connect.

My first thought would be to check to see if the name of the watch is either PineTime, P8, or K9, as at the time those were the names broadcasted by wasp-os, and how the app detects the watches. I'm sorry I can't be of more help right now, hopefully in the future I will have time to work on this project, but in the meantime I hope the overview of the Bluetooth connection will help you.

-Tait

dgallichan commented 11 months ago

Thanks Tait so much for the explanations - I hadn't found the java bits at all when looking before!

As far as I can tell from using Gadgetbridge and nRF Connect, the watch is indeed called 'PineTime' - which unfortunately means it doesn't look like it's a quick fix...

No worries about not having the time yourself to work on the project - it's already amazing that you've shared this much :)

pooriaahmadi commented 1 month ago

I found the problem! The new version of android seems to have changed the way you ask for Bluetooth permissions! So go to settings and allow access for nearby devices to the app manually and it should work after