cagnulein / qdomyos-zwift

Zwift bridge for smart treadmills and bike/cyclette
https://www.qzfitness.com/
GNU General Public License v3.0
434 stars 117 forks source link

Logs from T900C #13

Closed Martoni74 closed 4 years ago

Martoni74 commented 4 years ago

Hello,

thanks for the great work. I tested, by curiosity, with my Domyos T900C + RPi3 type B. It fail during the BLE discovery. (I switch on T900C, launch the latest release) Probably incompatible as it's older generation.

Here are the logs if it can helps : (didn't find anything else in /var/logs) I'm no more really familiar with C++ but happy to test if required.

sudo ./qdomyos-zwift Found new device: "Domyos-TC-1441" ( "00:00:0C:1B:15:01" ) qt.bluetooth: Using BlueZ LE DBus API Controller connected. Search services... serviceDiscovered "{00001801-0000-1000-8000-00805f9b34fb}" serviceDiscovered "{0000180a-0000-1000-8000-00805f9b34fb}" serviceDiscovered "{49535343-fe7d-4ae5-8fa9-9fafd205e455}" serviceScanDone stateChanged QLowEnergyService::ServiceState(DiscoveringServices) stateChanged QLowEnergyService::ServiceState(ServiceDiscovered) creating virtual treadmill interface... qt.bluetooth: Using BlueZ kernel ATT interface stateChanged QLowEnergyService::ServiceState(InvalidService)

cagnulein commented 4 years ago

Hi, from your log everything seems fine. From that point on you should find the virtual interface into zwift or "nRF Connect".

Martoni74 commented 4 years ago

Oh, one line was missing :-) "stateChanged QLowEnergyService::ServiceState(InvalidService) LowEnergy controller disconnected" then I come back to prompt.

If I make an hciconfig, I only have an "hci0: Type: Primary Bus: UART"

cagnulein commented 4 years ago

i guess something inside btinit() hangs the bluetooth stack of the T900C. In order to understand the issue i need a btsnoop_hci.log from a EConnected (Domyos app) session on Android. Could you get it? If you want i could follow you (maybe i could write it into the FAQ)

Otherwise we can play a little inside btinit() (for example, commenting line by line from the last to the top one) until we reach a stable behaviour, but we will blind on this way.

Martoni74 commented 4 years ago

I tried with my Xiaomi but I can't get this file even after enabling it in developper mode (not in /sdcard/ and no path in the /etc/bluetooth/bt_stack.conf). I will have a look with another phone (rooted) during the day.

cagnulein commented 4 years ago

ok thanks @Martoni74 . Sometimes you need to restart the phone before collecting the the log file (android seems to read the developer setting once on the startup). I'm using a Xiaomi Mi3 for this purpose.

cagnulein commented 4 years ago

@Martoni74 could you please try version 0.6.0? i guess i solved something for you too, thanks

Martoni74 commented 4 years ago

Thanks, I will try that this afternoon. (Sorry for the late reply, my second phone generating By logs had a bug with the Decathlon app) I keep you informed.

Martoni74 commented 4 years ago

