Skip to content

Commit

Permalink
Merge branch 'develop' into Builtin.h_Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
doudar committed Dec 8, 2023
2 parents 3e84799 + 1be27ee commit 258464d
Show file tree
Hide file tree
Showing 22 changed files with 77,486 additions and 76,226 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure changelog is updated
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Repurposed LogComData. Will now not transmit any logging info to WiFi when it's turned off.
- Reworked web pages to start to implement more built in functions.
- Removed style.css (Internal to the program now).
- MIN_ERG_CADENCE created and changed from 20 to 30.
- Fixed DNS server in AP mode.
- Fixed an issue with IC4 and variants not displaying device name in Bluetooth scanner. Fixes #500

### Hardware
- Wire diameter reduced from 7.2mm to 6.0mm on the window passthrough to accommodate the latest batch of cables.
Expand All @@ -26,6 +29,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Increased size of the arm hardware holes by .25mm.
- Added Spinning L7 bike.
- Added Yosuda bike.
- Added Peloton low profile (for slammed bars) bike mount by @chaloney
- Updated CAD for the case to work flawlessly with small tweaks to motor height.
- Removed some free play in the IC4 insert.

## [23.6.28]
### Added
Expand Down
4 changes: 2 additions & 2 deletions Hardware/Common Assets/Arm/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Manufacturer|Model|Year|Arm Length (range)
----------: |:---:|:---:|:------:
BH Fitness||Any|50
Body Bike|Body Bike|Any|50 (Steep angle)
Bowflex|C6|Any|65
Bowflex|C6|Any|85
Echelon|Connect Sport|Any| 105
HMC|HMC|Any|60mm
Joroto|X2|Any|20
LeMond|RevMaster|Any|75
Peloton|Bike|Any|75 (90 for slammed bars)
PooBoo|?|Any|60-80
Schwinn|IC4|Any|65
Schwinn|IC4|Any|85
Spinning|L7|Any|20-40 (mount needs to go above SS2k)
Vortec|Vortec|Any|20
York|SB300|Any|20-40
Expand Down
Binary file not shown.
Binary file added Hardware/Common Assets/Inserts/Schwinn_IC4.STL
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Hardware/V3 - Integrated PCB/Case/Case/Body_Left.STL
Binary file not shown.
Binary file modified Hardware/V3 - Integrated PCB/Case/Case/Body_Right.STL
Binary file not shown.
Binary file not shown.
Binary file not shown.
75,355 changes: 37,996 additions & 37,359 deletions Hardware/V3 - Integrated PCB/Case/Case/CAD/Body_Drawing_Left.STEP

Large diffs are not rendered by default.

Binary file not shown.
78,283 changes: 39,443 additions & 38,840 deletions Hardware/V3 - Integrated PCB/Case/Case/CAD/Body_Drawing_Right.STEP

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<img src="/Pictures/Version3.jpg" alt="Hardware 3.0" height="124"> <img src="https://raw.githubusercontent.com/doudar/SmartSpin2k/develop/Pictures/ss2k_wiki_banner.png" alt="ss2k banner" height="124">

### You can now visit us at [Facebook](https://www.facebook.com/groups/716297469953492/)
# SmartSpin2k Revision 3.0 Announcement

We are excited to announce the release of SmartSpin2k revision 3.0! This new revision features a number of improvements, including:
Expand Down
2 changes: 1 addition & 1 deletion data/bluetoothscanner.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ <h2>
else if (t_obj[key].address) {
optionRemote.text = t_obj[key].address;
}
optionRemote.selected;
remoteDropdown.add(optionRemote);
}
}
Expand All @@ -188,6 +187,7 @@ <h2>
let noneOptionHR = document.createElement('option');
noneOptionHR.text = 'none';
let noneOptionRemote = document.createElement('option');
noneOptionRemote.selected;
noneOptionRemote.text = 'none';
PMDropdown.add(noneOptionPM);
HRDropdown.add(noneOptionHR);
Expand Down
3 changes: 3 additions & 0 deletions include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
// Amount to change watt target per shift in ERG mode.
#define ERG_PER_SHIFT 10

//Minimum cadence where ERG mode stops.
#define MIN_ERG_CADENCE 30

// Default Min Watts to stop stepper.
// This is used to set the lower travel limit for the motor.
#define DEFAULT_MIN_WATTS 50
Expand Down
41 changes: 22 additions & 19 deletions lib/SS2K/include/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
#define SMARTSPIN2K_SERVICE_UUID NimBLEUUID("77776277-7877-7774-4466-896665500000")
#define SMARTSPIN2K_CHARACTERISTIC_UUID NimBLEUUID("77776277-7877-7774-4466-896665500001")

// Device Information Service
#define DEVICEINFORMATIONSERVICE_UUID NimBLEUUID((uint16_t)0x180A)

// Heart Service
#define HEARTSERVICE_UUID NimBLEUUID((uint16_t)0x180D)
#define HEARTCHARACTERISTIC_UUID NimBLEUUID((uint16_t)0x2A37)

//BatteryLevel Service
#define BATTERYSERVICE_UUID NimBLEUUID((uint16_t)0x180F) // heart rate sensor service uuid, as defined in gatt specifications
#define BATTERYCHARACTERISTIC_UUID NimBLEUUID ((uint16_t)0x2A19)
// BatteryLevel Service
#define BATTERYSERVICE_UUID NimBLEUUID((uint16_t)0x180F) // heart rate sensor service uuid, as defined in gatt specifications
#define BATTERYCHARACTERISTIC_UUID NimBLEUUID((uint16_t)0x2A19)

