cagnulein / qdomyos-zwift

Zwift bridge for smart treadmills and bike/cyclette
https://www.qzfitness.com/
GNU General Public License v3.0
367 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

@firetrappe ok, this snoop was very useful: infact, your bike is different from the @alpat59 and @kenands i have to create a similar profile for this one. i will tell you when i'm ready

cagnulein commented 3 years ago

@firetrappe i just submit a new commit. I found several differencies from the other version ("changyow" is its name).

So please, test and send me the log generated from the bridge.

Please split the 2 issue:

  1. is the display issue that this commit should fix (i hope, but i'm not really 100% confident yet)
  2. the ipad issue

Here talk about only the first one, if the zwift ipad continues, try with other devices. If the problem is only on the ipad, please open a new issue.

Thanks, i hope that this release brings some good news :P

firetrappe commented 3 years ago

@cagnulein Thank you so much for looking into this.

I recognised the 'chagyow' name, but I couldn't remember where I had seen it before. Then I suddenly remembered.... Screenshot_20201104-143720 (Medium)

This is the app on my iPad which works with my Reebok Treadmill!

My treadmill has never been powered on while testing the bike.

cagnulein commented 3 years ago

@firetrappe hahah just to be clear: the chagyow bike is the @kenands one. Yours has provided by telink. So your reebok treadmill has been built by the same company of the domyos treadmill. There is a lot of possibilities that reebok treadmill has the same protocol (and maybe the same firmware) of the domyos one.

You should definitely try :D (open another issue of course in case :P)

firetrappe commented 3 years ago

@cagnulein Wow lol. I was getting REALLY confused there for a minute! That's really interesting though.

I'll pull the latest commit and test later tonight :+1:

firetrappe commented 3 years ago

@cagnulein I just tested the latest commit.

The bike console exhibits the same behaviour as previously unfortunately. Log attached.

debug-Wed Nov 4 20-20-13 2020.log

cagnulein commented 3 years ago

@firetrappe no differences at ALL? unbelieavable :( tomorrow i will check the snoop again, i surely missed something this morning :(

firetrappe commented 3 years ago

@cagnulein The console just showed the Bluetooth symbol and the resistance options again I'm afraid.

Would a snoop log from Kinomap be of any use?

cagnulein commented 3 years ago

@firetrappe no i don't think so. I guess the file you collected is enough, I just missed something stupid I hope.

Have a good night

cagnulein commented 3 years ago

@firetrappe just to be sure: in your snoop log i saw a lot of packet to a "nintendo" device. Is it known? Because i'm start thinking that you have 2 endpoint in your bike, maybe with 2 different bluetooth device

the mac address of this device is [Destination: Nintendo_c9:65:d2 (7c:bb:8a:c9:65:d2)]

Do you recognize it?

cagnulein commented 3 years ago

@firetrappe i commit a new one. I tried to be more on the snoop way. give it a try ;)

firetrappe commented 3 years ago

@firetrappe just to be sure: in your snoop log i saw a lot of packet to a "nintendo" device. Is it known? Because i'm start thinking that you have 2 endpoint in your bike, maybe with 2 different bluetooth device

the mac address of this device is [Destination: Nintendo_c9:65:d2 (7c:bb:8a:c9:65:d2)]

Do you recognize it?

@cagnulein we don't have any nintendo consoles connected. However, I just used nRF Connect to try and locate it. It appears that it is one of the kids bluetooth devices they use when they play Pokemon Go :/

firetrappe commented 3 years ago

@cagnulein I Just got home and pulled latest commit.

Similar experience to yesterday - Bike console just shows BT and Resistance. I did open zwift just to see what happened. Zwift detected the bridge, but no avatar movment as expected :(

debug-Thu Nov 5 17-11-43 2020.log

cagnulein commented 3 years ago

@cagnulein I Just got home and pulled latest commit.

Similar experience to yesterday - Bike console just shows BT and Resistance.

Tomorrow I will be more free than today and I will triple check it. Are you 100% sure that during the snoop log the console has populate by data?

I did open zwift just to see what happened. Zwift detected the bridge, but no avatar movment as expected :(

Didn't you try yet with another zwift device?

firetrappe commented 3 years ago

@cagnulein Thank you for persisting with this.

To try and help I have created 2 more snoop logs. 1 with Econnected and 1 with Kinomap. Both apps show different data on the bike console.

I also created a video of each session which I thought might help.

Kinomap Video: https://youtu.be/K8tKrRfpBKw Kinomap Snoop Log: kinomap btsnoop_hci.log

Econnected Video: https://youtu.be/2WJgeZ9bGbc Econnected Snoop Log: econnected btsnoop_hci.log

If you notice in both videos, the BT symbol and Resistance show for a split second before the console populates with the other data fields. That is where the bike console stops when it connects to the bridge at present.

cagnulein commented 3 years ago

@firetrappe wonderful debug activity :) I will check it

cagnulein commented 3 years ago

@firetrappe i checked the 2 snoop logs but in both of them there aren't any trace of connection to the TM, only with a garmin smartwatch. I'm sorry but they are useless :( could you please retry? if you want, before send me them, you could double check them with wireshark looking for your treadmill mac address (as your very first snoop log has)

firetrappe commented 3 years ago

@cagnulein Ah Damn! That's disappointing. The only thing I can remember doing differently for those logs was disabling and re-enabling bt after enabling HCI snooping, then restarting the phone. I'll get wireshark as suggested to check the logs.

Would you like new videos of each session, or are they not so important now?

I'm at home this afternoon, so I'll see what I can do when i'm a bit less tired!

Edit: Ah, I figured out what I did wrong! I ran the snoop on my phone and the apps on my ipad :/ Thank you @rickoneeleven for making the same mistake :)

cagnulein commented 3 years ago

@cagnulein Ah Damn! That's disappointing. The only thing I can remember doing differently for those logs was disabling and re-enabling bt after enabling HCI snooping, then restarting the phone. I'll get wireshark as suggested to check the logs.

;)

Would you like new videos of each session, or are they not so important now?

they were useful, but now i'm ok, you shouldn't take it.

I'm at home this afternoon, so I'll see what I can do when i'm a bit less tired!

ihihih ok

Edit: Ah, I figured out what I did wrong! I ran the snoop on my phone and the apps on my ipad :/ Thank you @rickoneeleven for making the same mistake :)

hihihi ok!

rickoneeleven commented 3 years ago

@firetrappe it's what I do best :laughing:

firetrappe commented 3 years ago

@cagnulein Ok, lets try this again!

Econnected Snoop: econnected v2 btsnoop_hci.log

Kinomap Snoop: Kinomap v2 btsnoop_hci.log

Both sessions were similar; Open app, pedal to power on bike, connect to app, pedal slowly increasing from resistance=1 to resistance=15

Both logs checked in Wireshark for 'Telink' entry ;) 🤞

