Finally, part 5 gave you a look at the interface I built. A week later, the app looked nothing like version 1.
Part 6: The Future
The long Thanksgiving weekend was a productive one for the project. I spent a lot of time researching different packages to help with development and planning what to do next. I knew I was going to use React to build the user interface and I’d used webpack for bundling modules before. Setting some of this stuff up can be a pain, so I used webpack-express-boilerplate to get started. I’m using React Router for the routing library (keeps the UI in sync with the URL).
I wanted to pull in a set of components so I didn’t need to build everything from scratch. I don’t enjoy design work anyway. I eventually settled on React Toolbox, but that didn’t last long because I was running into theming issues right away. Material-UI had been a very close second on my list and I’m happy I made the switch.
I pretty much rewrote the entire app, limiting what the server handled and passing all of the calculations off to the client side where I could leverage React. Then last night after Jeff provided a time interval tip I ended up rewriting all of the timer code to be simpler and account for browser time shifting. This led me down a few different roads and it dawned on me that the Airdyne might actually do its calorie calculations with every single spin detection instead of at set intervals. Reworked all of that calculation code. Created even better metronome sample data and was able to get a new calorie formula where the coefficient of determination is 1.0, which means it’s perfect for the provided data! In a couple of tests the calorie error rate is now down around 1%.
Here’s where I’m at with version 1.2.1.
Switch between light and dark themes. The distance switch should speak for itself.
The Spin Detection settings actually control thresholds for sound detection. Depending on the device these may need to be adjusted. I’m using a circular progress component on the right side to show that spins are being detected (you have to be using the machine). As you can see, when I change one of the settings too much it no longer can “hear” (detect) the spin. Maybe I should make the progress indicator to a complete revolution for each spin detection. If anyone has any UI thoughts on this area, please share in the comments.
The layout of all of the data has changed from v1, but to toggle from km to miles and rpm to watts works the same with a simple tap of the area.
I didn’t like the individual action buttons in v1, especially with how touchy, or should I say non-touchy, my Raspberry Pi LCD is. Now the entire timer section is the action button. I put a faded icon there as a visual clue about the action. Giving the timing area a lot more room helps for the next feature on my to-do list.
Intervals are an important piece that is lacking from the Airdyne’s computer and limit how I’ve been able to use the machine at home. With so much room in the timing section I’ll be able to display an interval number and the upcoming interval or rest period. To go along with intervals, the Main Menu will get a new section for Custom Workouts. Initially it’ll have some pre-loaded workouts, such as Tabata, 20 rounds of :30/:30, 10 rounds of 1:00/1:00, Airdyne Hell (10 rounds of 0:15/1:45), 10:00, 30:00, etc. You get the idea.
Once that’s all working, I’ll implement a screen to create and save custom interval workouts. Those could be repeating intervals where you select:
- Unlimited or specify the # of times to repeat.
- Select time/calories/distance as the type of interval.
- Set the time duration, calorie “reps,” or length of distance depending on what type was selected.
- Choose undefined rest or set a length of time.
Intervals could also be variable. For example 5-4-3-2-1 miles with a one minute of rest between each. Or 3:00 work, 1:00 rest, 1:00 work, 2:00 rest, 4:00 work, 1:00 rest. Endless possibilities. Similar to the computers on Concept2 rowers and ski ergs. I’d like to allow custom names when saving a custom creation, but I can’t think of how to make it a good user experience on the Pi.
If you’re doing intervals, it seems natural to save log files of each workout. Those can be used to calculate lifetime calories, distance, and time which will be displayed on the splash screen. Maybe have options to email the log files. Possibly some historical charts or other analysis. I have a lot of notes with potential ideas.
An area I definitely need to address is building the app for deployment. Might need to be the next thing to tackle because right now I have the git repo cloned to my Pi. Launching the app is very slow because it has to finish the development build process. The boilerplate did set some stuff for a production build process but it’s not working or I didn’t properly update it as I made changes to everything.
Anyway, that’s all I have for now. I’ll post updates when I have something cool to share.
I think I spent more time writing these 6 posts than I did coding version 1 of the app. 🙂 If you made it this far, thanks for following. Everything is on GitHub if you want to check it out. If you have an Airdyne AD2 and use the app, I’d love to hear about it. Leave a comment or email me. I can see this app being forked and used for other fitness machines too. I know I had an elliptical years ago that was pretty basic and had a similar cable. Maybe I’ll spend some time making it easier to swap out a module to use for different devices.