// Cycling Power Service
#define CSCSERVICE_UUID NimBLEUUID((uint16_t)0x1816)
Expand Down Expand Up @@ -66,21 +69,21 @@
#define PELOTON_REQ_POS 1
#define PELOTON_CHECKSUM_POS 2

//BLE HID
#define APPEARANCE_HID_GENERIC_UUID NimBLEUUID((uint16_t)0x3C0)
#define APPEARANCE_HID_KEYBOARD_UUID NimBLEUUID((uint16_t)0x3C1)
#define APPEARANCE_HID_MOUSE_UUID NimBLEUUID((uint16_t) 0x3C2)
#define APPEARANCE_HID_JOYSTICK_UUID NimBLEUUID((uint16_t)0x3C3)
#define APPEARANCE_HID_GAMEPAD_UUID NimBLEUUID((uint16_t)0x3C4)
#define APPEARANCE_HID_DIGITIZER_TABLET_UUID NimBLEUUID((uint16_t)0x3C5)
#define APPEARANCE_HID_CARD_READER_UUID NimBLEUUID((uint16_t)0x3C6)
#define APPEARANCE_HID_DIGITAL_PEN_UUID NimBLEUUID((uint16_t)0x3C7)
#define APPEARANCE_HID_BARCODE_SCANNER_UUID NimBLEUUID((uint16_t)0x3C8)
#define APPEARANCE_HID_TOUCHPAD_UUID NimBLEUUID((uint16_t)0x3C9)
#define APPEARANCE_HID_PRESENTATION_REMOTE_UUID NimBLEUUID((uint16_t)0x3CA)
// BLE HID
#define APPEARANCE_HID_GENERIC_UUID NimBLEUUID((uint16_t)0x3C0)
#define APPEARANCE_HID_KEYBOARD_UUID NimBLEUUID((uint16_t)0x3C1)
#define APPEARANCE_HID_MOUSE_UUID NimBLEUUID((uint16_t)0x3C2)
#define APPEARANCE_HID_JOYSTICK_UUID NimBLEUUID((uint16_t)0x3C3)
#define APPEARANCE_HID_GAMEPAD_UUID NimBLEUUID((uint16_t)0x3C4)
#define APPEARANCE_HID_DIGITIZER_TABLET_UUID NimBLEUUID((uint16_t)0x3C5)
#define APPEARANCE_HID_CARD_READER_UUID NimBLEUUID((uint16_t)0x3C6)
#define APPEARANCE_HID_DIGITAL_PEN_UUID NimBLEUUID((uint16_t)0x3C7)
#define APPEARANCE_HID_BARCODE_SCANNER_UUID NimBLEUUID((uint16_t)0x3C8)
#define APPEARANCE_HID_TOUCHPAD_UUID NimBLEUUID((uint16_t)0x3C9)
#define APPEARANCE_HID_PRESENTATION_REMOTE_UUID NimBLEUUID((uint16_t)0x3CA)

#define HID_SERVICE_UUID NimBLEUUID((uint16_t)0x1812)
#define HID_INFORMATION_UUID NimBLEUUID((uint16_t)0x2A4A)
#define HID_REPORT_MAP_UUID NimBLEUUID((uint16_t)0x2A4B)
#define HID_SERVICE_UUID NimBLEUUID((uint16_t)0x1812)
#define HID_INFORMATION_UUID NimBLEUUID((uint16_t)0x2A4A)
#define HID_REPORT_MAP_UUID NimBLEUUID((uint16_t)0x2A4B)
#define HID_CONTROL_POINT_UUID NimBLEUUID((uint16_t)0x2A4C)
#define HID_REPORT_DATA_UUID NimBLEUUID((uint16_t)0x2A4D)
#define HID_REPORT_DATA_UUID NimBLEUUID((uint16_t)0x2A4D)
10 changes: 9 additions & 1 deletion src/BLE_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,14 @@ void SpinBLEClient::scanProcess(int duration) {
}

if (d.haveServiceUUID()) {
devices[device]["UUID"] = d.getServiceUUID().toString();
// Workaround for IC4 advertising this service first instead of FTMS.
// Potentially others may need to be added in the future.
// The symptom was the bike name not showing up in the HTML.
if (d.getServiceUUID() == DEVICEINFORMATIONSERVICE_UUID) {
devices[device]["UUID"] = FITNESSMACHINESERVICE_UUID.toString();
} else {
devices[device]["UUID"] = d.getServiceUUID().toString();
}
}
}
}
Expand Down Expand Up @@ -547,6 +554,7 @@ void SpinBLEClient::resetDevices(NimBLEClient *pClient) {
}
}

// Control a connected FTMS trainer. If no args are passed, treat it like an external stepper motor.
void SpinBLEClient::FTMSControlPointWrite(const uint8_t *pData, int length) {
NimBLEClient *pClient = nullptr;
for (int i = 0; i < NUM_BLE_DEVICES; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/ERG_Mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ void ErgMode::_updateValues(int newCadence, Measurement& newWatts, float newIncl
}

bool ErgMode::_userIsSpinning(int cadence, float incline) {
if (cadence <= 20) {
if (cadence <= MIN_ERG_CADENCE) {
if (!this->engineStopped) { // Test so motor stop command only happens once.
ss2k.motorStop(); // release tension
rtConfig.setTargetIncline(incline - WATTS_PER_SHIFT); // release incline
Expand Down

0 comments on commit 258464d

Please sign in to comment.