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

Toorx TRX Route Key #15

Closed jampy closed 3 years ago

jampy commented 4 years ago

I saw your comment on https://www.runningforum.it/viewtopic.php?p=2406295&sid=a47271253baef7f6a8259d9d0ade916f#p2406295 and I'd be happy if you could help me reverse-engineer the Bluetooth protocol of the TRX Route Key. I tried to contact Toorx/Garlando, but they did not respond.

I'm not sure if I want to use Zwift but in the first place I'd like to collect distance/incline data from the threadmill using a Raspberry Pi.

I have an Samsung S7 phone (Android 8) and a Huawei Mediapad M5 lite but I have no idea how to sniff the bluetooth traffic. Can you give me some hints?

Thanks.

cagnulein commented 4 years ago

@jampy here the libs https://we.tl/t-SoEO8lXfJz This link will expired the 23th of October, so please download it ASAP

drainuzzo commented 4 years ago

Hello next days I would try my Toorx TR with bt key TRX App Gate USB, I don't know if it would work like the Route KEY.

So I have a Raspberry 3 and 4 I can try compiling the code from there? Then I should try to use the Toorx with Zwift and check the logs on the Raspberry?

cagnulein commented 4 years ago

@drainuzzo hi, first of all try this binary https://github.com/cagnulein/qdomyos-zwift/raw/toorx/src/qdomyos-zwift

If you have the same issue as @jampy then use the new binary built against at 5.15.1 and download the libraries from my previous comment.

I'm very curious

jampy commented 4 years ago

@jampy here the libs https://we.tl/t-SoEO8lXfJz This link will expired the 23th of October, so please download it ASAP

downloading & exctracting right now...

will try later today...

jampy commented 4 years ago
root@raspberrypi:/home/pi# md5sum qdomyos-zwift.bin
40003cf34793e9a98481e60903b371e1  qdomyos-zwift.bin
root@raspberrypi:/home/pi# LD_LIBRARY_PATH=$PWD/QT-BUILD-cagnulein/opt/Qt5.15/lib/ ./qdomyos-zwift.bin -no-gui
qt.bluetooth.bluez: Bluez 5 detected.
qt.bluetooth.bluez: Creating QtBluezDiscoveryManager
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: BluetoothManagement: found random device "31:66:62:E0:F3:30"
qt.bluetooth.bluez: Discovered:  "31-66-62-E0-F3-30" "31:66:62:E0:F3:30" Num UUIDs 0 total device 0 cached RSSI -68 Num ManufacturerData 1
"Mon Oct 19 15:00:37 2020Found new device: 31-66-62-E0-F3-30 (31:66:62:E0:F3:30)\n"
qt.bluetooth.bluez: BluetoothManagement: found random device "1B:B5:EF:7D:A9:0F"
qt.bluetooth.bluez: Discovered:  "1B-B5-EF-7D-A9-0F" "1B:B5:EF:7D:A9:0F" Num UUIDs 0 total device 1 cached RSSI -71 Num ManufacturerData 1
"Mon Oct 19 15:00:37 2020Found new device: 1B-B5-EF-7D-A9-0F (1B:B5:EF:7D:A9:0F)\n"
qt.bluetooth.bluez: Discovered:  "TRX ROUTE KEY" "34:81:F4:30:0D:FD" Num UUIDs 2 total device 2 cached RSSI -52 Num ManufacturerData 1
"Mon Oct 19 15:00:43 2020Found new device: TRX ROUTE KEY (34:81:F4:30:0D:FD)\n"
qt.bluetooth.bluez: void QBluetoothDeviceDiscoveryAgentPrivate::stop()
"Mon Oct 19 15:00:43 2020Found new device: TRX ROUTE KEY (34:81:F4:30:0D:FD)\n"
qt.bluetooth.bluez: Discovered:  "TRX ROUTE KEY" "34:81:F4:30:0D:FD" Num UUIDs 2 total device 0 cached RSSI 0 Num ManufacturerData 1
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: Discovered:  "PETER-CLAUS" "80:86:F2:B2:5D:3A" Num UUIDs 0 total device 1 cached RSSI -73 Num ManufacturerData 0
qt.bluetooth.bluez: Updating RSSI for "80:86:F2:B2:5D:3A" QVariant(short, -62)
qt.bluetooth.bluez: Almost Duplicate  "80:86:F2:B2:5D:3A" "PETER-CLAUS" - replacing in place
qt.bluetooth.bluez: Updating RSSI for "34:81:F4:30:0D:FD" QVariant(short, -53)
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: Updating RSSI for "80:86:F2:B2:5D:3A" QVariant(short, -62)
qt.bluetooth.bluez: Updating RSSI for "34:81:F4:30:0D:FD" QVariant(short, -46)
qt.bluetooth.bluez: Discovery on:  "80:86:F2:B2:5D:3A" Mode: QBluetoothServiceDiscoveryAgent::FullDiscovery
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
SDP for 80:86:F2:B2:5D:3A B8:27:EB:9C:37:E2
qt.bluetooth.bluez: BluetoothManagement: Ignored event: b
Using PUBLIC_BROWSE_GROUP for SDP search
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Service Discovery" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001000-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Device ID Service Record" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001200-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Personal Ad Hoc User Service" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001115-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Source" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110a-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Video Remote Control Profile" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110c-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110e-0000-1000-8000-00805f9b34fb}", "{0000110f-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Sink" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110b-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000111f-0000-1000-8000-00805f9b34fb}", "{00001203-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000111e-0000-1000-8000-00805f9b34fb}", "{00001203-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Custom Service" "{c7f94713-891e-496a-a0e7-983a0946126e}" >>> ()
qt.bluetooth.bluez: Discovery on:  "34:81:F4:30:0D:FD" Mode: QBluetoothServiceDiscoveryAgent::FullDiscovery
SDP for 34:81:F4:30:0D:FD B8:27:EB:9C:37:E2
qt.bluetooth.bluez: BluetoothManagement: Ignored event: b
Using PUBLIC_BROWSE_GROUP for SDP search
qt.bluetooth.bluez: Discovered services "34:81:F4:30:0D:FD" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001200-0000-1000-8000-00805f9b34fb}")
"Mon Oct 19 15:01:05 2020Found new service: ({00000000-0000-0000-0000-000000000000})\n"
qt.bluetooth.bluez: Discovered services "34:81:F4:30:0D:FD" "SerialPort" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001101-0000-1000-8000-00805f9b34fb}")
"Mon Oct 19 15:01:05 2020Found new service: SerialPort({00000000-0000-0000-0000-000000000000})\n"
"Mon Oct 19 15:01:05 2020Serial port service found\n"
qt.bluetooth.bluez: void QBluetoothServiceDiscoveryAgentPrivate::stop() Stop called
qt.bluetooth.bluez: Detecting bluetoothd version
qt.bluetooth.bluez: Using /proc/<pid>/exe
qt.bluetooth.bluez: Detected bluetoothd version 5.50
qt.bluetooth.bluez: Bluetoothd: "5.50"
qt.bluetooth: Using Bluetooth dbus socket implementation
"Mon Oct 19 15:01:05 2020Create socket\n"
qt.bluetooth.bluez: Registering client profile on "/qt/btsocket/qdomyos_zwift_bin3320/554395985" with options:
qt.bluetooth.bluez: QMap(("Name", QVariant(QString, "QBluetoothSocket-3320"))("Role", QVariant(QString, "client"))("Service", QVariant(QString, "00001101-0000-1000-8000-00805f9b34fb")))
"Mon Oct 19 15:01:06 2020ConnectToService done\n"
ASSERT failure in QList<T>::at: "index out of range", file /home/pi/qt/qt-everywhere-src-5.15.1/qtbase/include/QtCore/../../src/corelib/tools/qlist.h, line 571
Aborted

Or with gdb:

