olliv / bfree Goto Github PK
View Code? Open in Web Editor NEWBfree smart trainer app.
Home Page: https://bfree.vercel.app
License: GNU General Public License v3.0
Bfree smart trainer app.
Home Page: https://bfree.vercel.app
License: GNU General Public License v3.0
Seems to be jumping a lot.
Same as previously somewhere else, the scaling is wrong. Perhaps not scaled tockm/h properly.
The back button on the Title element is horribly unintuitive as it is now.
Create a training session object that has useRef
to the selected measurements.
Example:
{
speedRef: [ cscRef, csRed ],
powerRef: [ cspRed ]
}
Save config on regular interval by checking if there are changes using setTimeout()
and a global flag. Show a notification when the config is stored to local storage.
It's already a JSON blob so we could allow exporting and importing it.
This could be nice addition as it doesn't require internet connection anyway.
One possible solution is here next-pwa.
There should be an useEffect()
or something somewhere that would update the user params when something is changed and the trainer is already connected.
Currently there is an empty space and we shift stuff when the controller is added. Instead an empty card should be replaced with the new one.
It would be good to always see whether the sensors are connected and working. This could potentially include battery level warnings.
Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table>. Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.
in tr (at MeasurementCard.tsx:132)
in table (at MeasurementCard.tsx:121)
in div (created by ForwardRef(Container))
in ForwardRef(Container) (created by
Currently we only get accumulated wheel revolutions from the speed sensor which can be used to calculate the distance.
The ANT+ FE-C over BLE profile supports calculation of accumulated distance directly.
Basic stats are missing from the recording mode.
(async () => {
try {
const isBluetoothAvailable = await navigator.bluetooth.getAvailability();
log(`> Bluetooth is ${isBluetoothAvailable ? 'available' : 'unavailable'}`);
} catch(error) {
log('Argh! ' + error);
}
})();
if ('onavailabilitychanged' in navigator.bluetooth) {
navigator.bluetooth.addEventListener('availabilitychanged', function(event) {
log(`> Bluetooth is ${event.value ? 'available' : 'unavailable'}`);
});
}
https://googlechrome.github.io/samples/web-bluetooth/availability-async-await.html
Initially it would be probably enough to support the three resistance modes or even just power.
The workouts could even just scripted with JS. This would/should allow an easy access to different lap triggering modes (time, distance, etc.).
but allow in dev mode?
There is no valid reason to start a workout script if the smartTrainer
object is not initialized.
It's currently half-done as history.tsx
will load all the loggers but isn't able to show any.
There might be also a memory consumption concern. Maybe it shouldn't load all the data permanently but create a new logger when one is actually needed again?
Screen saver will unmount the resistance component which makes the matter worse.
Show target power πΊπ»π sent by the trainer.
The trainer might be left in undefined state if a calibration run fails.
Read gpx or some other format and sync video speed to the cycling speed.
Missing measurements should either be replaced with the previous measurement or with a zero, or intelligently with and average of the previous and next measurement if existing.
Show a question mark and a tool top or model explaining why each thing is asked. E.g. bike type is asked because it's used for calculating the correct wind resistance coefficient.
At least avg speed and probably others too may go NaN if a value is missing or the ride is paused, not sure which one or both.
Making a lap split doesn't fix the issue.
The graph shows the correct speed buy it looks like the speed measurement card is showing m/s while the unit shown is km/h.
Moving the title to the left side of the page and moving the content up in the record page would give more space for the measurements. It would be nice to animate this move if possible.
Currently the log is incomplete after a crash. It should be fairly easy to recover an incomplete log in most of the cases.
We could either show an error and ask the user to press a button or attempt an automatic fix.
The setState
s are used incorrectly and that breaks unpairing action after leaving the page and coming back.
For example a trainer may have a FE-C and a separate power meter in the same device, if one is disconnected the browser will disconnect all active services.
This sometimes results the following error:
Uncaught (in promise) DOMException: GATT Service no longer exists.
This should result the FEC-C service being dropped as well.
Is there any better way to make it absolutely sure that we don't lose the BLE connections if something happens? Pretty much everything else can be just pushed to the local storage either immediately or periodically. Is it possible to move the data logging to a worker?
Provide the following predefined values as well as manual input.
Terrain | coeff |
---|---|
Wooden track | 0.001 |
Concrete | 0.002 |
Asphalt road | 0.004 |
Rough road | 0.008 |
There is a button and there is already a way to do it from the results page but neither is currently accessible.
Ignore zeroes, avg whatever it's that makes bad cadence sensors less useless. Should be a toggle switch in the sensors setup.
We are probably missing the right bike parameters to calculate speed and distance accurately. The trainer is currently sending a User configuration required
flag all the time.
Needs implementation.
Should be a pretty simple script to write.
Add support for Bluetooth blood oximeters. This could be potentially shown along with hr data and the oximeter can also act as a source for HR.
It would be really nice to able to configure the date format used in lists and elsewhere.
The max
and avg
values for speed are still randomly showing NaN
and Infinity
for the rest of the session since the beginning.
The graph sometimes fails in the beginning and requires a lap split to start drawing something.
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.