cagnulein / QZCompanionOCR

GNU Affero General Public License v3.0
0 stars 0 forks source link

Results of input swipe 100 100 200 200 30 #1

Open mwburden opened 1 year ago

mwburden commented 1 year ago

The Peloton Bike+ tablet does respond to "input swipe 100 100 200 200 30" as a touch. The command did not return an error.

While using the Peloton for Zwift I do not have a place on the screen to change resistance.

I can try a Peloton workout later and see if it shows up there, and I can load the Peloton app on my phone to see if that has any way to change the resistance.

cagnulein commented 1 year ago

Perfect! @mwburden for QZ companion you need to put Peloton app on foreground, so you need to find a screen, in the Peloton app, where you can change the resistance from the tablet directly.

Also when you have time try to load the apk https://github.com/cagnulein/QZCompanionPeloton/releases/tag/1.0.0 and follow the instructions https://github.com/cagnulein/QZCompanionPeloton/blob/master/README.md

Thanks!

mwburden commented 1 year ago

OK, I'll see what I can find! It might be Saturday before I have much time to try things.

mwburden commented 1 year ago

"for QZ companion you need to put Peloton app on foreground"

What will that mean for Zwifting on the Peloton Bike+? Usually I have Splashtop Wired Desktop in the foreground to display my laptop's screen (with Zwift running on the laptop.) Will I need another display for Zwift?

Some time ago I tested starting a Peloton workout and then putting it in the background when I started Zwift. It appears that the Peloton workout stopped.

cagnulein commented 1 year ago

@mwburden my actual solution use OCR to get metrics from the bike and input command to auto resistance the bike. So yes with this solution you need a different screen for Zwift.

I have also another solution that it doens't require peloton of foreground but for sure you will lose the ability for auto resistance.

So the perfect solution for you will be

  1. peloton screen for peloton workout and qz companion (in background)
  2. pc for qz (in background) and zwift
mwburden commented 1 year ago

Hmmm.... I hate to give up having Zwift on that really nice, big beautiful screen, but it sounds like it can't be helped. I should be able to try the QZ app this weekend.

mwburden commented 1 year ago

I tried a few different Peloton rides, but I didn't find any where the resistance could be controlled on-screen. I know that the tablet can control the resistance, because some of the classes have "auto follow" where the resistance will change depending on what the instructor says to do, but I didn't find any with on-screen buttons to change it -- as far as I can tell, either the instructor changes it or else you have to use the knob.

cagnulein commented 1 year ago

but there isn't any place where you can change it? i mean also outside a class?

mwburden commented 1 year ago

I tried the free-rides also. It shows the resistance on the screen, but as far as I can tell (so far, anyway -- I'll try some more later when my wife is done with the bike) the only way to change it (outside of the instructor changing it for you in an "auto follow" class) is to turn the knob.

cagnulein commented 1 year ago

that's a shame , did you check also in the settings where, maybe, there is something to calibrate it?

mwburden commented 1 year ago

There are probably a lot of things to try.... I haven't given up yet!

cagnulein commented 1 year ago

ok!

mwburden commented 1 year ago

I tried different classes (both scheduled and on-demand), free rides, scenic rides, etc., but I was not able to find any where there are controls on the screen to change the resistance. I asked my wife (who does a couple of Peloton rides every day, so she knows it way better than I do) and she says that there aren't any with on-screen controls -- the resistance is either "auto-follow", and the instructor sets it, or else you have to turn the knob to change it.

cagnulein commented 1 year ago

ok so i guess the only way is using the same method that peloton app does. Are you able to collect and adb logcat after a session with auto following?

Il giorno mar 21 feb 2023 alle 03:47 mwburden @.***> ha scritto:

I tried different classes (both scheduled and on-demand), free rides, scenic rides, etc., but I was not able to find any where there are controls on the screen to change the resistance. I asked my wife (who does a couple of Peloton rides every day, so she knows it way better than I do) and she says that there aren't any with on-screen controls -- the resistance is either "auto-follow", and the instructor sets it, or else you have to turn the knob to change it.

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/QZCompanionPeloton/issues/1#issuecomment-1437785023, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWEUKZ76QL3UV3HZQ5TWYQUEXANCNFSM6AAAAAAU6FQKD4 . You are receiving this because you were assigned.Message ID: @.***>

-- Roberto Viola Software engineer and open source enthusiast http://robertoviola.cloud

cagnulein commented 1 year ago

@mwburden just a notification that I renamed the repository, because the original name was too much dangerous in terms of legal issues :)

mwburden commented 1 year ago

Peloton.Log.230221-2107.txt

Near the beginning of the class I manually dialed the resistance up to 100, down to 0, up to 100 again, and back down.

During the class, resistance changes were (I may have missed one at the beginning):

2:30 - auto from 21 to 23 3:50 - auto to 30 5:45 - manual to 40 7:26 - auto to 50 9:08 - auto to 40

Let me know if I got what you wanted, or if you need me to do something different!

mwburden commented 1 year ago

It looks like the logfile date/time is in my local timezone (Eastern US, GMT-5). I started the log capture at 21:07, and it probably took me 2-3 minutes to select a class and start it, so the class probably starts at around 21:10 (plus or minus a couple minutes) in the log.

The times in my previous reply are minutes and seconds relative to the start of the class (i.e., the elapsed time that was shown in the Peloton class.)

cagnulein commented 1 year ago

nothing useful :(

02-21 21:25:01.277 12045 27085 I BikeSensorManager: Setting resistance to 40
02-21 21:25:01.278 12045 27085 I BikeSensorConnection: Set resistance to 40
02-21 21:25:01.278  2324  2344 D BikeServiceHelper: getCurrentResistance: 50
02-21 21:25:01.279  2324  2344 D BikeServiceHelper: getTargetResistance: 50
02-21 21:25:01.280 12045 27085 I BikeSensorConnection: Current Resistance: 50, Target Resistance: 50
02-21 21:25:01.284  2324  2344 D BikeServiceHelper: setResistance: 40
02-21 21:25:01.286   630  2583 I netd    : trafficSwapActiveStatsMap() <0.54ms>
02-21 21:25:01.288   630  2583 I netd    : tetherGetStats() <0.68ms>
02-21 21:25:01.299 12045 27090 I DiskTrimmableRegistry: TitanAutoFollowManager: changeResistance: 40
02-21 21:25:01.300 12045 27090 I BikeSensorManager: Setting resistance to 40
02-21 21:25:01.300 12045 27090 I BikeSensorConnection: Set resistance to 40
02-21 21:25:01.300  2324  2344 D BikeServiceHelper: getCurrentResistance: 50
02-21 21:25:01.302  2324  2355 D BikeHWCommunicator: setResistance: 40
02-21 21:25:01.302   746  4045 I btaudio_offload_qti: audio_get_a2dp_sink_latency_qti: Sink Latency = 0
02-21 21:25:01.306  2324  2344 D BikeServiceHelper: getTargetResistance: 50
02-21 21:25:01.308 12045 27090 I BikeSensorConnection: Current Resistance: 50, Target Resistance: 50
02-21 21:25:01.308  2324  2344 D BikeServiceHelper: setResistance: 40
02-21 21:25:01.309  2324  2355 D BikeHWCommunicator: setResistance: 40
02-21 21:25:01.330   630  2583 I netd    : bandwidthSetGlobalAlert(2097152) <0.16ms>
02-21 21:25:01.341 12045 27152 I okhttp.OkHttpClient: --> POST https://api.onepeloton.com/stats/packet (670-byte body)
02-21 21:25:01.341   746  4045 I btaudio_offload_qti: audio_get_a2dp_sink_latency_qti: Sink Latency = 0
02-21 21:25:01.381   746  4045 I btaudio_offload_qti: audio_get_a2dp_sink_latency_qti: Sink Latency = 0
02-21 21:25:01.404 12045 27084 I DiskTrimmableRegistry: TitanAutoFollowManager: changeResistance: 40
02-21 21:25:01.405 12045 27084 I BikeSensorManager: Setting resistance to 40
02-21 21:25:01.405 12045 27084 I BikeSensorConnection: Set resistance to 40
02-21 21:25:01.405  2324  2344 D BikeServiceHelper: getCurrentResistance: 50
02-21 21:25:01.405  2324  2344 D BikeServiceHelper: getTargetResistance: 40
02-21 21:25:01.405 12045 27084 I BikeSensorConnection: Current Resistance: 50, Target Resistance: 40
02-21 21:25:01.406  2324  2344 D BikeServiceHelper: setResistance: 40
02-21 21:25:01.407  2324  2355 D BikeHWCommunicator: setResistance: 40
02-21 21:25:01.421   746  4045 I btaudio_offload_qti: audio_get_a2dp_sink_latency_qti: Sink Latency = 0
mwburden commented 1 year ago

The connection between the tablet and the bike is a standard USB-C. Any chance of intercepting USB communication with a USB protocol analyzer?

Unfortunately, the only USB Protocol Analyzer that I've found recommended is nearly $500 USD. https://www.totalphase.com/products/beagle-usb12/

I also found this GitHub project, and the hardware that goes with it is a much more reasonable $120 (plus shipping) https://github.com/greatscottgadgets/Facedancer http://goodfet.sourceforge.net/hardware/facedancer21/ https://hackerwarehouse.com/product/facedancer21/

The other tricky part is that the tablet receives its power from the bike via this same USB-C connection. There is another USB-C connection, though, so it may be possible to use a USB power supply to supply power on this port while connecting the bike to the other USB-C port.

Of course, that will only be useful if you know what to do with that data once it's captured (because I sure don't! :) )

cagnulein commented 1 year ago

I like the idea, but maybe there is an easiest solution: we can sniff the serial port from android directly? probably the serial port is /dev/tty something, maybe /dev/ttyUSB0

you can try from adb to do

ls /dev/tty*

cagnulein commented 1 year ago

also check what I wrote on reddit yesterday on the chat

mwburden commented 1 year ago

also check what I wrote on reddit yesterday on the chat

Are you talking about the renaming of the repository? I see that the name changed in this URL... is there something else I need to do?

cagnulein commented 1 year ago

no i wrote another thing, that i can't say here :)

mwburden commented 1 year ago

OK, this is my first time using GitHub... I'm not seeing a notification of a chat message or how to see the chat?

mwburden commented 1 year ago

Oh... duh.. reddit. Need more coffee. :)