cagnulein commented 3 years ago

@firetrappe ok, i followed the kinomap snoop as is. it's very simple, much simple than before. if it doesn't work, i will start looking for another job 🤣

please pull it, compile it, and check the display. send me the log in case it doesn't work

firetrappe commented 3 years ago

@cagnulein Please don't look for another job 😢

debug-Fri Nov 6 15-10-36 2020.log

The new pull compiled and executed without any issues. The display had the usual reaction. I opened Zwift on my Pixel and the bike wasn't detected. Then about 30 seconds later the console display changed to this :

PXL_20201106_151346172 (Phone)

The console showed the additioinal fields, but pedaling didn't change any of the displayed values. I checked the bridge and the code was still running.

cagnulein commented 3 years ago

Ok it's a good sign! Now I'm out with my dog, I will check it later. For zwift, did you try to restart the bridge? Another device?

firetrappe commented 3 years ago

@cagnulein I'll reboot the bridge and then test with iP**

Enjoy your walk 🐶

cagnulein commented 3 years ago

Don't reboot, just restart my script. It's different

firetrappe commented 3 years ago

@cagnulein I restarted the script. The console reacted as before. Loaded Zwift on the iPad and it automatically detected the bridge. While pedalling all fields remained at zero though:

IMG_0329 (Phone)