Here is the error I get : pi@raspberrypi:~/qdomyos-zwift $ sudo ./qdomyos-zwift-v.6.0 qt.bluetooth.bluez: Bluez 5 detected. qt.bluetooth.bluez: Creating QtBluezDiscoveryManager qt.bluetooth.bluez: Discovered: "00:00:0C:1B:15:01" "Domyos-TC-1441" Num UUIDs 4 total device 0 cached RSSI 0 Class 0 "Sat Oct 10 14:34:32 2020Found new device: Domyos-TC-1441 (00:00:0C:1B:15:01)\n" qt.bluetooth.bluez: void QBluetoothDeviceDiscoveryAgentPrivate::stop() qt.bluetooth.bluez: Detecting bluetoothd version qt.bluetooth.bluez: Using /proc//exe qt.bluetooth.bluez: Detected bluetoothd version 5.50 qt.bluetooth.bluez: Bluetoothd: "5.50" qt.bluetooth: Using BlueZ LE DBus API qt.bluetooth.bluez: QLowEnergyControllerPrivateBluezDBus::connectToDevice() qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13 qt.bluetooth.bluez: BluetoothManagement: found random device "6E:24:4B:3B:13:95" qt.bluetooth.bluez: BluetoothManagement: found random device "12:76:4D:BC:C8:17" qt.bluetooth.bluez: BluetoothManagement: found random device "59:F3:58:6A:C9:A2" qt.bluetooth.bluez: BluetoothManagement: found random device "43:A3:AF:97:25:33" qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13 qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13 qt.bluetooth.bluez: BluetoothManagement: found random device "59:F3:58:6A:C9:A2" qt.bluetooth.bluez: BluetoothManagement: found random device "43:A3:AF:97:25:33" qt.bluetooth.bluez: BluetoothManagement: found random device "12:76:4D:BC:C8:17" qt.bluetooth.bluez: BluetoothManagement: found random device "6E:24:4B:3B:13:95" qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13 qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13 qt.bluetooth.bluez: BluetoothManagement: found random device "12:76:4D:BC:C8:17" qt.bluetooth.bluez: BluetoothManagement: found random device "59:F3:58:6A:C9:A2" qt.bluetooth.bluez: BluetoothManagement: found random device "6E:24:4B:3B:13:95" qt.bluetooth.bluez: BluetoothManagement: found random device "43:A3:AF:97:25:33" qt.bluetooth.bluez: BTLE_DBUS::connect() failed "org.freedesktop.DBus.Error.NoReply" "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." "Sat Oct 10 14:34:56 2020domyostreadmill::errorUnknownErrorUnknown Error\n" "Sat Oct 10 14:34:56 2020Cannot connect to remote device.\n" qt.bluetooth.bluez: Destroying QtBluezDiscoveryManager

I downloaded also version 0.5.0 but I get the massage disconnected. I wonder if it comes from the signal (my Rpi is on the other side of the wall - it's my home jeedom install).

cagnulein commented 4 years ago

Could you connect with the phone to the treadmill on the same spot of the rpi?

It seems a radio error, not a C++ one :)

cagnulein commented 4 years ago

With the nrf connect app I mean

Martoni74 commented 4 years ago

Thanks, in fact 0.4.0 was also not working so signal issue. I pulled a network cable and installed the RPi next to threadmill. Connection work and the threadmill stay at 1kmh (if I put loweror upper, it stays 1kmh). However it's detect as 0kmh in Zwift. after a few minutes, it stops : "Sat Oct 10 15:03:15 2020characteristicWritten f0 ac 9c\n" "Sat Oct 10 15:03:15 2020 << f0 bc 00 00 00 00 00 0a 00 00 00 00 00 00 00 00 00 00 00 00\n" "Sat Oct 10 15:03:15 2020 << 0a 01 00 00 01 c2\n" qt.bluetooth.bluez: HCI event triggered, type: 13 qt.bluetooth.bluez: Written Char: "{49535343-8841-43f4-a8d4-ecbe34729bb3}" "f0ac9c" "Sat Oct 10 15:03:16 2020characteristicWritten f0 ac 9c\n" qt.bluetooth.bluez: HCI event triggered, type: 13 qt.bluetooth.bluez: BluetoothManagement: Ignored event: c qt.bluetooth.bluez: HCI event triggered, type: 5 qt.bluetooth.bluez: ###### "org.bluez.Device1" QMap(("Connected", QVariant(bool, false))("ServicesResolved", QVariant(bool, false))) "Sat Oct 10 15:03:16 2020BTLE stateChanged InvalidService\n" "Sat Oct 10 15:03:16 2020LowEnergy controller disconnected\n" qt.bluetooth.bluez: Destroying QtBluezDiscoveryManager

I have to check my network and my laptop / test with the iPad. (My son is waking up, I will have a look this evening :-D )

cagnulein commented 4 years ago

Ok, one step further :) the next time upload the whole log file, it could be useful (with the 0.6 version I created a file for every session called debug-dateoftoday.log)

I'm going to a wedding party so have a nice day :)

cagnulein commented 4 years ago

If the speed buttons doesn't work is because the buttons have a specific code, so I have to managed. Upload the full log and tell me, more or less, when you have pressed the up and down button

cagnulein commented 4 years ago

@Martoni74 did you have a chance to try it again?

Martoni74 commented 4 years ago

Hi, Sorry for the delay, I had issues with the RPi. I've done tests but I'm not sure I receive anything when checking the logs. Here is the timeline of log file :

debug-Oct-13-2020_touch.log

cagnulein commented 4 years ago

@martoni74

  • 13:24 - press many times on "SPEED UP"

i saw the speed increasing by 0.1 km/h as expected from 1.0 to 1.6 kmh

  • 13:25 - press many times on "SPEED DOWN"

i saw the speed decreasing by 0.1 km/h as expected from 1.6 to 1.1km/h

  • 13:26 - press many times on "INCLINE UP"

i saw the inclination increasing by 0.5 degrees as expected,from 0 to 5 degrees

  • 13:27 - press many times on "INCLINE DOWN"

i saw the inclination decreasing by 0.5 degrees as expected,from 5 to 0 degrees

cagnulein commented 4 years ago

@Martoni74 if you try with 0.7.0 version you will see the values in the UI

Martoni74 commented 4 years ago

Great, As Zwift was staying at 0kmh, I was suspecting my threadmill. I will flash a new SD Card with Raspian to avoid conflict and try version 0.7.0

cagnulein commented 4 years ago

@Martoni74 bonus info: if you use nRF Connect from play store, you should connect to DomyosBridge and check the speed and the inclination that i pass to zwift (with zwift closed)

Martoni74 commented 4 years ago

Hi, after a clean setup, I confirm app works nice with the T900C. Now, it looks my RPi don't broadcast BT after connecting to the Threadmill. I can't detect anything with Zwift App (I tested on iPad, Win 10 and Macbook) as on nRF Connect. I probably have a bug on my RPi (I tried 3 power supply but doesn't help)

cagnulein commented 4 years ago

@Martoni74 sometimes it doens't discover it. When it happened i simply restart my app and it will be discovered (i have to fix it this weekend #28 ). Could you please try? Did you update everything on your raspi? bluez updated is very important

Martoni74 commented 4 years ago

@cagnulein I've done a quick test at lunch and I think it's a power issue with my RPi :

cagnulein commented 4 years ago
  • without GUI, I can run it smoothly however it's not broadcasting BT.

did you try to close it and reopen it? did you update bluez?

cagnulein commented 4 years ago

could you please try version 0.8.0 @Martoni74 ? I improved zwift connection

Martoni74 commented 4 years ago

Thanks I try that this evening. I see also you have a MacOS version, I can run that on my MBP along with Zwift ?

cagnulein commented 4 years ago

I don't know because I usually run zwift on my phone. Try and let me know but I guess it's quite impossible that zwift can run along this software @martoni74

Martoni74 commented 4 years ago

With version 8.0, i had to install libqt5xml5 package. However, I get a bluetooth error when loading - I think it's my RPi that have a bug. "Cannot find a running Bluez. Please check the Bluez installation. "Sun Oct 18 20:25:08 2020no bluetooth dongle found!\n" I will get a RPi at the office to make a comparison. (mine run with Jeedom, docker, ... since a few years now, probably not reliable for testing :-) )

I will test the MacOS version tomorrow evening. (have to install qt5 before) Thanks

cagnulein commented 4 years ago

With version 8.0, i had to install libqt5xml5 package.

Yes i wrote it in the readme

However, I get a bluetooth error when loading - I think it's my RPi that have a bug. "Cannot find a running Bluez. Please check the Bluez installation. "Sun Oct 18 20:25:08 2020no bluetooth dongle found!\n"

I guess it's something against blues. hciconfig works?

I will get a RPi at the office to make a comparison. (mine run with Jeedom, docker, ... since a few years now, probably not reliable for testing :-) )

Oky!

I will test the MacOS version tomorrow evening. (have to install qt5 before) Thanks

Perfect! Have a nice evening

cagnulein commented 4 years ago

I will test the MacOS version tomorrow evening. (have to install qt5 before) Thanks

see #31

Martoni74 commented 4 years ago

Hi Roberto, I have tested the version 0.8.0 on my 2nd RPi 3 : connection to T900C is good but still not visible on Zwift MacOS, PC, Android / iPad (no Zwift Bridge). I wonder if there is a limitation on RPi3 to connect + broadcast on Bluetooth

cagnulein commented 4 years ago

