Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Buggy behaviour on Raspberry pi 4 and Zwift #2810

Open
mazafra1 opened this issue Nov 22, 2024 · 26 comments
Open

[BUG] Buggy behaviour on Raspberry pi 4 and Zwift #2810

mazafra1 opened this issue Nov 22, 2024 · 26 comments
Assignees
Labels
bug Something isn't working

Comments

@mazafra1
Copy link

Describe the bug
The Wahoo v5 is detected but nothing happens.

To Reproduce
Steps to reproduce the behavior:

  1. Launch program with sudo ./qdomyos-zwift -no-gui -no-heart-service
  2. Try pairing on Zwift for iPad
  3. Dircom device is not showing sometimes, other times shows, other times a residual Wahoo KICKR 0000 appears. And only showing in Power source and Cadence, never in Resistance.
  4. Bluetooth virtual device never shows up.

Expected behavior
It should show a Bluetooth Device to be paired in Zwift, to allow Zwift Click to be paired and then move Power source and Cadence to the virtual Dircon.

Screenshots
Captura 2024-11-22 a las 9 41 01

Desktop (please complete the following information):

  • OS: Linux raspberrypi 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux
  • Version: source code from Nov 21st 2024.

Smartphone (please complete the following information):
N/A

Append a debug log
debug-Fri_Nov_22_09_12_49_2024.log.zip

Additional context
Add any other context about the problem here.

@mazafra1 mazafra1 added the bug Something isn't working label Nov 22, 2024
@cagnulein
Copy link
Owner

the main issue is this one

Fri Nov 22 09:13:21 2024 1732263201122 Debug:   command 10 failed with status 12
Fri Nov 22 09:13:21 2024 1732263201122 Debug:   Advertising disable failed, ignoring
Fri Nov 22 09:13:21 2024 1732263201122 Debug:   sending command; ogf: 8 ocf: 6
Fri Nov 22 09:13:21 2024 1732263201122 Debug:   command sent successfully
Fri Nov 22 09:13:21 2024 1732263201124 Debug:   HCI event triggered, type: e
Fri Nov 22 09:13:21 2024 1732263201125 Debug:   command 6 executed successfully
Fri Nov 22 09:13:21 2024 1732263201125 Debug:   sending command; ogf: 8 ocf: 8
Fri Nov 22 09:13:21 2024 1732263201125 Debug:   command sent successfully
Fri Nov 22 09:13:21 2024 1732263201133 Debug:   HCI event triggered, type: 13
Fri Nov 22 09:13:21 2024 1732263201136 Debug:   HCI event triggered, type: e
Fri Nov 22 09:13:21 2024 1732263201136 Debug:   command 8 executed successfully
Fri Nov 22 09:13:21 2024 1732263201137 Debug:   sending command; ogf: 8 ocf: 9
Fri Nov 22 09:13:21 2024 1732263201137 Debug:   command sent successfully
Fri Nov 22 09:13:21 2024 1732263201143 Debug:   HCI event triggered, type: e
Fri Nov 22 09:13:21 2024 1732263201144 Debug:   command 9 executed successfully
Fri Nov 22 09:13:21 2024 1732263201144 Debug:   sending command; ogf: 8 ocf: 10
Fri Nov 22 09:13:21 2024 1732263201144 Debug:   command sent successfully
Fri Nov 22 09:13:21 2024 1732263201147 Debug:   HCI event triggered, type: e
Fri Nov 22 09:13:21 2024 1732263201148 Debug:   command 10 failed with status 12
Fri Nov 22 09:13:21 2024 1732263201148 Warning:   received advertising error
Fri Nov 22 09:13:21 2024 1732263201148 Debug: virtualdevices/virtualbike.cpp void virtualbike::error(QLowEnergyController::Error) "virtualbike::controller:ERROR AdvertisingError"
Fri Nov 22 09:13:21 2024 1732263201148 Debug: virtualdevices/virtualbike.cpp void virtualbike::reconnect() "virtualbike::reconnect"

try to investigate which could be the cause.
you can try to check if enabling the fake bike setting setting the manual device to wifi, at least show the virtual device on zwift
let me know

@mazafra1
Copy link
Author

mazafra1 commented Nov 22, 2024

I launched it now with sudo ./qdomyos-zwift -no-gui -no-heart-service -only-virtualbike and I got:

Fri Nov 22 12:01:28 2024 1732273288841 Warning:   received advertising error
qt.bluetooth.bluez: received advertising error
Fri Nov 22 12:01:28 2024 1732273288841 Debug: virtualdevices/virtualbike.cpp void virtualbike::error(QLowEnergyController::Error) "virtualbike::controller:ERROR AdvertisingError"
"virtualbike::controller:ERROR AdvertisingError"
Fri Nov 22 12:01:28 2024 1732273288842 Debug: virtualdevices/virtualbike.cpp void virtualbike::reconnect() "virtualbike::reconnect"
"virtualbike::reconnect"
Fri Nov 22 12:01:28 2024 1732273288843 Warning:   Overriding existing local service with uuid "{00001826-0000-1000-8000-00805f9b34fb}"
Overriding existing local service with uuid "{00001826-0000-1000-8000-00805f9b34fb}"

That's what you meant?

@cagnulein
Copy link
Owner

it seems there is a general error so. does it the same with the fake treadmill? if so it seems something on the raspberry itself
let me know

@mazafra1
Copy link
Author

I reinstalled bluetooth kernel module and now it's working!!!! Weird.

Now I have both the virtual Dircon and the virtual bluetooth QZPI and they're transmitting power. Is it possible to also get the zwift click in the same way the mobile app does?

@cagnulein
Copy link
Owner

cagnulein commented Nov 22, 2024 via email

@mazafra1
Copy link
Author