I disabled bt on iPad, stopped and restarted your script, opened Zwift on the Pixel but it couldn't detect the bridge.

nRF Connect now appears to scan and detect the bridge and the bike simulaneously.

cagnulein commented 3 years ago

If nrf connects detect it it's very strange. Seems a filter on services on zwift side. But I can't understand why it happens only to someone. Could you try to connect with nrfconnect and send me a snapshot of the services from the Pixel?

firetrappe commented 3 years ago

@cagnulein I don't understand it either 😞

I just powered on the bike and then started the bridge again on the pi. nRF scans and shows the bike until the bridge connects. As soon at the bridge connects I get this:

PXL_20201106_214213744 (Phone)

And then neither show on nRF:

Screenshot_20201106-214135 (Phone)

🤷‍♂️

debug-Fri Nov 6 21-38-23 2020.log

firetrappe commented 3 years ago

It's crazy that I had a perfect session on my first attempt 5 days ago: https://github.com/cagnulein/qdomyos-zwift/issues/22#issuecomment-720365510

https://strava.app.link/CcwnhQrFcbb

Every session since then it has failed 😢

cagnulein commented 3 years ago

It's crazy that I had a perfect session on my first attempt 5 days ago: #22 (comment)

https://strava.app.link/CcwnhQrFcbb

Every session since then it has failed 😢

oh! i didn't remember! i have a deal for you: why don't you checkout that commit, check if everything works again, and commit after commit, you will try when error appears? i guess it's only effective way.

cagnulein commented 3 years ago

@firetrappe if you want there is a useful command on git, called git bisect

firetrappe commented 3 years ago

Ok, I did the following:

git checkout 209da708c9833f25207d8252b6ce14ef4606c782 cd src qmake make -j4

This commit worked first time - as before 🎉 The bluetooth settings on the iPad showed the bridge as an available device. Starting Zwift on the iPad I had a popup asking me to connect/pair.

The bike console populated with data, but none of the fields updated in realtime:

PXL_20201107_111823166 (Phone)

The fields did update after I went back the the Zwift menu; the time updated from 1:01 to 3:xx.

debug-Sat Nov 7 11-14-09 2020.log

Then I stopped the script and waited for the bike to power off. I started the bridge again and went through the same steps. This time the iPad didn't detect the bridge and therefore Zwift didn't work 😞

debug-Sat Nov 7 11-33-20 2020.log

It seems that I have to start the bridge and then pedal to power on the bike quickly before the script gets a Seg Fault. If the bike is already powered then it doesn't work. If the bridge is already running then the bike appears to connect (console changes to BT + Resistance display only), but Zwift/iPad/nRF Connect can't detect anything. Unfortunately I can't seem to replicate this every time.

This was my latest attempt: debug-Sat Nov 7 12-35-43 2020.log

I do seem to get this notification on the iPad after a successful session: IMG_0330 (Phone)

But as i've mentioned before, there doesn't appear to be a method to remove known devices in Zwift (unpair?)

Apologies for the long post. I'm just trying to document everything i'm testing for my own future reference.

cagnulein commented 3 years ago

It seems that I have to start the bridge and then pedal to power on the bike quickly before the script gets a Seg Fault. If the bike is already powered then it doesn't work. If the bridge is already running then the bike appears to connect (console changes to BT + Resistance display only), but Zwift/iPad/nRF Connect can't detect anything. Unfortunately I can't seem to replicate this every time.

