cagnulein / qdomyos-zwift

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

Domyos Bike 500 - Econnected Snoop Log #48

Closed firetrappe closed 3 years ago

firetrappe commented 3 years ago

I connected my Bike 500 to the eConnected app to capture a very short Snoop log before I had to leave for work.

Screenshot_20201104-082146

I tried to maintain a steady cadence and change the resistance levels on the bike's console to get some sort of usable log.

btsnoop_hci.log

One thing I did notice was that when eConnected opened and detected the bike, 'bluetooth' scrolled across the middle of the bike's console. I don't recall ever seeing that before :/

cagnulein commented 3 years ago

I guess something is trying to connect with the bridge, is why it disappears. I will add some debug print to understand it. Does it happens the same even with your bluetooth iPad off?

firetrappe commented 3 years ago

I guess something is trying to connect with the bridge, is why it disappears. I will add some debug print to understand it. Does it happens the same even with your bluetooth iPad off?

Thank you so much for investigating.

I just tested again with the iPad in airplane mode with bluetooth off. The bridge still disappears.

cagnulein commented 3 years ago

@firetrappe in the meanwhile could you please try to add the parameter -only-virtualbike ?

firetrappe commented 3 years ago

@firetrappe in the meanwhile could you please try to add the parameter -only-virtualbike ?

@cagnulein I just tested that. The bridge shows up in nRF continuously until I reboot the Pi

cagnulein commented 3 years ago

So Is a issue when the bluetooth adaptor acts as central - and peripheral at the same time. Do you have a rasp 3b isn't it? The same model of @rickoneeleven But you said also that the old commit works so it can't be an hardware issue.

So, we're back to the old question: bisect! :D

firetrappe commented 3 years ago

So Is a issue when the bluetooth adaptor acts as central - and peripheral at the same time. Do you have a rasp 3b isn't it? The same model of @rickoneeleven But you said also that the old commit works so it can't be an hardware issue.

So, we're back to the old question: bisect! :D

Yeah, 3b.

The old commit worked twice, even though I must have tested it 50 times. It seems like if the timing of the connections isn't perfect then it doesn't work.

bvalat commented 3 years ago

It seems that i have same bike/console as firetrappe. If needed i can do some test.

cagnulein commented 3 years ago

So Is a issue when the bluetooth adaptor acts as central - and peripheral at the same time. Do you have a rasp 3b isn't it? The same model of @rickoneeleven But you said also that the old commit works so it can't be an hardware issue.

So, we're back to the old question: bisect! :D

Yeah, 3b.

The old commit worked twice, even though I must have tested it 50 times. It seems like if the timing of the connections isn't perfect then it doesn't work.

There is a 100,100 on the code of the virtual bike. They're the milliseconds of advertising. Try to change them, for example, 1000,1000 and check if something change.

cagnulein commented 3 years ago

It seems that i have same bike/console as firetrappe. If needed i can do some test.

Welcome aboard! Yeah absolutely! If you can do a quick test...

cagnulein commented 3 years ago

@firetrappe as i promised i added a new debug log system with this commit https://github.com/cagnulein/qdomyos-zwift/commit/79f8942b06eb0a531f763fb2d283a24ea06cb4da I hope that doesn't brake anything.

i should get more info about zwift issue. Tomorrow will be an hard day, but the day after tomorrow i could check the logs that you will post :)

firetrappe commented 3 years ago

There is a 100,100 on the code of the virtual bike. They're the milliseconds of advertising. Try to change them, for example, 1000,1000 and check if something change.

@cagnulein Thanks for that suggestion. I tested with 1000,1000 and even 10000,10000. nRF detected the bridge for both attempts, although the 10000,10000 was very slow to detect, obviously.

firetrappe commented 3 years ago

It seems that i have same bike/console as firetrappe. If needed i can do some test.

@bvalat Brilliant! Thank you for joining. I am glad I am not the only one in the world with a different console 😄

firetrappe commented 3 years ago

@firetrappe as i promised i added a new debug log system with this commit 79f8942 I hope that doesn't brake anything.

i should get more info about zwift issue. Tomorrow will be an hard day, but the day after tomorrow i could check the logs that you will post :)

