inonoob / pirowflo

All-in-one data interface for your Waterrower S4 Monitor or Smartrow
GNU General Public License v3.0
141 stars 31 forks source link

Issue with some apps not connecting to PiRowFo #34

Open inonoob opened 3 years ago

inonoob commented 3 years ago

Some apps don't connect to PiRowFlo via bluetooth.

if you try the app Waterrower connect, the app will see PiRowFlo but won't connect to it

the problem is that PiRowFlo or better say bluez is using Bluetooth classic at the same time as bluetooth Low energy. That is what makes all the apps going crazy and for some won't connect because they expect to only see a bluetooth low energy device.

In order to change this, we must start the bluetooth dongle in LE-only mode. But here is the catch if you use more than one bluetooth dongle, this is the case when you use smartrow, the setting only changes the setting for one dongle. The other still have the issue with bluetooth classic and bluetooth low energy enable.

How to correct this:

  1. for S4 Monitor only, only the /etc/bluetooth/main.conf has to be updated. It must be switch from dual to le
# Restricts all controllers to the specified transport. Default value
# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW).
# Possible values: "dual", "bredr", "le"
#ControllerMode = dual

2 for SmartRow the situation is more difficult. In order to correct that we need to download the latest version from bluez which is 5.56. Then we need to edit the main.conf:

static int get_mode(const char *str)
{
    if (strcmp(str, "dual") == 0)
        return BT_MODE_DUAL;
    else if (strcmp(str, "bredr") == 0)
        return BT_MODE_BREDR;
    else if (strcmp(str, "le") == 0)
        return BT_MODE_LE;

    error("Unknown controller mode \"%s\"", str);

    return BT_MODE_DUAL;
}

we change the default value from being BT_MODE_DUAL to only be BT_MODE_LE

then we have to recompile bluez 5.56 and install it on pirowflo to replace bluez 5.50.

This must be of course automated via the install.sh script which will lead to a first installation time being 15 to 20 min

mittelmo commented 3 years ago

Hey inonoob.

Great work on the project. I've been trying to set up the system with the WaterRowerConnect App. The Waterrower (s4 monitor) is recognized by the app and get's connected to it. However, no data seems to be arriving at the app. Your code also gives a warning: adapters.ble.waterrowerble - WARNING - no data from the s4 interface

Any idea why this is happening?

A bit of additional information:

Regarding your comments below:

Do you have any comments on the setup? Is the "beep" necessary or the "PC" light in the s4 monitor enough? (If so my next try would be to test other cables as perhaps I am using "power only" cables)

Many Thanks, mittelmo

inonoob commented 3 years ago

Hey

2 Things have you tried with coxswain if it is working? And when you connect the S4 and PiRowFlo start do you hear the beep from the S4 which is been reseted by PiRowFlo?

I will check this evening if I have the same issue

inonoob commented 3 years ago

Hey,

So I checked with Waterrower Connect. And it doesn't get the data. On iOS it is working but android it doesn't. I have check with:

Waterrower Connect is not working and I don't know why. I can see that it is asking for data and that the data are there from the S4 but I don't know why the Android version isn't working !

inonoob commented 3 years ago

Hey all,

The following progress has been made: I created an install script in order to download the latest bluez version and have all the configuration to compile and then install it. I also work on integrating the bluez installation script in the main install.ah script. This will check if the bluez version is lower as 5.56, if yes then get, compile and install bluez.

venturanc commented 3 years ago

Hi, hopefully I'm not looking in the wrong place, but I don't see that the project with the new install script is available here on github yet, right?

Without the new install script and without having updates for bluez or config changes, I'm having the following experience with troubleshooting (I think this is expected based on your comments above):

Setup: Raspberry Pi 3B, latest Raspberry Pi OS installed just last week, with a Garmin Ant+ (Dynastream) ant+ adaptor, connected to Waterrower S4 monitor. Started PiRowFlo in BLE/Ant+ mode. Verified that all BLE-connecting apps are disconnected and force-quit when attempting to trial a different app, and restarted multiple times to make sure that one connected app isn't stopping another app from making the connection.

Haven't tried Coxswain on android, or Waterrower Connect on iOS yet.

Thanks again! Seriously, even just getting the Ant+ data is a game-changer!

inonoob commented 3 years ago

Hey,

So the current status is:

I'm still fighting with Bluetooth on Linux. I never had though to start debugging Linux kernel stuff, modify source code and compile things my self just to make waterrower smart :)

I haven't upload or commit in a long time as this topics eats a lot of time !

inonoob commented 3 years ago

Hey,

so this is now I think third week in a row which I try to setup Bluez starting all the Bluetooth dongle in Bluetooth low energy only.

Bluetooth for Raspberry pi is a rabbit hole !!

So the vanilla Bluez implementation is a different one from the Raspberry pi one. The raspberry pi version uses old deprecated tools like hciattach and also the source code of hciattach has been changed.

Vanilla Bluez (not modification to the source code)

Raspberry pi Bluez:

I tried to set the raspberry pi version of Bluez5.50 to only start in Bluetooth LE only mode. I couldn't get it work! Like I said I might have look on the wrong spot but after 3 weeks I came to the conclusion I want to control the boot process for bluetooth module.

Here is the close to finish solution:

So further testing is needed.

best regards

mittelmo commented 3 years ago

Hey inonoob

Thanks for your support. I just wanted to let you know that I got it working on Windows Machine, running Debian with Raspberry Pi Desktop via Virtual Box. After some initial issues with the usb drivers & gatt and several restarts, I successfully connected and transmitted data from the s4 via bluetooth to the WaterRowerConnect app on iOS.

Best regards, mittelmo

inonoob commented 3 years ago

Perfect, nice to hear that the project is lifting of :)

jaquoh commented 2 years ago

Very nice project! I just tried it out, with a pi zero w and everything works fine. Waterrower beeps and I can receive the data via nrf connect on android. Unfortunately kinomap (which I like to use) does recognize the PiRowFlo but does not successfully connect to it. Can you share the install-bluez.sh script you mentioned? I would be happy to test if this fixes it. :)

JBlaak commented 2 years ago

Hi! Loving this project! I'm actually one of the developers behind the WaterRower Connect app, could you contact me at connect@waterrower.com so we can look into getting this project to work with both our Android and iOS app.

DANgerous25 commented 2 years ago

Hi, I'm wondering if the issues I'm experiencing relate to what you describe in this thread. I'm using a Pi4 and SmartRow only. I have tried with two apps:

1) Kinomap on IOS - in Kinomap using the FTMS protocol. I had this working once, which is when I reported it as good after an initial test. However, I can't get it working again. I can get Kinomap to see pirowflo until Smartrow connects. But either way, even though I can see data feeding into pirowflo, Kinomap doesn't get the data. Just zeros for everything.

2) EXR - EXR this week released version 1.6 on IOS which includes FTMS compatibility. When trying to connect to Pirowflo, EXR sees Pirowflo as a bluetooth device and allows you to pair. However, when you agree to pair you are prompted again to pair several times before it stops asking and appears to be paired. It's almost like the connection drops quickly. Even after saying "yes" to pair several times, EXR then loses connection and you have to initiate the pairing again. This all happens very quickly, I have not been able to get EXR to see any SmartRow data.

Admittedly EXR is very new, so might not work anyway, but I just wonder if the symptoms are the same for Kinomap and potentially other apps.

Also on the topic of EXR, I contacted them to see if there would be connectivity with pirowflo and smartrow. They said that they once had contact with the pirowflo developer but didnt' hear back. JFYI.

pi@pi1:~ $ bluetoothd -v 5.55

Do I need to upgrade bluetooth, and if so how do I do it? There are a couple of posts above but not sure which is current and how lasting the effects would be.

bchltz commented 1 year ago

After some months of not using the Pi I can't connect to Waterrower Connect any longer. Potentially due to app updates (I´m running 2.12.5 on iOS. I was able to connect to Kinomap, so the Bluetooth connection seems to work.