i've already fix this issue in the next commits. but we have to focus on an issue at a time. try to discover which is the commit that break everything. When we will have understood which is the root issue, we will fix zwift issue too.

firetrappe commented 3 years ago

It seems that I have to start the bridge and then pedal to power on the bike quickly before the script gets a Seg Fault. If the bike is already powered then it doesn't work. If the bridge is already running then the bike appears to connect (console changes to BT + Resistance display only), but Zwift/iPad/nRF Connect can't detect anything. Unfortunately I can't seem to replicate this every time.

i've already fix this issue in the next commits. but we have to focus on an issue at a time. try to discover which is the commit that break everything. When we will have understood which is the root issue, we will fix zwift issue too.

Thanks for your continued help. I will test some more.

I'm not sure how to get back to the latest version now. Now I have used checkout I get a message telling me to 'specify which branch you want to merge with'

rickoneeleven commented 3 years ago

@firetrappe

Checkout master Git pull Qmake Make - j4

To get back to latest

cagnulein commented 3 years ago

@firetrappe try to run the next one instead of the lastest and so on

firetrappe commented 3 years ago

Thanks @rickoneeleven that worked. It told me that there were 6 commits since the one I was using, so I know where I am now.

@cagnulein I just wanted to quickly revert to the latest version to confirm I get a Seg fault if I start the bridge and don't power on the bike in time...I was correct, I do get the fault and the script needs restarting.

Now i'll go back and test the next commit.

cagnulein commented 3 years ago

Uh ok @firetrappe i will investigate it, I hope it will do with the treadmill too

cagnulein commented 3 years ago

@firetrappe you were right, I applied only to treadmill 27f207b022acec6fb8abb6c9cd7d1b3808460df3

firetrappe commented 3 years ago

@firetrappe you were right, I applied only to treadmill 27f207b

Great, thanks!

I have just checked out 209da70 again (the original one that worked this morning too) just to test before I move to other commits. I can't get it to work. Should I look at older or newer commits? I'm not sure what I should be doing now :/

debug-Sat Nov 7 20-19-11 2020.log

rickoneeleven commented 3 years ago

After a seg fault I always had to reboot

firetrappe commented 3 years ago

Ok ok, i'll try that, thanks! 👍

cagnulein commented 3 years ago

Ok ok, i'll try that, thanks! 👍

I didn't apply to bike yet, I will do it tomorrow. Have a good night

cagnulein commented 3 years ago

ok @firetrappe did it. you could try

firetrappe commented 3 years ago

ok @firetrappe did it. you could try

Good morning!

I just tested the latest commit. No Seg Fault. Great! That makes life so much easier, especially with autostart 🥳 I kept the bridge running and let the bike power off, then pedalled the bike to power it on, the bridge detects it again.

cagnulein commented 3 years ago

Awesome! @firetrappe remember, when you will have time, to bisect the commits in order to understand if I had introduced some issue in times. Thanks

firetrappe commented 3 years ago

@cagnulein I will research how to use the bisect command.

I think with the latest commit my autostart isn't working as it should. CTRL+C closes the terminal now and doesn't create a log. I will have to stop using it for now.

The current situation using nRF to monitor connections is as follows- Bike is detected when powered on. Bike disappears and Domyos Bridge appears when the bridge detects the bike. Bridge disappears about 10 seconds later.

debug-Sun Nov 8 10-39-55 2020.log

cagnulein commented 3 years ago

@firetrappe by chance your issue is similar to this https://youtu.be/gaB2eUHPIm8 ? Check the part of the video when the icon says "nessun segnale" (no signal)

firetrappe commented 3 years ago

@firetrappe by chance your issue is similar to this https://youtu.be/gaB2eUHPIm8 ? Check the part of the video when the icon says "nessun segnale" (no signal)

@cagnulein Great video! You have very good English 👍

I think my issue is different. Here's a video showing what is happening at the moment. Maybe you can spot something that I am doing wrong?

https://youtu.be/ckWsc2BW6W4