Great, thank you for all your efforts. We will crack this thing! I will checkout the new commit and hopefully the logs will show you something. 🤞

cagnulein commented 3 years ago

@cagnulein Thanks for that suggestion. I tested with 1000,1000 and even 10000,10000. nRF detected the bridge for both attempts, although the 10000,10000 was very slow to detect, obviously.

You mean that parameter improve the bridge connection? So maybe this is the root cause of the problem? Do I should re-put this value to default (1000, 1000)?

firetrappe commented 3 years ago

@cagnulein Thanks for that suggestion. I tested with 1000,1000 and even 10000,10000. nRF detected the bridge for both attempts, although the 10000,10000 was very slow to detect, obviously.

You mean that parameter improve the bridge connection? So maybe this is the root cause of the problem? Do I should re-put this value to default (1000, 1000)?

Sorry, I only tested with -only-virtualbike I will change to 1000,1000 and test with the bike.

cagnulein commented 3 years ago

Sorry, I only tested with -only-virtualbike I will change to 1000,1000 and test with the bike.

Ok, I'm really curious

firetrappe commented 3 years ago

Here's a log file from your latest commit: debug-Sun Nov 8 19_19_38 2020.log

Now I will change the .cpp file to 1000,1000 and test.

firetrappe commented 3 years ago

I get the same result with 1000,1000 unfortunately. Bridge disappears.

Here's the log file for that session, just in case it's helpful: debug-Sun Nov 8 19_24_43 2020.log

cagnulein commented 3 years ago

Ok, if you haven't time to do a git bisect, do it manually, checking out commit by commit. It might be easier for you

I hope @bvalat has a different behavior so we can compare them

firetrappe commented 3 years ago

Ok, I have a busy day tomorrow too, but I will see what I can do. Do you recommend I start from the original commit I used, or start further back with an even older one?

I'm really looking forward to hearing how @bvalat gets on too.

cagnulein commented 3 years ago

Start from the original commit that you used in the past and that worked

rickoneeleven commented 3 years ago

If i understood firetrap correctly, and I may have not. Even the one that "worked" only did so two in fifty times, so there may have never been a "stable"

cagnulein commented 3 years ago

If i understood firetrap correctly, and I may have not. Even the one that "worked" only did so two in fifty times, so there may have never been a "stable"

Yes I understood it too, but 2 times it's better than nothing. I guess this is a typical scenario where you have more than one issue and it's a really nightmare to debug them. So I would like to understand one thing at a time.

Of course it's not so simple because I can't test it directly :(

firetrappe commented 3 years ago

It's all good. I think I have figured out how bisect works. It shouldn't take too long to test. They may all fail, but we won't know until we try.

cagnulein commented 3 years ago

It's all good. I think I have figured out how bisect works. It shouldn't take too long to test. They may all fail, but we won't know until we try.

Of course, remberber at every bisect to run a make ;)

firetrappe commented 3 years ago

Ok, I finally got around to using bisect.

The latest commit and the original commit didn't work - the bridge connected, resistance displayed but not speed. However, one of the attempts did work:

PXL_20201110_011520486 (Phone) Photo was taken at 01:15 (yes, it was a late night! lol)

None of the following attempts were successful. This was the final result:

Capture

Here are the logs:

debug-Tue Nov 10 01-04-24 2020.log debug-Tue Nov 10 01-11-12 2020.log debug-Tue Nov 10 01-18-45 2020.log debug-Tue Nov 10 01-22-02 2020.log debug-Tue Nov 10 01-24-35 2020.log debug-Tue Nov 10 01-27-05 2020.log

cagnulein commented 3 years ago