root@raspberrypi:/home/pi# gdb --args ./qdomyos-zwift.bin -no-gui
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./qdomyos-zwift.bin...done.
(gdb) set environment LD_LIBRARY_PATH="/home/pi/QT-BUILD-cagnulein/opt/Qt5.15/lib/"
(gdb) r
Starting program: /home/pi/qdomyos-zwift.bin -no-gui
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x732853c0 (LWP 3625)]
qt.bluetooth.bluez: Bluez 5 detected.
qt.bluetooth.bluez: Creating QtBluezDiscoveryManager
qt.bluetooth.bluez: Discovered:  "34:81:F4:30:0D:FD" "TRX ROUTE KEY" Num UUIDs 2 total device 0 cached RSSI 0 Class 2360324
"Mon Oct 19 15:09:46 2020Found new device: TRX ROUTE KEY (34:81:F4:30:0D:FD)\n"
qt.bluetooth.bluez: void QBluetoothDeviceDiscoveryAgentPrivate::stop()
"Mon Oct 19 15:09:46 2020Found new device: TRX ROUTE KEY (34:81:F4:30:0D:FD)\n"
qt.bluetooth.bluez: Discovered:  "34:81:F4:30:0D:FD" "TRX ROUTE KEY" Num UUIDs 2 total device 0 cached RSSI 0 Class 2360324
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: Updating RSSI for "34:81:F4:30:0D:FD" QVariant(short, -49)
qt.bluetooth.bluez: Discovered:  "80:86:F2:B2:5D:3A" "PETER-CLAUS" Num UUIDs 6 total device 1 cached RSSI -60 Class 2752780
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: Updating RSSI for "80:86:F2:B2:5D:3A" QVariant(short, -62)
qt.bluetooth.bluez: Updating RSSI for "34:81:F4:30:0D:FD" QVariant(short, -46)
qt.bluetooth.bluez: Discovery on:  "80:86:F2:B2:5D:3A" Mode: QBluetoothServiceDiscoveryAgent::DiscoveryMode(FullDiscovery)
[Detaching after fork from child process 3647]
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
SDP for 80:86:F2:B2:5D:3A B8:27:EB:9C:37:E2
qt.bluetooth.bluez: BluetoothManagement: Ignored event: b
Using PUBLIC_BROWSE_GROUP for SDP search
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Service Discovery" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001000-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Device ID Service Record" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001200-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Personal Ad Hoc User Service" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001115-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Source" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110a-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Video Remote Control Profile" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110c-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110e-0000-1000-8000-00805f9b34fb}", "{0000110f-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Sink" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110b-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000111f-0000-1000-8000-00805f9b34fb}", "{00001203-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000111e-0000-1000-8000-00805f9b34fb}", "{00001203-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "CDP Proximal Transport" "{00000000-0000-0000-0000-000000000000}" >>> ("{c7f94713-891e-496a-a0e7-983a0946126e}")
qt.bluetooth.bluez: Discovery on:  "34:81:F4:30:0D:FD" Mode: QBluetoothServiceDiscoveryAgent::DiscoveryMode(FullDiscovery)
[Detaching after fork from child process 3649]
SDP for 34:81:F4:30:0D:FD B8:27:EB:9C:37:E2
qt.bluetooth.bluez: BluetoothManagement: Ignored event: b
Using PUBLIC_BROWSE_GROUP for SDP search
qt.bluetooth.bluez: Discovered services "34:81:F4:30:0D:FD" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001200-0000-1000-8000-00805f9b34fb}")
"Mon Oct 19 15:10:09 2020Found new service: ({00000000-0000-0000-0000-000000000000})\n"
qt.bluetooth.bluez: Discovered services "34:81:F4:30:0D:FD" "SerialPort" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001101-0000-1000-8000-00805f9b34fb}")
"Mon Oct 19 15:10:09 2020Found new service: SerialPort({00000000-0000-0000-0000-000000000000})\n"
"Mon Oct 19 15:10:09 2020Serial port service found\n"
qt.bluetooth.bluez: void QBluetoothServiceDiscoveryAgentPrivate::stop() Stop called
"Mon Oct 19 15:10:09 2020Create socket\n"
"Mon Oct 19 15:10:09 2020ConnectToService done\n"

Thread 1 "qdomyos-zwift.b" received signal SIGSEGV, Segmentation fault.
0x7650367c in QBluetoothDeviceInfo::operator=(QBluetoothDeviceInfo const&) () from /usr/lib/arm-linux-gnueabihf/libQt5Bluetooth.so.5
(gdb) thread apply all bt

Thread 2 (Thread 0x732853c0 (LWP 3625)):
#0  __GI___poll (timeout=-1, nfds=2, fds=0x7290ca48) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  __GI___poll (fds=0x7290ca48, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:26
#2  0x7557aeb4 in ?? () from /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x76ff2290 (LWP 3622)):
#0  0x7650367c in QBluetoothDeviceInfo::operator=(QBluetoothDeviceInfo const&) () from /usr/lib/arm-linux-gnueabihf/libQt5Bluetooth.so.5
#1  0x765513b4 in ?? () from /usr/lib/arm-linux-gnueabihf/libQt5Bluetooth.so.5
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Please notice the index out of range in the first run (without gdb).

