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

Simulate ANT+ without raspberry pi? #2

Open
maurera opened this issue Jun 11, 2020 · 1 comment
Open

Simulate ANT+ without raspberry pi? #2

maurera opened this issue Jun 11, 2020 · 1 comment

Comments

@maurera
Copy link

maurera commented Jun 11, 2020

@iaroslavn - thanks for sharing this code. I have a Peloton without a subscription and this allows me to still record my data. I'm in the process of modifying the code to write to a TCX file with cadence/power/speed/distance, rather than send over the REST API with Flask. At least I can then save my rides to Strava / Garmin Connect

I saw in your zwack-bike project you show how to send cadence and power data over a BLE sensor and raspberry pi. I'm wondering how you could get Zwift working on the same computer that's running peloton-bike-metrics-server. Do you know if you could simulate a BLE or ANT+ device on the PC without having to actually have a raspberry pi and send the data? Eg SIMULANT+ seems like a possibility.

Note - I'm new to Github. I'm not sure if there's a "comment" section - the only area I could find to send this message is "Issues", even though this isn't an issue.

Note2 - Tesseract seems to have issues maybe 10% of the time. The most common issues are reading 1 as "]" or 0 as "O", but there have been others, like 4 as "A". It looks like maybe this could be fixed somewhat with different tesseract config parameters?

@iaroslavn
Copy link
Owner

iaroslavn commented Jun 11, 2020

Hi @maurera,
Thanks for the interest in this project.
Unfortunately, I will be away from my Windows laptop for about 2 months, so I can only provide limited support at the moment.

This project was a one-day DIY effort to connect Peloton with Zwift, and like any DIY project it has many limitations, the biggest of all is having to grab metrics from the projected screen image which has some lag and most importantly has to be adjusted every time Peloton UI changes. Thus, if you are very early in your journey I would suggest evaluating the option of attaching physical Cadence/Speed sensors to your bike and retrieving data from them (some models can post to Strava automatically). This will completely detach you from the specifics of Peloton implementation and might require zero coding efforts to achieve your goals, as some sensors come with mobile apps that post data to Strava or even have TCX file export capabilities. E.g. you can have a look at https://youtu.be/xyUPrT5rvT8?t=49.

Do you know if you could simulate a BLE or ANT+ device on the PC without having to actually have a raspberry pi and send the data?

The software that runs on Raspberry Pi in my setup is from this repository: https://github.com/iaroslavn/zwack-bike.
It uses https://github.com/noble/bleno module to do all the BLE simulation. This module claims to have support for Windows, thus if your Windows machine has a physical Bluetooth module you might succeed in starting https://github.com/iaroslavn/zwack-bike on your Windows machine instead of Raspberry PI.
I would simply try to follow the installation instruction given on https://github.com/iaroslavn/zwack-bike page and see if they work (instructions are given for Mac/Linux machines but essentially what you need is to check out the project and make sure npm install command completes successfully).
Please note that if you manage to start the zwack-bike BLE simulator on your Windows machine you still would need to use the Zwift Companion app on your mobile device. In my video I showed the Zwift app running on my laptop, but I am also able to take Zwift rides just on my iPhone and it communicates with Raspberry PI BLE simulator just fine.

Note2 - Tesseract seems to have issues maybe 10% of the time... It looks like maybe this could be fixed somewhat with different tesseract config parameters?

You are absolutely correct. Ideally, we need a way to tell Tesseract to just recognize 0-9 digits. You might want to check this thread: tesseract-ocr/tesseract#751.
If whitelisting digits doesn't work as expected you can try general techniques to improve digit recognition, e.g.:
https://www.freecodecamp.org/news/getting-started-with-tesseract-part-ii-f7f9a0899b3f/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants