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

@rickoneeleven trying the new one. I reduced the probability that a packet could corrupt to another. It's definitely a collision issue.

rickoneeleven commented 4 years ago

okay bro we're rolling - i need the iPad for some work stuff now, so it won't be connected to zwift and your program, are we okay testing without the iPad and zwift?

cagnulein commented 4 years ago

@rickoneeleven yes i guess it's not releated to zwift. BTW which version of ipad have you got? @alpat59 has some issues on zwift with iPad

rickoneeleven commented 4 years ago

7th gen, normal ipad (not pro or mini or anything, just normal one) iOS 14.1

model no. MW742B/A

at no point during the testing have i had a problem with iPad/zwift/program connection - sometimes i have to launch your program a second time (CTRL-C and then start again) for zwift to see it, about 50% of the time

cagnulein commented 4 years ago

ok, later on we have to fix this zwift issue too. i guess i need an ipad :D

rickoneeleven commented 4 years ago

it really isn't a big issue for me, but yeah we can work on it if you want. getting the treadmill's connection stable is a big one for me, if we manage it, i'm going to wet my pants.

rickoneeleven commented 4 years ago

dropped, we got some n00ps

debug-Thu Nov 5 09_23_09 2020.log

cagnulein commented 4 years ago

Got it!

Thu Nov 5 10:37:22 2020 1604572642976 packet ignored
Thu Nov 5 10:37:23 2020 1604572643028 polling blocked by other packet
Thu Nov 5 10:37:23 2020 1604572643227 incompletePackets timeout
Thu Nov 5 10:37:23 2020 1604572643231  >> f0 ac 9c // noOp
Thu Nov 5 10:37:22 2020 1604572642826  << 6 0b 01 00 00 01 0b
Thu Nov 5 10:37:22 2020 1604572642827 ...final bytes received

now i have to fix, but i have the evidence!

cagnulein commented 4 years ago

ok @rickoneeleven another round! pull it! and remember to keep your log dir clean :D

rickoneeleven commented 4 years ago

okay bro's we're running, i've been removing the old debug logs when uploading them here, assuming that's what you mean - i'll let you know IF or when it dumps out next 🤞

rickoneeleven commented 4 years ago

debug-Thu Nov 5 11_07_29 2020.log i thought we had it 😱

cagnulein commented 4 years ago

Argh I have to increase a bit the retry window. I would like to kill the programmer on domyos that realized this piece of shit

cagnulein commented 4 years ago

Try now @rickoneeleven

rickoneeleven commented 4 years ago

okay we rollin ❤️

rickoneeleven commented 4 years ago

we've got a man down situation debug-Thu Nov 5 12_27_06 2020.log

cagnulein commented 4 years ago

this time is hard because it seems that everything is in the right place...i'm taking some moment to think about it

rickoneeleven commented 4 years ago

if it's just my "good" old t900c, maybe we can keep this latest commit, but do whatever magic it is that you did a few commits back so I don't have to restart the pi each time.

when we had it at the point where it was stopping the treadmill, but the program kept running even though it wasn't logging, around yesterday 07:53 GMT is when it would disconnect, but not "crash" the pi bluetooth so it had to be restarted

at least then i can just quickly restart the app

cagnulein commented 4 years ago

@rickoneeleven wait, i've got an idea. https://github.com/cagnulein/qdomyos-zwift/commit/42b711beb44633f3b6a811f260555beddb24af35 try this one: WARNING i created a branch just for you, in order to keep the things clean, so be sure to compile the right branch

git pull git checkout t900c qmake make -j4

should enough

myabe it hangs immediately, maybe it works forever

rickoneeleven commented 4 years ago

cool, thank you, ill test that, see if i can get about an hour out of it, and if it doesn't crash the bluetooth stack that will be cool

cagnulein commented 4 years ago

@rickoneeleven at least it started? i'm confident: if it started it works forever! 😆

rickoneeleven commented 4 years ago

it sure did start my friend, currently running - not being running long at the moment but let's wait and see :crossed_fingers:

rickoneeleven commented 4 years ago

treddy stopped, and the program kept running (not a seg fault), but when CTRL-C and starting it again it didn't reconnect without a reboot - maybe ill just checkout the build from yesterday?

sorry to take up so much of your time!

debug-Thu Nov 5 13_49_10 2020.log

then debug-Thu Nov 5 14_57_42 2020.log

cagnulein commented 4 years ago

maybe ill just checkout the build from yesterday?

no, you did ok, i saw from the log. Now i would like to check the commits that didn't require a reboot. maybe it could hide a hint

cagnulein commented 4 years ago

@rickoneeleven let's move back to branch master https://github.com/cagnulein/qdomyos-zwift/commit/cf7f6ca1c2a3e1e1a3f50ce24ca56f6ba2d02658 i did 2 things in this commit:

  1. i revert the changes to the one that not segfault
  2. i added a -poll-device-time argument to the executable

so if you don't use -poll-device-time, this commit acts as the one doesn't segfault. If you use -poll-device-time you will decide how ofter polling the treadmill (in milliseconds). Why did i introduce it? Because i guess if you speed down the polling you will also speed down the issue.

So default value of -poll-device-time is 200 (millisecond). I should try starting with 1000 and let's see if the issue starts to going well or bad

so you have to start, for example, in this way

sudo ./qdomyos-zwift -no-gui -poll-device-time 1000

of course, in any case, send me the logs

rickoneeleven commented 4 years ago

okay i've just ran that against the last commit I checked out (the T900c commit) i'll let you know how we get on 👍

cagnulein commented 4 years ago

okay i've just ran that against the last commit I checked out (the T900c commit) i'll let you know how we get on 👍

did you use the 1000 value?

rickoneeleven commented 4 years ago

right whoops, i missed your comment about master so i've just:

switched to master git pull qmake make -j4 ./qdomyos-zwift -no-gui -poll-device-time 1000 (i'm already root)

cagnulein commented 4 years ago

@rickoneeleven ok i guess you should notice that the console on your treadmill should refresh a little bit slower than before

rickoneeleven commented 4 years ago

ahhh yeah it's counting up in 2/3 second intervals

rickoneeleven commented 4 years ago

😢 debug-Thu Nov 5 16_18_56 2020.log

treadmill stopped, program will still running with connection errors, but it did reconnect after CTRL-C and starting it again, so i see that as a positive at least

cagnulein commented 4 years ago

@rickoneeleven if you want we could add a reconnection process (as you suggested yesterday) so, you will see for a moment that the treadmill slow down a little bit and it will return to the previous speed/inclination. What do you think?

rickoneeleven commented 4 years ago

hahahahaha I was just writing that out!!!!! that would be perfect!

cagnulein commented 4 years ago

ok i will do it tomorrow, i don't know if would be easy or not. i have to think about it tonight in front a cold dark beer :P

rickoneeleven commented 4 years ago

enjoy bonfire night :rocket: (assuming you have it over there)

rickoneeleven commented 4 years ago

okay, just some food for thought. i had an idea - is my t900c just bad with bluetooth?

so i downloaded the econnect (official?) domyos app and connected it via bluetooth - would it be possible to hit two hours?

PXL_20201105_212253621

i see that result as a glimmer of hope, at least we know the capability is there, have a good night my friend

cagnulein commented 4 years ago

@rickoneeleven you're feeding my inside monster now :D if this app reach 2h without issue we have to do the same without any workaround! It's mandatory! So please, could you get a bluetooth spoof of this app for at least 1h? I guess it could be useful to understand if we do something wrong during our session. Thanks

rickoneeleven commented 4 years ago

😺 i;ve not snooped before, can you give me a little breakdown and I'm sure i'll figure it out, do I need an app?

cagnulein commented 4 years ago

@rickoneeleven first of all, in order to collect data, you need a android device, tablet or phone, but it must be android. do you have one?

if yes, you have to follow these steps:

Ok, follow these steps:

  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 econnected 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 econnected app when you used it
rickoneeleven commented 4 years ago

do you need root? I don't seem to have that option 😢 https://pinescore.com/111/screen-20201106-072905.mp4

at beginning, i don't know if you see, at bottom i click "about phone" and it says i'm already developer

cagnulein commented 4 years ago

@rickoneeleven no, you don't need root. if you are already a developer you should find the snoop option. i'm trying to find the correct path in your pixel 4 on internet. every phone has a different path to the bluetooth debug option :/

cagnulein commented 4 years ago

@rickoneeleven check this https://developer.android.com/studio/debug/dev-options

rickoneeleven commented 4 years ago

got it, thank you. leave it with me.

rickoneeleven commented 4 years ago

bloody nora, that took some getting my head around. right, i've got it logging, and confirmed I can get the log files off phone - I didn't want to log for an hour only to find I can't get the log file.

so it's running econnected now on my ipad, connected to my treadmill, with my phone next to them. do you think we can just collect an hours worth of data? i could really do with my devices back :smile:

cagnulein commented 4 years ago

@rickoneeleven no no, econnected MUST run on the same android device

rickoneeleven commented 4 years ago

aghhh haha, ill sort soon

rickoneeleven commented 4 years ago

okay it's running, pixel 4 with econnected paired with my treadmill, how much time/data do you think you need?

cagnulein commented 4 years ago

@rickoneeleven 30m should be enough, 1h is better

rickoneeleven commented 4 years ago

right then amigo, test ran for 1:25 without any stops, i gracefully ended the program at the end.

i think i've done it wrong though, i didn't start my econnect test until 08:53ish and there doesn't seem to be much data for that, have a peek at attached, but i may need to rerun as i think ive done something wrong

https://pinescore.com/111/BUG_REPORT.zip

cagnulein commented 4 years ago

@rickoneeleven is there only this file inside? there is no .log file or bluetooth dir?

cagnulein commented 4 years ago

@rickoneeleven you should find something like this https://github.com/cagnulein/qdomyos-zwift/files/5486989/btsnoop_hci.log