cagnulein commented 4 years ago

@jampy gdb says /usr/lib/arm-linux-gnueabihf/libQt5Bluetooth.so.5 i guess there is some issue on the linking, it still use your system library. Could you check it?

jampy commented 4 years ago

gdb says /usr/lib/arm-linux-gnueabihf/libQt5Bluetooth.so.5 i guess there is some issue on the linking, it still use your system library. Could you check it?

Apparently set environment LD_LIBRARY_PATH="/home/pi/QT-BUILD-cagnulein/opt/Qt5.15/lib/" did not have the desired effect.

If I omit the quotes, then the program runs incredibly slow and at some point gdb crashes.

Dunno how to force the Qt lib path during a gdb session (I use that thing very rarely)...

cagnulein commented 4 years ago

If I omit the quotes, then the program runs incredibly slow and at some point gdb crashes.

i think that it's the correct behaviour, infact the debug library are slower than the normal ones.

I guess it's a matter of RAM: "dmesg" says something after the gdb crash? If it's a RAM issue, you can try increasing your swap space.

Do you have a mac? We could try to run on it just to debug it...

jampy commented 4 years ago
root@raspberrypi:/home/pi# gdb --args ./qdomyos-zwift.bin -no-gui
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./qdomyos-zwift.bin...done.
(gdb) set environment LD_LIBRARY_PATH=/home/pi/QT-BUILD-cagnulein/opt/Qt5.15/lib/
(gdb) r
Starting program: /home/pi/qdomyos-zwift.bin -no-gui
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0x726d93b0 (LWP 4796)]
qt.bluetooth.bluez: Bluez 5 detected.
qt.bluetooth.bluez: Creating QtBluezDiscoveryManager
qt.bluetooth.bluez: Discovered:  "TRX ROUTE KEY" "34:81:F4:30:0D:FD" Num UUIDs 3 total device 0 cached RSSI 0 Num ManufacturerData 1
"Mon Oct 19 20:51:31 2020Found new device: TRX ROUTE KEY (34:81:F4:30:0D:FD)\n"
qt.bluetooth.bluez: void QBluetoothDeviceDiscoveryAgentPrivate::stop()
"Mon Oct 19 20:51:31 2020Found new device: TRX ROUTE KEY (34:81:F4:30:0D:FD)\n"
qt.bluetooth.bluez: Discovered:  "TRX ROUTE KEY" "34:81:F4:30:0D:FD" Num UUIDs 3 total device 0 cached RSSI 0 Num ManufacturerData 1
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: Updating RSSI for "34:81:F4:30:0D:FD" QVariant(short, -55)
qt.bluetooth.bluez: Discovered:  "[TV]Samsung LED40" "5C:F6:DC:40:EB:A9" Num UUIDs 3 total device 1 cached RSSI -74 Num ManufacturerData 1
qt.bluetooth.bluez: Discovered:  "PETER-CLAUS" "80:86:F2:B2:5D:3A" Num UUIDs 6 total device 2 cached RSSI -74 Num ManufacturerData 0
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: Updating RSSI for "80:86:F2:B2:5D:3A" QVariant(short, -82)
qt.bluetooth.bluez: Updating RSSI for "34:81:F4:30:0D:FD" QVariant(short, -46)
qt.bluetooth.bluez: Updating RSSI for "5C:F6:DC:40:EB:A9" QVariant(short, -80)
qt.bluetooth.bluez: Discovery on:  "80:86:F2:B2:5D:3A" Mode: QBluetoothServiceDiscoveryAgent::FullDiscovery
[New Thread 0x76fef010 (LWP 4852)]
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
process 4792 is executing new program: /home/pi/QT-BUILD-cagnulein/opt/Qt5.15/bin/sdpscanner

[1]+  Stopped                 gdb --args ./qdomyos-zwift.bin -no-gui
root@raspberrypi:/home/pi# dmesg | tail
[   32.985436] Bluetooth: HCI UART protocol H4 registered
[   32.985487] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   32.985626] Bluetooth: HCI UART protocol Broadcom registered
[   33.262911] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   33.262921] Bluetooth: BNEP filters: protocol multicast
[   33.262938] Bluetooth: BNEP socket layer initialized
[   33.325262] Bluetooth: RFCOMM TTY layer initialized
[   33.325298] Bluetooth: RFCOMM socket layer initialized
[   33.325327] Bluetooth: RFCOMM ver 1.11
[   40.905619] fuse: init (API version 7.31)
root@raspberrypi:/home/pi#

Why did it stop (wasn't me)? No clue... Let's bring it to foreground..

root@raspberrypi:/home/pi# fg 1
gdb --args ./qdomyos-zwift.bin -no-gui
Error while reading shared library symbols for /lib/arm-linux-gnueabihf/libpthread.so.0:
Cannot find user-level thread for LWP 4852: generic error
SDP for 80:86:F2:B2:5D:3A B8:27:EB:9C:37:E2
qt.bluetooth.bluez: BluetoothManagement: Ignored event: b
Using PUBLIC_BROWSE_GROUP for SDP search
[LWP 4852 exited]
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Service Discovery" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001000-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Device ID Service Record" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001200-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Personal Ad Hoc User Service" "{00000000-0000-0000-0000-000000000000}" >>> ("{00001115-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Source" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110a-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Video Remote Control Profile" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110c-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110e-0000-1000-8000-00805f9b34fb}", "{0000110f-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Audio Sink" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000110b-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000111f-0000-1000-8000-00805f9b34fb}", "{00001203-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "" "{00000000-0000-0000-0000-000000000000}" >>> ("{0000111e-0000-1000-8000-00805f9b34fb}", "{00001203-0000-1000-8000-00805f9b34fb}")
qt.bluetooth.bluez: Discovered services "80:86:F2:B2:5D:3A" "Custom Service" "{c7f94713-891e-496a-a0e7-983a0946126e}" >>> ()
qt.bluetooth.bluez: Discovery on:  "5C:F6:DC:40:EB:A9" Mode: QBluetoothServiceDiscoveryAgent::FullDiscovery
Segmentation fault
root@raspberrypi:/home/pi# dmesg | tail
[   32.985436] Bluetooth: HCI UART protocol H4 registered
[   32.985487] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   32.985626] Bluetooth: HCI UART protocol Broadcom registered
[   33.262911] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   33.262921] Bluetooth: BNEP filters: protocol multicast
[   33.262938] Bluetooth: BNEP socket layer initialized
[   33.325262] Bluetooth: RFCOMM TTY layer initialized
[   33.325298] Bluetooth: RFCOMM socket layer initialized
[   33.325327] Bluetooth: RFCOMM ver 1.11
[   40.905619] fuse: init (API version 7.31)

Does not look like a RAM issue...

Do you have a mac? We could try to run on it just to debug it...

I have a Mac Mini, but seldomly use it. I'm not sure what you what use you have for it..?

cagnulein commented 4 years ago

@jampy I'm really out of ideas, let's wait for @drainuzzo and see if he will have the same behavior

cagnulein commented 4 years ago

I have a Mac Mini, but seldomly use it. I'm not sure what you what use you have for it..?

@jampy you could install Qt on Mac as i described on the readme and you could build with qt creator the project. On my MacBook Air works flawless, so it should be easy to debug it. What do you think?

jampy commented 4 years ago

@jampy you could install Qt on Mac as i described on the readme and you could build with qt creator the project. On my MacBook Air works flawless, so it should be easy to debug it. What do you think?

okay, but this could take a couple of days, because the Mac and the Threadmill are at distant places and I'm currently very busy at work. Will try...

cagnulein commented 4 years ago

@jampy oky, i'm not in a hurry 😃 In the meanwhile, maybe @drainuzzo will reappear 😸

drainuzzo commented 4 years ago

My qdomyos-zwift run! But I cannot see a valid connection to my TR and app doesn't enable TR

"FF:90:CE:BE:F5:FC" "TOORX0083" seems my Toorx App Gate device

pi@raspberrypi:~ $ ./qdomyos-zwift libEGL warning: DRI2: failed to authenticate qt5ct: using qt5ct plugin qt.bluetooth.bluez: Bluez 5 detected. qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. Cannot determine whether a found address is of random or public type. qt.bluetooth.bluez: Creating QtBluezDiscoveryManager qt.bluetooth.bluez: Discovered: "7E:6A:3F:61:83:27" "7E-6A-3F-61-83-27" Num UUIDs 0 total device 0 cached RSSI 0 Class 0 "Wed Oct 21 20:09:30 2020Found new device: 7E-6A-3F-61-83-27 (7E:6A:3F:61:83:27)\n" qt.bluetooth.bluez: Discovered: "A4:C1:38:CE:A4:28" "LYWSD03MMC" Num UUIDs 0 total device 1 cached RSSI 0 Class 0 "Wed Oct 21 20:09:30 2020Found new device: LYWSD03MMC (A4:C1:38:CE:A4:28)\n" qt.bluetooth.bluez: Discovered: "A4:C1:38:D9:02:06" "LYWSD03MMC" Num UUIDs 0 total device 2 cached RSSI 0 Class 0 "Wed Oct 21 20:09:30 2020Found new device: LYWSD03MMC (A4:C1:38:D9:02:06)\n" qt.bluetooth.bluez: Discovered: "C4:FC:E8:A6:95:04" "RunScribe-06FE" Num UUIDs 4 total device 3 cached RSSI 0 Class 0 "Wed Oct 21 20:09:30 2020Found new device: RunScribe-06FE (C4:FC:E8:A6:95:04)\n" qt.bluetooth.bluez: Discovered: "FD:61:AE:2F:59:79" "RunScribe-C670" Num UUIDs 4 total device 4 cached RSSI 0 Class 0 "Wed Oct 21 20:09:30 2020Found new device: RunScribe-C670 (FD:61:AE:2F:59:79)\n" qt.bluetooth.bluez: Discovered: "FF:90:CE:BE:F5:FC" "TOORX0083" Num UUIDs 1 total device 5 cached RSSI -72 Class 0 "Wed Oct 21 20:09:31 2020Found new device: TOORX0083 (FF:90:CE:BE:F5:FC)\n" qt.bluetooth.bluez: Discovered: "1B:FA:B3:76:52:E0" "1B-FA-B3-76-52-E0" Num UUIDs 0 total device 6 cached RSSI -85 Class 0 "Wed Oct 21 20:09:31 2020Found new device: 1B-FA-B3-76-52-E0 (1B:FA:B3:76:52:E0)\n" qt.bluetooth.bluez: Updating RSSI for "C4:FC:E8:A6:95:04" QVariant(short, -85) qt.bluetooth.bluez: Discovered: "55:FC:E8:6E:54:59" "55-FC-E8-6E-54-59" Num UUIDs 1 total device 7 cached RSSI -74 Class 0 "Wed Oct 21 20:09:31 2020Found new device: 55-FC-E8-6E-54-59 (55:FC:E8:6E:54:59)\n" qt.bluetooth.bluez: Discovered: "28:40:BE:0B:EA:DD" "28-40-BE-0B-EA-DD" Num UUIDs 0 total device 8 cached RSSI -94 Class 0 "Wed Oct 21 20:09:31 2020Found new device: 28-40-BE-0B-EA-DD (28:40:BE:0B:EA:DD)\n" qt.bluetooth.bluez: Updating RSSI for "FD:61:AE:2F:59:79" QVariant(short, -77) qt.bluetooth.bluez: Updating RSSI for "55:FC:E8:6E:54:59" QVariant(short, -92) qt.bluetooth.bluez: Updating RSSI for "A4:C1:38:CE:A4:28" QVariant(short, -86) qt.bluetooth.bluez: Discovered: "0B:C0:EF:1B:D5:95" "0B-C0-EF-1B-D5-95" Num UUIDs 0 total device 9 cached RSSI -95 Class 0 "Wed Oct 21 20:09:32 2020Found new device: 0B-C0-EF-1B-D5-95 (0B:C0:EF:1B:D5:95)\n" qt.bluetooth.bluez: Updating RSSI for "A4:C1:38:D9:02:06" QVariant(short, -87) qt.bluetooth.bluez: Discovered: "FF:14:B2:E2:E7:4D" "FF-14-B2-E2-E7-4D" Num UUIDs 0 total device 10 cached RSSI -89 Class 0 "Wed Oct 21 20:09:36 2020Found new device: FF-14-B2-E2-E7-4D (FF:14:B2:E2:E7:4D)\n" qt.bluetooth.bluez: Updating RSSI for "A4:C1:38:CE:A4:28" QVariant(short, -86) qt.bluetooth.bluez: Updating RSSI for "55:FC:E8:6E:54:59" QVariant(short, -74) qt.bluetooth.bluez: Updating RSSI for "1B:FA:B3:76:52:E0" QVariant(short, -71) qt.bluetooth.bluez: Updating RSSI for "C4:FC:E8:A6:95:04" QVariant(short, -82) qt.bluetooth.bluez: Updating RSSI for "FD:61:AE:2F:59:79" QVariant(short, -78) qt.bluetooth.bluez: Updating RSSI for "28:40:BE:0B:EA:DD" QVariant(short, -90) qt.bluetooth.bluez: Updating RSSI for "FF:90:CE:BE:F5:FC" QVariant(short, -72) qt.bluetooth.bluez: Updating RSSI for "C4:FC:E8:A6:95:04" QVariant(short, -80) qt.bluetooth.bluez: Updating RSSI for "0B:C0:EF:1B:D5:95" QVariant(short, -95) qt.bluetooth.bluez: Updating RSSI for "7E:6A:3F:61:83:27" QVariant(short, -94) qt.bluetooth.bluez: Updating RSSI for "A4:C1:38:D9:02:06" QVariant(short, -75) qt.bluetooth.bluez: Updating RSSI for "FF:14:B2:E2:E7:4D" QVariant(short, -89) Capture

cagnulein commented 4 years ago

@drainuzzo Is because I'm looking for a device called "TRX ROUTE KEY" . Change it with "TOORX" in the source code (in the toorx file and bluetooth.cpp) or wait tomorrow that I will push the modification.

cagnulein commented 4 years ago

@drainuzzo could you please retry with this binary? and remember to run it with sudo Thanks

qdomyos-zwift-arm32-0.9.0.zip

drainuzzo commented 4 years ago

Just as information my BT App Gate doesn't connect to my phone also, it is refused from TR

New logs:

$ sudo ./qdomyos-zwift 
libEGL warning: DRI2: failed to authenticate
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
qt.bluetooth.bluez: Bluez 5 detected.
qt.bluetooth.bluez: Creating QtBluezDiscoveryManager
qt.bluetooth.bluez: Discovered:  "C4:FC:E8:A6:95:04" "RunScribe-06FE" Num UUIDs 4 total device 0 cached RSSI 0 Class 0
"Thu Oct 22 09:43:28 2020Found new device: RunScribe-06FE (C4:FC:E8:A6:95:04)\n"
qt.bluetooth.bluez: Discovered:  "FD:61:AE:2F:59:79" "RunScribe-C670" Num UUIDs 4 total device 1 cached RSSI 0 Class 0
"Thu Oct 22 09:43:28 2020Found new device: RunScribe-C670 (FD:61:AE:2F:59:79)\n"
qt.bluetooth.bluez: Discovered:  "FF:90:CE:BE:F5:FC" "TOORX0083" Num UUIDs 1 total device 2 cached RSSI 0 Class 0
"Thu Oct 22 09:43:28 2020Found new device: TOORX0083 (FF:90:CE:BE:F5:FC)\n"
qt.bluetooth.bluez: void QBluetoothDeviceDiscoveryAgentPrivate::stop()
"Thu Oct 22 09:43:28 2020Found new device: TOORX0083 (FF:90:CE:BE:F5:FC)\n"
qt.bluetooth.bluez: Discovered:  "C4:FC:E8:A6:95:04" "RunScribe-06FE" Num UUIDs 4 total device 0 cached RSSI 0 Class 0
qt.bluetooth.bluez: Discovered:  "FD:61:AE:2F:59:79" "RunScribe-C670" Num UUIDs 4 total device 1 cached RSSI 0 Class 0
qt.bluetooth.bluez: Discovered:  "FF:90:CE:BE:F5:FC" "TOORX0083" Num UUIDs 1 total device 2 cached RSSI 0 Class 0
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
qt.bluetooth.bluez: Discovery on:  "FF:90:CE:BE:F5:FC" Mode: QBluetoothServiceDiscoveryAgent::DiscoveryMode(FullDiscovery)
qt.bluetooth.bluez: BluetoothManagement: Ignored event: 13
SDP for FF:90:CE:BE:F5:FC B8:27:EB:2C:B2:A8
qt.bluetooth.bluez: BluetoothManagement: Ignored event: d
Cannot establish sdp session
qt.bluetooth.bluez: BluetoothManagement: Ignored event: d
qt.bluetooth.bluez: SDP scan failure QProcess::ExitStatus(NormalExit) 3
qt.bluetooth.bluez: Discovery on:  "FD:61:AE:2F:59:79" Mode: QBluetoothServiceDiscoveryAgent::DiscoveryMode(FullDiscovery)
SDP for FD:61:AE:2F:59:79 B8:27:EB:2C:B2:A8
qt.bluetooth.bluez: BluetoothManagement: Ignored event: d
Cannot establish sdp session
qt.bluetooth.bluez: BluetoothManagement: Ignored event: d
qt.bluetooth.bluez: SDP scan failure QProcess::ExitStatus(NormalExit) 3
qt.bluetooth.bluez: Discovery on:  "C4:FC:E8:A6:95:04" Mode: QBluetoothServiceDiscoveryAgent::DiscoveryMode(FullDiscovery)
SDP for C4:FC:E8:A6:95:04 B8:27:EB:2C:B2:A8
qt.bluetooth.bluez: BluetoothManagement: Ignored event: d
Cannot establish sdp session
qt.bluetooth.bluez: BluetoothManagement: Ignored event: d
qt.bluetooth.bluez: SDP scan failure QProcess::ExitStatus(NormalExit) 3
cagnulein commented 4 years ago