No effect whatsoever.

debug-Fri_Nov_22_14_07_34_2024.log.zip

@cagnulein
Copy link
Owner

cagnulein commented Nov 22, 2024 via email

@mazafra1
Copy link
Author

Thanks Roberto. I've reviewed and I see nothing off except the error above.

Is there any test I could do to troubleshoot the Zwift Click only?

@cagnulein
Copy link
Owner

@mazafra1 can you try to use bluetoothctl to check if you can connect to from QZ externally?

you can use this guide from chatgpt, let me know if you have any questions

https://chatgpt.com/share/67443941-1590-8005-82a3-0631ef2e9be5

@mazafra1
Copy link
Author

mazafra1 commented Nov 25, 2024

Yes, it can connect and successfully retrieved these characteristics:

Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0026
        0000180f-0000-1000-8000-00805f9b34fb
        Battery Service
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0026/char0027
        00002a19-0000-1000-8000-00805f9b34fb
        Battery Level
Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0026/char0027/desc0029
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017
        00000001-19ca-4651-86e5-fa29dcdd09d1
        Vendor specific
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char0023
        00000006-19ca-4651-86e5-fa29dcdd09d1
        Vendor specific
Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char0023/desc0025
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char0020
        00000005-19ca-4651-86e5-fa29dcdd09d1
        Vendor specific
Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char0020/desc0022
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char001d
        00000004-19ca-4651-86e5-fa29dcdd09d1
        Vendor specific
Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char001d/desc001f
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char001b
        00000003-19ca-4651-86e5-fa29dcdd09d1
        Vendor specific
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char0018
        00000002-19ca-4651-86e5-fa29dcdd09d1
        Vendor specific
Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service0017/char0018/desc001a
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000e
        0000180a-0000-1000-8000-00805f9b34fb
        Device Information
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000e/char0015
        00002a26-0000-1000-8000-00805f9b34fb
        Firmware Revision String
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000e/char0013
        00002a27-0000-1000-8000-00805f9b34fb
        Hardware Revision String
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000e/char0011
        00002a25-0000-1000-8000-00805f9b34fb
        Serial Number String
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000e/char000f
        00002a29-0000-1000-8000-00805f9b34fb
        Manufacturer Name String
Primary Service (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000a
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
Characteristic (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000a/char000b
        00002a05-0000-1000-8000-00805f9b34fb
        Service Changed
Descriptor (Handle 0x0000)
        /org/bluez/hci0/dev_DC_30_32_2E_9B_0F/service000a/char000b/desc000d
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration

Should I try subscribing to any one in particular?

Edit: the device disconnects after a couple of minutes without activity.

@cagnulein
Copy link
Owner

so it could be the issue is when you are connecting to both trainer and the click? can you try to connect to both?
first connect to the trainer, and then try to subscribe to the 0x2AD2 for example and then connect to the click. let's see if it works

@mazafra1
Copy link
Author

mazafra1 commented Dec 1, 2024

I tried that and it all seems OK. I even subscribed to notifications on 0x2AD2. Although I'm not sure if anything should happen. But every step threw a success message.

@cagnulein
Copy link
Owner

cagnulein commented Dec 1, 2024 via email

@mazafra1
Copy link
Author

mazafra1 commented Dec 1, 2024

Thanks. That makes sense. What’s the terminal parameter for that?

Cheers

@cagnulein
Copy link
Owner

cagnulein commented Dec 1, 2024 via email

@mazafra1
Copy link
Author

mazafra1 commented Dec 2, 2024

Thanks Roberto. I'm on a headless Rpi. Any chance I get this setup done via a config file or similar?

@cagnulein
Copy link
Owner

i created this

"-no-virtual-device-bluetooth"

build qz from the master, i just added it for you

@mazafra1
Copy link
Author

mazafra1 commented Dec 2, 2024

Thanks a ton!! Now it works!!! Obviously without virtual bluetooth device.
IMG_0248

What can we do then now? Is the problem the number of bt channels occupied or something else? Did you experience something similar on your Rpi zero?

@cagnulein
Copy link
Owner

never tried to pair the click too on the raspberry. i guess yes, it's some sort of limitation on the raspberry. one workaround could be connect first the click and then finally the trainer so the broadcasting interface will be the last one. just a question: why are you connecting now the click on zwift directly? weren't you connecting on the qz app on the raspberry?

@mazafra1
Copy link
Author

mazafra1 commented Dec 2, 2024

To connect the Click I just followed this tutorial https://www.youtube.com/watch?v=mJl2zkQ2SuA. Isn't it the proper way?

@cagnulein
Copy link
Owner

there are 2 ways, check here https://github.com/cagnulein/qdomyos-zwift/wiki/Virtual-Gearing-on-QZ-with-Zwift,-Rouvy,-Mywhoosh-and-Traning-Peaks

if you use the method with qz directly, you can avoid to use the bluetooth interface on zwift so it would already work with the actually raspberry version (the only downside is that you will not see the gears on zwift)

@mazafra1
Copy link
Author

mazafra1 commented Dec 2, 2024

OK. That's not too bad. I won't see the gear number neither in Zwift, neither in QZ because the raspberry does not have screen, but I can live with that.

With Trainingpeaks virtual and others simulators the behavior would be the same?

@cagnulein
Copy link
Owner

yes it would work the same, since now qz has MQTT you can display the gears on home assistant for example!

@mazafra1
Copy link
Author

mazafra1 commented Dec 3, 2024

Thanks. How do I need to configure the screen below?
image

@cagnulein
Copy link
Owner

you can leave as it is, as i said, without the bluetooth interface we can't have the gears from/to zwift since it's bluetooth based

@cagnulein
Copy link
Owner

I guess it's what I fixed here @mazafra1

#2892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants