user page
dvmarinoff / flux Goto Github PK
View Code? Open in Web Editor NEWIndoor Cycling App for Structured Training
Home Page: https://flux-web.vercel.app
License: GNU Affero General Public License v3.0
Indoor Cycling App for Structured Training
Home Page: https://flux-web.vercel.app
License: GNU Affero General Public License v3.0
Enabling larger fonts for a 13" laptop screen (HiDpi) would be very nice for improved readability (at a distance).
As it is, right now (Windows 10, Microsoft Edge), with the browser in full-screen mode (F11), the text information is somewhat hard to read, IMHO.
Right now, the screen is also not overly full, either, lots blank space where information could be present.
controllers.js:91 Uncaught TypeError: Cannot read property 'data' of undefined
at controllers.js:91
at HTMLDocument.<anonymous> (xf.js:12)
at XF.dispatch (xf.js:26)
at FileReader.reader.onload (file.js:13)
Case New User:
Page 1:
User starts at a page which asks for Name, FTP and weight.
If FTP is not known set a temporary one at sufficiently low value in the range of 90-200 depending on weight,
and suggest an FTP test.
Page 2:
Connect devices
Create a setup. That is a named combination of connected devices.
Like
'race':
Assioma Pedals for power and cadence,
Tacx Flux for controllable,
Polar HRM for heart rate.
'train':
Tacx Flux for power, cadence and controllable,
Fenix Watch for Heart rate
Page 3:
Choose between guided workout or guided recon session.
Case Existing User:
Pick from a list of existing Users.
Pick a setup.
Go to Home page.
add code to work with Battery Service
read battery level characteristic
file a bug report at bugs.chromium
NOTE: Web Bluetooth appears to have a bug when trying to recognize Battery Service.
Left a report, maybe I'll need to file a full bug report later. Waiting for response now
NOTE: added Issue 1155044
On youtube there are workout videos for training, so we could add an option to play a youtube video inside the app.
For example exchange the workout graph with something like:
<iframe id="ytplayer" type="text/html" width="720" height="405"
src="https://www.youtube.com/embed/ZiGE3-L4vyg"
frameborder="0" allowfullscreen>
Perhaps adding big buttons to change watt/resistance/slope
Hi, First of all, this is absolutely jaw dropping... ๐ ๐ ๐ ๐
Have you thought of adding maps support, i.e. these use cases?
Some of these features are currently supported in the official tacx training app. In order to be able to choose start / destination points, you have to export google maps directions to gpx, then reconvert the gpx file and upload it to the training app, only as a premium subscriber which is pretty annoying.
It's been a while since I last coded in nodejs, but if you need to I'm offering help to improve your tool.
Thanks in advance!
now we have only power, need to figure where to put both and how to fit them on the graph
outdoor power meters need to be connected over the Cycling Power Service (CPS)
add a custom attribute Slope="4.5"
that takes slope as a number between 0 and say 30 or max 45 in increments of 0.1.
The attribute will be supported for <SteadyState />
, <IntervalsT />
.
<SteadyState Duration="60" Slope="4.5" />
will turn on slope mode and set target to 4.5 % grade simulation
will turn on slope mode and set slope target to 9.0% for 60sec and 0.0% for 30sec, repeat for one more time (2 total)
<SteadyState Duration="60" Power="0.88" Slope="4.5" />
will set power target to 0.88 % of FTP, and slope target to 4.5%. The mode will be set to 1. the current active or 2. forced to slope mode. The User will be able to switch ERG and Slope mode with those predefined targets.
<SteadyState Duration="60" Power="230" Slope="4.5" />
power target is abs 250, slope target 4.5%
EDIT: it's just Slope
now, not SlopeTarget
[ ] - spin down UI
[ ] - spin down with FTMS
[ ] - persist status codes from spin down in settings
Supporting Ant+ on the web.
m1 mac chrome is the first place I see this error, it needs to be handled properly so it is clear that the connection is dropped.
characteristic.writeValue: DOMException: GATT Service no longer exists.
The indicator kept being green, despite the service drop. Tacx Flux S and 2 have a tendency of sometimes dropping the connection when you stop to pedal, but it goes to red, and this test was run with the nRF Connect Simulator, which kept thinking it is properly connected just missed all the ERG mode commands.
Opened the online version with Firefox, but could not figure out how to get started.
As Firefox support is not mentioned in the documentation, couldn't figure out whether it's a support issue, or PEBKAC.
Could Firefox support state be documented?
The idea of switching between Zwift SIM mode, Flux ERG and Slope mode.
geolocation (whatwebcando.today)
Using Geolocation Web API (MDN)
It has to make a suggestion for a workout based on user defined constraints like time, intensity, energy system. A current physical condition and recent workout history can be used to narrow down and simplify the process for the user.
Heart rate data (like HRV) can be used to dial in intensity and energy system suggestions.
L-system or GA can be used for the generation.
The Fitness Machine Equipment Service (bluetooth spec) calculates the speed of the flywheel and sends this as a speed value.
In SIM mode this is fine, but in ERG mode this makes the speed values meaningless. In ERG mode you are setting a power target, which the trainer needs to meet regardless of gear combination or cadence, which results in power output having no effect on speed.
You can set the bike in 34/17 gear and doing 300 watts or 100 watts have no effect on speed, on the other hand changing cadence from 70 to 90 will give you about 6km/h more. This results in wrong distance calculation.
The problem:
The solution:
Assuming flat terrain, the same way default SIM mode does, ERG speed can be calculated from power output.
The challenges:
This will require some assumptions to be made about:
The model could be simplified. At the end the resulting distance needs to match expectations (zwift, tr, ...) more than physics.
It's more general and has test coverage + it's written in functional style.
The ability to auto connect to the devices used in the previous session would be a nice convenience.
The status of the chrome feature is tracked here:
chromium
This is a pattern to implement it:
getDevices
its based on navigator.bluetooth.getDevices()
giving you a list of devices and device.watchAdvertisements({signal: abortController.signal})
to start listening for their availability.
Use this event to now that, and remember to abort the others once the needed device is there.
device.addEventListener('advertisementreceived', async (evt) => {})
When the graph is filled the new updates take a couple of minutes to show up.
That is when the app is installed for desktop with Edge.
Probably the screen size calculations are incorrect.
The app will work with .zwo workout format only.
In Zwift workout creator if I set PowerOne=40 and PowerTwo=75, on a Warmup tag it will be PowerLow=โ0.40โ and PowerHigh=โ0.75โ. So far so good, but if I set them to PowerOne=75 and PowerTwo=40, on a Cooldown tag they will become PowerLow=โ0.75โ and PowerHigh=โ0.40โ. This doesn't make any sense and there appears to be no official spec about it.
Spotted in here
changing the weight value updates the UI and is correctly stored in Local Storage, but page refresh defaults the UI widget to the default value of 75 instead of the correct one in Local Storage.
Add ability for the User to pause and resume just the workout in progress, but still continue the recording of data from devices and the overall timer running.
The power attribute must support absolute power targets like Power="250"
. If the value is Int and over 10 (1000% of FTP should be well beyond human capability) it should be treated as an absolute power target. The goal is to maintain compatibility with the existing standard.
<SteadyState Duration="60" Power="250"/>
<IntervalsT Repeat="2" OnDuration="60" OffDuration="30" OnPower="300" OffPower="140"/>
110 rpm, 50/13 gear, and 7 % grade tops at about 600-700 watts, with a feeling of the resistance lowering down at the unit the harder you try to go.
ability to control google maps street view through trainer input and recon a race course.
Flux is the name of my trainer and was just a temp choice so I can start coding the app. But it is not a good name because it conflicts with way too many other projects that have the same name including popular frameworks for React and Julia.
The new name needs to be unique and googleable. Zwift is example for good name, Trainer Road not so much (hard to pronounce or make you remember it). I've looked at cycling words in French and English, historical names in my native language and others.
Tried a couple of online name generators, but couldn't find something I like.
I need to settle on a name so I can buy a domain and put the project on some real hosting.
ability to read in advance what are the supported parts of FTMS on the Fitness Machine Control Point.
Distance
27213.403999999882
->
Distance
27.21 km
timer is just a setInterval(fn, 1000)
loop, which will drift with time. A self-adjusting timer will be a better solution.
Setting time on x-axis just under the current workout graph would give a better overview
of the workout and the remaining time.
options:
This has more meaningful information, but could create some clutter on short intervals like 40/20s.
less information, and also less clutter
for now it is Disabled as a feature, needs to tracked and fixed.
Setting resistance to a value say 200 results in the power graph showing readings of 200 W.
add pause and resume event messages to the .FIT file for when the recording is paused.
Thanks for the great app for using smart trainers. Following topic with my trainer 4iiii fliiiight
The trainer is not reporting the uuid:
deviceInformation: {
uuid: '0000180a-0000-1000-8000-00805f9b34fb'
but instead reporting generic access:
unfortunately due to this the actual app won't work because it misses device info.
I solved this by exchanging the uuids in services.js
deviceInformation: {
//new
uuid: '00001800-0000-1000-8000-00805f9b34fb',
manufacturerNameString: {uuid: '00002a00-0000-1000-8000-00805f9b34fb'},
modelNumberString: {uuid: '00002a00-0000-1000-8000-00805f9b34fb'},
firmwareRevisionString: {uuid: '00002a00-0000-1000-8000-00805f9b34fb'}
}
// old
// uuid: '0000180a-0000-1000-8000-00805f9b34fb',
// manufacturerNameString: {uuid: '00002a29-0000-1000-8000-00805f9b34fb'},
// modelNumberString: {uuid: '00002a24-0000-1000-8000-00805f9b34fb'},
// firmwareRevisionString: {uuid: '00002a26-0000-1000-8000-00805f9b34fb'}
// }
i did not find any manufacturerNameString, modelNumberString, firmwareRevisionString inside my ble reportings yet, so i just linked them to the device name as well
i also changed sensor location:
sensorLocation: {uuid: '00002a5D-0000-1000-8000-00805f9b34fb'},
// sensorLocation: {uuid: '00002a5A-0000-1000-8000-00805f9b34fb'},
due to ble reportings of my device and uuid pdf
with these changes your app was working without problems for my trainer as well.
So could you please add a routine which checks for 0x180A Device Information and if it does not find it, then checks for 0x1800 Generic Access to receive the name. Or works as well if there is no name received in device info and reports it just as "unknown"
Thanks
Keyboard controls Arrow Up key is working, Down key not so much.
It should lower the target value of the current active mode (ERG, Resistance, Slope) by the configured increment value.
This custom solution is often found on Tacx trainers and most notably the only present on their top trainer the NEO.
Uses a custom ble service 0xFEC1 to transmit ant messages covering the Fitness Machine profile.
Wahoo uses Cycling Power Service as a trainer control. They are adding a custom characteristic: A026E005-0A7D-4AB3-97FA-F1500F9FEB8B
. It supports setting of User weight, Simulation parameters, ERG target power, Load level and intensity. Doesn't have public documentation. The github projects SensorsSwiftTrainers and GoldenCheetah are the main sources.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.