thanks @firetrappe for your work, i feel guilty about it :( few questions:

  1. when you said "The latest commit and the original commit didn't work - the bridge connected, resistance displayed but not speed." displayed where? on bike or zwift?
  2. which is the log that it works? this one debug-Tue Nov 10 01-11-12 2020.log ? IT IS VERY IMPORTANT BECAUSE I can diff the log and check
  3. when you said "None of the following attempts were successful. This was the final result:" so you didn't find any commits that really works. I mean, there is always a unstable condition, isn't it? So the very first time you tried you were lucky, i guess, do you agree?
firetrappe commented 3 years ago

thanks @firetrappe for your work, i feel guilty about it :(

No need to feel guilty lol. This is what beta testing is all about. I'm very stubborn, I don't give up easily 😄

few questions:

  1. when you said "The latest commit and the original commit didn't work - the bridge connected, resistance displayed but not speed." displayed where? on bike or zwift?

My test method was to start the bridge using each commit. Then just use the GUI on the bridge to see if any speed was detected. When speed was detected then I loaded Zwift on the iPad to test. On every commit the bridge displays resistance changes when I change them manually on the bike.

  1. which is the log that it works? this one debug-Tue Nov 10 01-11-12 2020.log ? IT IS VERY IMPORTANT BECAUSE I can diff the log and check

Yes, that is the one. I wasn't sure which is why I checked the timestamp of the photo. That is also the biggest log, the bridge ran for longer because I tested with zwift once I saw speed updating in the bridge GUI

  1. when you said "None of the following attempts were successful. This was the final result:" so you didn't find any commits that really works. I mean, there is always a unstable condition, isn't it? So the very first time you tried you were lucky, i guess, do you agree?

None of the other commits (offered by bisect) that I tested detected speed changes in the bridge GUI.

cagnulein commented 3 years ago

@firetrappe i guess i have good news! i guess i solved your issue. Please pull it and test it and send me the log. I've done something really invasive: so if i missed something, i need to check the log.

The idea comes from your last night logs, so they were super useful!

firetrappe commented 3 years ago

@firetrappe i guess i have good news! i guess i solved your issue. Please pull it and test it and send me the log. I've done something really invasive: so if i missed something, i need to check the log.

The idea comes from your last night logs, so they were super useful!

@cagnulein This sounds promising! Unfortunately I am at work for another 6 hours so I can't test until I get home :cry:

I'm glad the bisect logs were useful. I'm curious as to what the difference was. I'm so glad you spotted something different anyway.

I'm crossing everything for both of us! :crossed_fingers:

cagnulein commented 3 years ago

I'm curious as to what the difference was

the difference is about timings. But look it deeper i found that i should wait for a bike bluetooth event on init phase. So i tried to synchronize with that event. The same event is avaiable on my treadmill, so i tested and it works (but my TM works even without this event).

firetrappe commented 3 years ago

That's really interesting. We thought it was probably to do with timings, that makes sense.

Hopefully this may fix some issues with other peoples equipment too.

I noticed last night that the console on my bike has a switch on the back to choose between Rowing Machine, Elliptical or Bike. Maybe Domyos use the same console on other types of product?

By the way, knowing your skills and where you live, if you don't work for Ferrari then you should! :wink:

cagnulein commented 3 years ago

That's really interesting. We thought it was probably to do with timings, that makes sense.

i had always this feeling too, but i didn't have the evidences until this morning! (thanks again :) )

Hopefully this may fix some issues with other peoples equipment too.

i hope so!

I noticed last night that the console on my bike has a switch on the back to choose between Rowing Machine, Elliptical or Bike. Maybe Domyos use the same console on other types of product?

absolutely! Infact, the treadmill and bike from domyos has more or less the same protocol, and it has sense.

By the way, knowing your skills and where you live, if you don't work for Ferrari then you should! 😉

hahaha in this very moment i would like to stay away from Ferrari 😆

I really hope that this commit will make the difference for you ;)

firetrappe commented 3 years ago

@cagnulein I just got home and tested... Android and Linux versions both appear to work with the bike! 🎉 🚀

I need to test further after I have eaten dinner, but I think you have cracked it 🎆

cagnulein commented 3 years ago

@firetrappe we will have a beer together one of these days! Great!

firetrappe commented 3 years ago

@firetrappe we will have a beer together one of these days! Great!

Sounds like a plan my friend. I'll have to pop over, we can have a little 5k race around Fiarano :smile:

cagnulein commented 3 years ago

everything ok @firetrappe ? could we close this issue?

cagnulein commented 3 years ago

@firetrappe is everything allright? i'm starting to worry about you

cagnulein commented 3 years ago

@firetrappe i'm closing this one. if you have any issue, feel free to reopen it!