Hi Roberto, I have tested the version 0.8.0 on my 2nd RPi 3 : connection to T900C is good but still not visible on Zwift MacOS, PC, Android / iPad (no Zwift Bridge). I wonder if there is a limitation on RPi3 to connect + broadcast on Bluetooth

no, i tested myself a rpi3, it works. Did you update bluez as i described in the readme?

cagnulein commented 4 years ago

@Martoni74 any news?

Martoni74 commented 4 years ago

@cagnulein Hello, last week was busy with job, didn't found the time to test. I have re-organised all my "pain cave" this weekend to simplify troubleshooting. I created my account on QT and downloaded the full client. I will look in details this week with RPi and Mac.

cagnulein commented 4 years ago

@rickoneeleven post here your log, thanks

rickoneeleven commented 4 years ago

@cagnulein t900c, pi 3b (i think), setup only a couple of days ago, followed your instructions, updates plus dependencies.

started in gui mode, connected treadmill to pi (automatically happened), launched swift and connect it to pi.

treadmill started running at 0.1 i think it was, i took it up to 1.0 or 2.0, treadmill speeded up, but the chart in the gui stayed the same and zwift was still showing 0.0. disconnected zwift to see if it showed a quicker speed, but it showed 0kph in discovery. debug-Mon Nov 2 20_25_18 2020.log

cagnulein commented 4 years ago

@rickoneeleven I understood the issue: the data packet has been ignored. I will add some debug prints in order to understand better the issue and I will let you know when I'm ready. Thanks for the log

cagnulein commented 4 years ago

@rickoneeleven could you please try https://github.com/cagnulein/qdomyos-zwift/commit/d01514936594e4c8af5f6de8a50eaee6cdccb1af and send me the log? i don't change anything only add some debug print to understand better the issue. i guess it should be easy to solve

rickoneeleven commented 4 years ago

i went from 1.0, to 2.0, and incline up, think back down, and then speed back to 1.0 with latest git pull

debug-Mon Nov 2 21_41_15 2020.log

im going to bed now, but can play again tomorrow, thank you!

cagnulein commented 4 years ago

@rickoneeleven you didn't get the commit that I said. Please double check that you are using d015149

rickoneeleven commented 4 years ago

my bad, here you are debug-Tue Nov 3 07_02_10 2020.log

speed to 2.0, inc to 2.0, inc back to 0, speed back to 1

cagnulein commented 4 years ago

@rickoneeleven this is the previous version again :( Anyway i will add a fix and we will try with a final version.

rickoneeleven commented 4 years ago

PXL_20201103_071156542 it shouldn't be

cagnulein commented 4 years ago

@rickoneeleven try this one https://github.com/cagnulein/qdomyos-zwift/commit/8a248f7451ede9ccd7536e86c84f0b43ef5e683a I added a fix to get the T900C working (of course i didn't test it because i don't have this treadmill :) )

Please remove the directory and get a full clone of the repo, just to be sure and send me the log in any case

rickoneeleven commented 4 years ago

ahhh i've just thought, i never ran the make commands after last checkout, maybe that's what it's not got debug info, noted! i've just cloned the new build now and am currently making, standby

cagnulein commented 4 years ago

@rickoneeleven yes, you have always to make after pulling new commits

rickoneeleven commented 4 years ago

you've only gone and done it my friend! thank you ;D debug-Tue Nov 3 07_44_38 2020.log

cagnulein commented 4 years ago

@rickoneeleven great! does zwift work too?

rickoneeleven commented 4 years ago

it didn't on first launch (which the last logs are from), i closed the gui, started it again, it connected to zwift and treadmil, zwift displayed the speed of treadmill! 3 coffee's are with you, thanks again.

think ive just had seg error but not sure if i closed window by mistake, and it won't reconnect, probs just needs reboot but i need to get ready for work, ill player later!

thnaks R

cagnulein commented 4 years ago

@rickoneeleven thank you very much for the coffees! i leave this issue open waiting for @Martoni74 if you have any other issue, please feel free to write me.

rickoneeleven commented 4 years ago

no - thank you my friend. i left it running no-gui in the garage 5 minutes ago connected to zwift and treadmil after reboot, i'll check it in a bit and let you know if it stayed connected, cheers!