jcbigears commented 1 year ago

Hi, I'm wondering if the issues I'm experiencing relate to what you describe in this thread. I'm using a Pi4 and SmartRow only. I have tried with two apps:

  1. Kinomap on IOS - in Kinomap using the FTMS protocol. I had this working once, which is when I reported it as good after an initial test. However, I can't get it working again. I can get Kinomap to see pirowflo until Smartrow connects. But either way, even though I can see data feeding into pirowflo, Kinomap doesn't get the data. Just zeros for everything.
  2. EXR - EXR this week released version 1.6 on IOS which includes FTMS compatibility. When trying to connect to Pirowflo, EXR sees Pirowflo as a bluetooth device and allows you to pair. However, when you agree to pair you are prompted again to pair several times before it stops asking and appears to be paired. It's almost like the connection drops quickly. Even after saying "yes" to pair several times, EXR then loses connection and you have to initiate the pairing again. This all happens very quickly, I have not been able to get EXR to see any SmartRow data.

Admittedly EXR is very new, so might not work anyway, but I just wonder if the symptoms are the same for Kinomap and potentially other apps.

Also on the topic of EXR, I contacted them to see if there would be connectivity with pirowflo and smartrow. They said that they once had contact with the pirowflo developer but didnt' hear back. JFYI.

pi@pi1:~ $ bluetoothd -v 5.55

Do I need to upgrade bluetooth, and if so how do I do it? There are a couple of posts above but not sure which is current and how lasting the effects would be.

@DANgerous25 I have a similar setup. Just wondering if you got it working?

DANgerous25 commented 1 year ago

Hi, I'm wondering if the issues I'm experiencing relate to what you describe in this thread. I'm using a Pi4 and SmartRow only. I have tried with two apps:

  1. Kinomap on IOS - in Kinomap using the FTMS protocol. I had this working once, which is when I reported it as good after an initial test. However, I can't get it working again. I can get Kinomap to see pirowflo until Smartrow connects. But either way, even though I can see data feeding into pirowflo, Kinomap doesn't get the data. Just zeros for everything.
  2. EXR - EXR this week released version 1.6 on IOS which includes FTMS compatibility. When trying to connect to Pirowflo, EXR sees Pirowflo as a bluetooth device and allows you to pair. However, when you agree to pair you are prompted again to pair several times before it stops asking and appears to be paired. It's almost like the connection drops quickly. Even after saying "yes" to pair several times, EXR then loses connection and you have to initiate the pairing again. This all happens very quickly, I have not been able to get EXR to see any SmartRow data.

Admittedly EXR is very new, so might not work anyway, but I just wonder if the symptoms are the same for Kinomap and potentially other apps. Also on the topic of EXR, I contacted them to see if there would be connectivity with pirowflo and smartrow. They said that they once had contact with the pirowflo developer but didnt' hear back. JFYI. pi@pi1:~ $ bluetoothd -v 5.55 Do I need to upgrade bluetooth, and if so how do I do it? There are a couple of posts above but not sure which is current and how lasting the effects would be.

@DANgerous25 I have a similar setup. Just wondering if you got it working?

Hi, yes I did - but it was some time ago so I'm answering from memory and I'm sure things will have moved on since then. The short story is that shortly after trying to get this working, which I did (don't remember exactly how), but the numbers didn't seem very accurate so I gave up. Then not long after, SmartRow updated their app to make it compatible with the likes of KinoMap and EXR. I tried with both, only to be disappointed that my rowing didn't sync with that on the screen. So again I gave up.

So now I just use SmartRow without any bells/whistles or other apps. Actually I'm fine with it, I just row in front of TV/movie instead.

Sorry I can't be of more help.

jcbigears commented 1 year ago

@DANgerous25 Thanks for answering anyway. I have a spare Pi lying around so thought I'd give it a go. I'll let you know. John

DANgerous25 commented 1 year ago

If I recall correctly, the BlueTooth dongle that you use makes a big difference. I can't remember which one I got in the end, I think it was recommended in the project specs.

Good luck!