ok @drainuzzo i think it's a completely different piece of hardware and software, so it's not compatible with @jampy one. In order to get it works, you need to sniff via bluetooth, but, as you said, if your phone can't connect neither to it, i think we cannot do much more :(

@drainuzzo so how did you use your TOORX without your phone?

@jampy at this point i guess the only thing we can do is to try with your Mac Mini when you have spare time.

drainuzzo commented 4 years ago

@cagnulein I use my TR with my watch Garmin 945 that has a Treadmill application but not connecting it to the TR just as a separated function, or I used sometimes with Kinomapp that disovered the TR (not viceversa)

cagnulein commented 4 years ago

@cagnulein I use my TR with my watch Garmin 945 that has a Treadmill application but not connecting it to the TR just as a separated function, or I used sometimes with Kinomapp that disovered the TR (not viceversa)

@drainuzzo so, if you have time, you could sniffer the traffic of a kinomap session

drainuzzo commented 4 years ago

@cagnulein Explain me how I can do it Notice that Kinomapp works for free just a week, then it locks the account and the user need to register another one or pay before it expires

cagnulein commented 4 years ago

@drainuzzo

Ok, follow these steps (if you look in the firsts comment here, @jampy did the same):

  1. you need to become developer on your phone https://wccftech.com/how-to/how-to-enable-developer-options-on-android-10-tutorial/
  2. Go to Settings
  3. Go into developer options
  4. Enable the option Enable Bluetooth HCI snoop log
  5. restart your phone
  6. open the Kinomap app and play with it collecting inclination and speed
  7. Disable the option Enable Bluetooth HCI snoop log
  8. on your phone you should have a file called btsnoop_hci.log
  9. attach the log file here with a short description of the steps you did in the TRX app when you used it

Kinomap has some part free forever if i'm not wrong

drainuzzo commented 4 years ago

Ok I'll try later or tomorrow

Kinomap lock the account so you can't just login after a week Capture

drainuzzo commented 4 years ago

I found also iConsole+ app that works with Toorx TR for free... I'll update the logs soon

cagnulein commented 4 years ago

@jampy you could install Qt on Mac as i described on the readme and you could build with qt creator the project. On my MacBook Air works flawless, so it should be easy to debug it. What do you think?

okay, but this could take a couple of days, because the Mac and the Threadmill are at distant places and I'm currently very busy at work. Will try...

any news?

cagnulein commented 4 years ago

@jampy any news?

cagnulein commented 3 years ago

debug-Tue Jan 26 20_28_35 2021.log

cagnulein commented 3 years ago

debug-Fri Jan 29 17_01_16 2021.log 46795.log

cagnulein commented 3 years ago

debug-Tue Feb 2 18_37_53 2021.log

cagnulein commented 3 years ago

@jampy @drainuzzo i'm working on this again with another italian user. i guess we should be almost ready. I found the root issue.

cagnulein commented 3 years ago

done! feel free to reopen if you need support!