Code Monkey home page Code Monkey logo

Comments (16)

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear David,
An ESP32 Guru in panic .... that is not what one wants to experience!
Are the Jetblack Volt Trainer engineers not the same ones behind the Zwift Hub? The last one is known to work perfectly with the very same code (client, bridge and Simcline). Apparently the engineers have made a crucial change in the code for the Jetblack Volt that made the ESP32 Guru panic. I am not sure what exactly has been changed but I have published a Client v012 that is more robust when reading the sensor locations of CPS, CSC and HBM. The panic occurred with CP but I assumed CSC and HBM would face the same problem when it was their turn.... Please keep me posted!
Best wishes,
Jörgen.

from simcline.

davidbonenfant52 avatar davidbonenfant52 commented on May 25, 2024

Hi Jorgen
Thanks for the quick reply.
From what I've read it seems the zwift and volt trainers have indepedent software teams but may be collaborating given the physical trainer is pretty much the same.
I have tried the Client v012 and it seems to be working! I am getting ongoing readings from the trainer for resistance level, instantaneous power, average power etc. so looks good.
I have yet to try the bridge but I'm guessing it will require the modification that you did for the client code?

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Good morning David,
It is always nice to take the panic away! I will modify all the programs accordingly a.s.a.p. and upload new versions! Check the repository and continue your reconnaissance. However, I am still very curious to see what the serial monitor output is exactly telling us, now that the Client is working without failure. I want to know what these engineers have changed when reading the sensor locations, that caused the fatal failure. I have sticked (as far as I know) to what is published by the standard committee that oversees FTMS...
Please copy/paste the (relevant) output when running the code again, I would very much appreciate that!
Best wishes,
Jörgen.

from simcline.

davidbonenfant52 avatar davidbonenfant52 commented on May 25, 2024

Hi again Jorgen,

This time it is not a panic issue but a resistance issue!

Sorry but I may have jumped to conclusions while testing the client code. The esp32 is picking up the trainer data but it is not simulating changes in resistance. I also tried the bridge code and it is functioning in transmitting trainer data to app but the app doesn't seem to be transmitting resistance to the trainer. I posted the serial monitor output for the client code here (and afterwards for the bridge code):

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
ESP32 BLE Client/Central: CPS, CSC, HBM and FTMS
------------------- Version 01.2 --------------------
Client Starts Scanning for Server Device with CPS, CSC and FTMS!
BLE Advertised Device found: Name: , Address: 5a:be:ec:49:ea:07, manufacturer data: 0600010920020bd959614b10c95494ffa2455706e96d368ec53cd0c56a
BLE Advertised Device found: Name: , Address: 33:cf:94:8b:19:5f, manufacturer data: 060001092022f419e6d1a828f86633a146020d97e97704450f0f51edd4
BLE Advertised Device found: Name: , Address: 08:59:45:e2:c1:5d, manufacturer data: 06000109202291984ada6d2d4cff4187a8e61b664699faaae5988715a6
BLE Advertised Device found: Name: Volt, Address: ed:84:37:e2:f5:e5, appearance: 1152, serviceUUID: 0x1826
Service Data:
UUID: 0x1826, Data: �
Client Connection Parameters -> Interval: [40] Latency: [0] Supervision Timeout: [256]
ESP32 Client connected to Server device with Name: [Volt] MAC Address: [ED:84:37:E2:F5:E5] MTU: [244]
Now checking all Client Services and Characteristics!
If Mandatory Services Fail --> the Client will disconnect!
Client Generic Access: Found!
-> Client Reads Device Name: [Volt]
-> Client Reads Appearance: [1152]
Client Device Information Service: Found!
-> Client Reads Manufacturer Name: [JetBlack]
-> Client Reads Model Number: [05]
-> Client Reads Serial Number: [828]
Client_CyclingPower_Service: Found!
Client_CP_Measurement_Chr: Found!
Client_CP_Feature_Chr: Found!
-> Client Reads Raw CP Feature bytes: [4] [ 0C 00 00 00 ]
Wheel revolution data supported
Crank revolution data supported
Client_CP_Location_Chr: Found!
-> Client Reads CP Location Sensor: Loc#: 201
Cycling Power Measurement: Notify Enabled!
Client_CyclingSpeedCadence_Service: Found!
Client_CSC_Measurement_Chr: Found!
Client_CSC_Feature_Chr: Found!
-> Client Reads Raw CSC Feature bytes: [2] [ 03 00 ]
Wheel rev supported
Crank rev supported
Client_CSC_Location_Chr: Found!
-> Client Reads CSC Location Sensor: Loc#: 12 Rear wheel
Client_CSC_Measurement_Chr: Notify Enabled!
Client_FitnessMachine_Service: Found!
Client_FTM_Feature_Chr: Found!
-> Client Reads Raw FTM Feature bytes: [8] [ 87 44 00 00 0C E0 00 00 ]

  • Fitness Machine Features:
    Average Speed Supported
    Cadence Supported
    Total Distance Supported
    Resistance Level Supported
    Heart Rate Measurement Supported
    Power Measurement Supported
  • Target Setting Features:
    Resistance Target Setting Supported
    Power Target Setting Supported
    Indoor Bike Simulation Parameters Supported
    Wheel Circumference Configuration Supported
    Spin Down Control Supported
    Client_FTM_IndoorBikeData_Chr: Found!
    Client_FTM_IndoorBikeData_Chr: Notify Enabled!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Client_FTM_TrainingStatus_Chr: Not Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    Client_FTM_SupportedResistanceLevelRange_Chr: Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Reads Raw FTM Supported Resistance Level Range bytes: [6] [ 00 00 64 00 01 -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 00 ]
    64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    Client_FTM_SupportedPowerRange_Chr: Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Reads Raw FTM Supported Power Range bytes: [6] [ 00 00 E8 03 01 00 ]
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    Client_FTM_ControlPoint_Chr: Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    Client_FTM_ControlPoint_Chr: Indicate Enabled!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 00 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 1D 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 0 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    Client_FTM_Status_Chr: Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 C7 00 00 00 14 00 00 00 00 ]
    Instant. Speed: 1 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 1B 01 00 00 14 00 00 00 00 ]
    Instant. Speed: 2 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 77 01 00 00 14 00 00 00 00 ]
    Instant. Speed: 3 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 CA 01 00 00 14 00 00 00 00 ]
    Instant. Speed: 4 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 27 02 00 00 14 00 00 00 00 ]
    Instant. Speed: 5 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 94 02 00 00 14 00 00 00 00 ]
    Instant. Speed: 6 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 3D 03 00 00 14 00 00 00 00 ]
    Instant. Speed: 8 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 D2 03 00 00 14 00 00 00 00 ]
    Instant. Speed: 9 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 5A 04 00 00 14 00 00 00 00 ]
    Instant. Speed: 11 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 C9 04 00 00 14 00 00 00 00 ]
    Instant. Speed: 12 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 0 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 1B 05 00 00 14 00 55 00 00 ]
    Instant. Speed: 13 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 85 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 3C 05 00 00 14 00 68 00 00 ]
    Instant. Speed: 13 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 104 Watt Heart Rate: 0 HBM
    Client_FTM_Status_Chr: Notify Enabled!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 48 05 00 00 14 00 7A 00 00 ]
    Instant. Speed: 13 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 122 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 52 05 00 00 14 00 87 00 00 ]
    Instant. Speed: 13 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 135 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 78 05 00 00 14 00 8E 00 00 ]
    Instant. Speed: 14 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 142 Watt Heart Rate: 0 HBM
    Client_HeartRate_Service: Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 B8 05 00 00 14 00 8E 00 00 ]
    Instant. Speed: 14 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 142 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 12 06 00 00 14 00 8C 00 00 ]
    Instant. Speed: 15 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 140 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 54 06 00 00 14 00 86 00 00 ]
    Instant. Speed: 16 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 134 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 9E 06 00 00 14 00 80 00 00 ]
    Instant. Speed: 16 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 128 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 BC 06 00 00 14 00 79 00 00 ]
    Instant. Speed: 17 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 121 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 C3 06 00 00 14 00 74 00 00 ]
    Instant. Speed: 17 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 116 Watt Heart Rate: 0 HBM
    Client_HR_Measurement_Chr: Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 CC 06 00 00 14 00 71 00 00 ]
    Instant. Speed: 17 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 113 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 FF 06 00 00 14 00 71 00 00 ]
    Instant. Speed: 17 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 113 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 58 07 00 00 14 00 72 00 00 ]
    Instant. Speed: 18 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 114 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 A8 07 00 00 14 00 75 00 00 ]
    Instant. Speed: 19 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 117 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 BB 07 00 00 14 00 79 00 00 ]
    Instant. Speed: 19 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 121 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 B6 07 00 00 14 00 7B 00 00 ]
    Instant. Speed: 19 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 123 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 BC 07 00 00 14 00 7B 00 00 ]
    Instant. Speed: 19 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 123 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 D9 07 00 00 14 00 7B 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 123 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 07 08 00 00 14 00 7C 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 124 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 2D 08 00 00 14 00 7E 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 126 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 31 08 00 00 14 00 7F 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 127 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 26 08 00 00 14 00 7D 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 127 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 26 08 00 00 14 00 7D 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 125 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 1E 08 00 00 14 00 7B 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 123 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 2E 08 00 00 14 00 79 00 00 ]
    Instant. Speed: 20 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 121 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 4D 08 00 00 14 00 78 00 00 ]
    Instant. Speed: 21 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 120 Watt Heart Rate: 0 HBM
    Client_HR_Location_Chr: Found!
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 5D 08 00 00 14 00 77 00 00 ]
    Instant. Speed: 21 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 119 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 4D 08 00 00 14 00 74 00 00 ]
    Instant. Speed: 21 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 116 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 3E 08 00 00 14 00 6F 00 00 ]
    Instant. Speed: 21 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 111 Watt Heart Rate: 0 HBM
    -> Client Reads HR Location Sensor: Loc#: 1 Chest
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 51 08 00 00 14 00 6A 00 00 ]
    Instant. Speed: 21 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 106 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 78 08 00 00 14 00 68 00 00 ]
    Instant. Speed: 21 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 104 Watt Heart Rate: 0 HBM
    -> Client Rec'd Raw FTM Indoor Bike Data: [1] [11] [ 64 02 97 08 00 00 14 00 68 00 00 ]
    Instant. Speed: 21 KPH Instantaneous Cadence: 0 RPM Resistance Level: 20 Instantaneous Power: 104 Watt Heart Rate: 0 HBM
    Client_HR_Measurement_Chr: Notify Enabled!

Here is the serial monitor output for the bridge:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
ESP32 NimBLE MITM supporting: CPS, CSC, HBM and FTMS
------------------ Version 01.4 --------------------
Configuring the default Generic Access Service
Successfully Set Generic Access Appearance Chr value to: [1152] Generic Cycling
Successfully Set Generic Access Device Name Chr value to: [Sim ESP32]
Configuring the Server Nordic Uart Service
Configuring the Server Device Information Service
Configuring the Server Cycle Power Service
Configuring the Server Cadence and Speed Service
Configuring the Server Fitness Machine Service
Configuring the Server Heart Rate Service
Setting up the Server advertising payload(s)
Setting Appearance in Advertised data to [1152]
Server is advertising: CPS, CSC and FTMS
Client Starts Scanning for Server Device with CPS, CSC and FTMS!
Found advertising Peripheral with FTMS enabled! See data:
Name: Volt, Address: ed:84:37:e2:f5:e5, appearance: 1152, serviceUUID: 0x1826
Service Data:
UUID: 0x1826, Data: �
Client Connection Parameters -> Interval: [40] Latency: [0] Supervision Timeout: [256]
ESP32 Client connected to Server device with Name: [Volt] MAC Address: [ED:84:37:E2:F5:E5] Handle: [0] MTU: [244]
Now checking all Client Services and Characteristics!
If Mandatory Services Fail --> the Client will disconnect!
Client Generic Access: Found!
-> Client Reads Device Name: [Volt]
-> Client Reads Appearance: [1152]
Client Device Information Service: Found!
-> Client Reads Manufacturer Name: [JetBlack]
-> Client Reads Model Number: [05]
-> Client Reads Serial Number: [828]
Client_CyclingPower_Service: Found!
Client_CP_Measurement_Chr: Found!
Client_CP_Feature_Chr: Found!
-> Client Reads Raw CP Feature bytes: [4] [ 0C 00 00 00 ]
Wheel revolution data supported
Crank revolution data supported
Client_CP_Location_Chr: Found!
-> Client Reads CP Location Sensor: Loc#: 201
Client_CyclingSpeedCadence_Service: Found!
Client_CSC_Measurement_Chr: Found!
Client_CSC_Feature_Chr: Found!
Server Connection Parameters -> Interval: [48] Latency: [0] Supervision Timeout: [960]
ESP32 Server connected to Client device with MAC Address: [9C:B6:D0:9A:8B:E8] Conn Handle: [1]
Central (MyLaptop/Zwift) has to set CP/CSC/FTMS CCCD Notify/Indicate (enable) and start....
MTU updated: 255 for connection ID: 1
-> Client Reads Raw CSC Feature bytes: [2] [ 03 00 ]
Wheel rev supported
Crank rev supported
Client_CSC_Location_Chr: Found!
-> Client Reads CSC Location Sensor: Loc#: 12 Rear wheel
Client_FitnessMachine_Service: Found!
Client_FTM_Feature_Chr: Found!
-> Client Reads Raw FTM Feature bytes: [8] [ 87 44 00 00 0C E0 00 00 ]

  • Fitness Machine Features:
    Average Speed Supported
    Cadence Supported
    Total Distance Supported
    Resistance Level Supported
    Heart Rate Measurement Supported
    Power Measurement Supported
  • Target Setting Features:
    Resistance Target Setting Supported
    Power Target Setting Supported
    Indoor Bike Simulation Parameters Supported
    Wheel Circumference Configuration Supported
    Spin Down Control Supported
    Client_FTM_IndoorBikeData_Chr: Found!
    Central Updated CCCD --> Notify Enabled for Char: [0x2a63]
    Central Updated CCCD --> Notify Enabled for Char: [0x2a5b]
    Central Updated CCCD --> Notify Enabled for Char: [0x2ada]
    Central Updated CCCD --> Notify Enabled for Char: [0x2ad2]
    Client_FTM_TrainingStatus_Chr: Not Found!
    Central Updated CCCD --> Indicate Enabled for Char: [0x2ad9]
    Central Updated CCCD --> Notify Enabled for Char: [0x2a37]
    Client_FTM_SupportedResistanceLevelRange_Chr: Found!
    --> Raw FTM Control Point Data [len: 1] [OpCode: 00] [Values: 00 ]
    Request Control of Machine!
    --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 00 00 00 00 00 ]
    Set Indoor Bike Simulation Parameters!
    Wind speed (1000): 0.00 | Grade (100): 0.00 | Crr (10000): 0.00 | Cw (100): 0.00
    -> Client Reads Raw FTM Supported Resistance Level Range bytes: [6] [ 00 00 64 00 01 00 ]
    Client_FTM_SupportedPowerRange_Chr: Found!
    -> Client Reads Raw FTM Supported Power Range bytes: [6] [ 00 00 E8 03 01 00 ]
    Client_FTM_ControlPoint_Chr: Found!
    Client_FTM_Status_Chr: Found!
    Client_HeartRate_Service: Found!
    Client_HR_Measurement_Chr: Found!
    Client_HR_Location_Chr: Found!
    -> Client Reads HR Location Sensor: Loc#: 1 Chest
    All Client (Trainer) Characteristics are Notify/Indicate Enabled!
    All Client (Trainer) Characteristics are Notify/Indicate Enabled!

After the above line, there is no output on the serial monitor while using app

I shut down app here and this is the output that follows:

Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2a63]
Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2a5b]
Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2ada]
Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2ad2]
Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2ad9]
Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2a37]
ESP32 Server disconnected from Central (MyLaptop) Conn handle: [1] Mac Address: [9C:B6:D0:9A:8B:E8]
--> ESP32 Server is advertising again!
All Client (Trainer) Characteristics are Notify/Indicate Disabled!

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Hello David,
Lets have a look first at the Client software ....
After connection it sends the first 5 minutes of the Volcano Circuit ride to the trainer and repeats that for ever...

    1. Move the trainer pedals and notice/feel changes in resistance...
  • The Client sends Resistance Parameters to the Trainer that coincide 
    
  • with the first 5 minutes of the Zwift Volcano Circuit!
    

The output shows that the trainer is recording that you were making speed and developing power to do so. That info is send to the Client by the trainer (and printed).... You should feel changing resistance and you apparently did as is shown by the power values... you had to overcome resistance to produce these power values (with a max of 140 watt). It does look like everything is working as to be expected. Notice that the the Volcano Circuit has changing slopes of around 2-3 percent, may be you are so strong that you did not notice...

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Hi again,
The output produced when you were running the Bridge code tells me that everything was fine and the Bridge software was waiting (in the end) for the trainer to send operational info .... nothing happened .... until you shut down Zwift when the connection was disabled. No error messages....
So the question is what were you doing when the connection was established????

9) Start the default Zwift ride or any ride you wish
  1. Make Serial Monitor output window visible on top of the Zwift window
  2. Hop on the bike: do the work and feel resistance change with the road

What Zwift ride did you choose and how long did you ride?

from simcline.

davidbonenfant52 avatar davidbonenfant52 commented on May 25, 2024

Hi Jorgen
I had actually tried the client software once before making the recent update to my volt trainer and I was feeling the change in resistance at that time. However since I did the volt update, the client code was not working anymore (until you fixed the meditationguru error) and now I am not feeling resistance anymore on the trainer with the client code and bridge code.

For the bridge code, I am actually using mywhoosh app so I don't know if this is having a negative effect on the code. I tried the same ride with the app connected directly to the trainer vs. with man in the middle and there is no resistance feel when the ESP32 is connected whereas there is resistance when it is a direct connection so there is something not getting to the trainer when the esp32 is in the middle.
To answer your question, I was riding for around 9 minutes while the connection was established. This was a ride with flats and uphill sections as well. While I was riding, there was nothing new coming up on the serial monitor.

Here is the serial monitor output for the bridge for a ride a did today:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
ESP32 NimBLE MITM supporting: CPS, CSC, HBM and FTMS
------------------ Version 01.4 --------------------
Configuring the default Generic Access Service
Successfully Set Generic Access Appearance Chr value to: [1152] Generic Cycling
Successfully Set Generic Access Device Name Chr value to: [Sim ESP32]
Configuring the Server Nordic Uart Service
Configuring the Server Device Information Service
Configuring the Server Cycle Power Service
Configuring the Server Cadence and Speed Service
Configuring the Server Fitness Machine Service
Configuring the Server Heart Rate Service
Setting up the Server advertising payload(s)
Setting Appearance in Advertised data to [1152]
Server is advertising: CPS, CSC and FTMS
Client Starts Scanning for Server Device with CPS, CSC and FTMS!
Found advertising Peripheral with FTMS enabled! See data:
Name: Volt, Address: ed:84:37:e2:f5:e5, appearance: 1152, serviceUUID: 0x1826
Service Data:
UUID: 0x1826, Data: �
Client Connection Parameters -> Interval: [40] Latency: [0] Supervision Timeout: [256]
ESP32 Client connected to Server device with Name: [Volt] MAC Address: [ED:84:37:E2:F5:E5] Handle: [0] MTU: [244]
Now checking all Client Services and Characteristics!
If Mandatory Services Fail --> the Client will disconnect!
Client Generic Access: Found!
-> Client Reads Device Name: [Volt]
-> Client Reads Appearance: [1152]
Client Device Information Service: Found!
-> Client Reads Manufacturer Name: [JetBlack]
-> Client Reads Model Number: [05]
-> Client Reads Serial Number: [828]
Client_CyclingPower_Service: Found!
Client_CP_Measurement_Chr: Found!
Client_CP_Feature_Chr: Found!
-> Client Reads Raw CP Feature bytes: [4] [ 0C 00 00 00 ]
Wheel revolution data supported
Crank revolution data supported
Client_CP_Location_Chr: Found!
-> Client Reads CP Location Sensor: Loc#: 201
Client_CyclingSpeedCadence_Service: Found!
Client_CSC_Measurement_Chr: Found!
Client_CSC_Feature_Chr: Found!
-> Client Reads Raw CSC Feature bytes: [2] [ 03 00 ]
Wheel rev supported
Crank rev supported
Client_CSC_Location_Chr: Found!
-> Client Reads CSC Location Sensor: Loc#: 12 Rear wheel
Client_FitnessMachine_Service: Found!
Client_FTM_Feature_Chr: Found!
-> Client Reads Raw FTM Feature bytes: [8] [ 87 44 00 00 0C E0 00 00 ]

  • Fitness Machine Features:
    Average Speed Supported
    Cadence Supported
    Total Distance Supported
    Resistance Level Supported
    Heart Rate Measurement Supported
    Power Measurement Supported
  • Target Setting Features:
    Resistance Target Setting Supported
    Power Target Setting Supported
    Indoor Bike Simulation Parameters Supported
    Wheel Circumference Configuration Supported
    Spin Down Control Supported
    Client_FTM_IndoorBikeData_Chr: Found!
    Client_FTM_TrainingStatus_Chr: Not Found!
    Client_FTM_SupportedResistanceLevelRange_Chr: Found!
    -> Client Reads Raw FTM Supported Resistance Level Range bytes: [6] [ 00 00 64 00 01 00 ]
    Client_FTM_SupportedPowerRange_Chr: Found!
    -> Client Reads Raw FTM Supported Power Range bytes: [6] [ 00 00 E8 03 01 00 ]
    Client_FTM_ControlPoint_Chr: Found!
    Client_FTM_Status_Chr: Found!
    Client_HeartRate_Service: Found!
    Client_HR_Measurement_Chr: Found!
    Client_HR_Location_Chr: Found!
    -> Client Reads HR Location Sensor: Loc#: 1 Chest
    Server Connection Parameters -> Interval: [48] Latency: [0] Supervision Timeout: [960]
    ESP32 Server connected to Client device with MAC Address: [9C:B6:D0:9A:8B:E8] Conn Handle: [1]
    Central (MyLaptop/Zwift) has to set CP/CSC/FTMS CCCD Notify/Indicate (enable) and start....
    MTU updated: 255 for connection ID: 1
    All Client (Trainer) Characteristics are Notify/Indicate Enabled!
    Central Updated CCCD --> Notify Enabled for Char: [0x2a63]
    Central Updated CCCD --> Notify Enabled for Char: [0x2a5b]
    Central Updated CCCD --> Notify Enabled for Char: [0x2ada]
    Central Updated CCCD --> Notify Enabled for Char: [0x2ad2]
    Central Updated CCCD --> Indicate Enabled for Char: [0x2ad9]
    Central Updated CCCD --> Notify Enabled for Char: [0x2a37]
    --> Raw FTM Control Point Data [len: 1] [OpCode: 00] [Values: 00 ]
    Request Control of Machine!
    -> Server Rec'd Raw Control Point Data --> SKIPPED: Out of Synch!
    -> Client Rec'd Raw FTM Control Point Response Data: [0] [3] [ 80 00 01 ]

Thanks for the ongoing support!

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Hi David,
The above output is showing the ESP32 is in control and functioning flawlessly, no (fatal) errors, just one out of synch situation, handled correctly... and afterwards the response.. The ESP32 asks the trainer for control, that is part of the regular procedure after connection and exchange of BLE settings...
No further printed debug output afterwards...??? so no clue if something went wrong later on....
One of the Simcline community (that I know) is using that Whoosh app on a non regular basis, never reported a problem.... I do not know that app myself at all, never tested it.... You have to supply me with more information!

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Hi David,
Installed myWhoosh on a windows 10 laptop to have more reference and started testing with my tools....
ESP32 server tested with the relevant output as follows:
11:18:35.896 -> Central Updated CCCD --> Notify Enabled for Char: [0x2a5b]
11:18:36.130 -> Central Updated CCCD --> Notify Enabled for Char: [0x2ada]
11:18:36.351 -> Central Updated CCCD --> Notify Enabled for Char: [0x2ad2]
11:18:36.631 -> Central Updated CCCD --> Indicate Enabled for Char: [0x2ad9]
11:18:36.866 -> Central Updated CCCD --> Notify Enabled for Char: [0x2a37]
11:18:36.946 -> --> Raw FTM Control Point Data [len: 1] [OpCode: 00] [Values: 00 ]
11:18:36.992 -> Request Control of Machine!
11:18:37.072 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 00 00 00 00 00 ]
11:18:37.117 -> Set Indoor Bike Simulation Parameters!
11:18:37.117 -> Wind speed (1000): 0.00 | Grade (100): 0.00 | Crr (10000): 0.00 | Cw (100): 0.00
11:18:37.246 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 14 00 28 33 00 ]
11:18:37.287 -> Set Indoor Bike Simulation Parameters!
11:18:37.287 -> Wind speed (1000): 0.00 | Grade (100): 0.20 | Crr (10000): 0.00 | Cw (100): 0.51

short pause selecting a ride...

11:19:20.206 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 E7 FF 35 33 00 ]
11:19:20.244 -> Set Indoor Bike Simulation Parameters!
11:19:20.244 -> Wind speed (1000): 0.00 | Grade (100): -0.25 | Crr (10000): 0.01 | Cw (100): 0.51

etcetera

11:20:02.944 -> Set Indoor Bike Simulation Parameters!
11:20:02.944 -> Wind speed (1000): 0.00 | Grade (100): 0.20 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:03.926 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 14 00 35 33 00 ]
11:20:03.926 -> Set Indoor Bike Simulation Parameters!
11:20:03.926 -> Wind speed (1000): 0.00 | Grade (100): 0.20 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:04.911 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 14 00 35 33 00 ]
11:20:04.955 -> Set Indoor Bike Simulation Parameters!
11:20:04.955 -> Wind speed (1000): 0.00 | Grade (100): 0.20 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:05.877 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 14 00 35 33 00 ]
11:20:05.877 -> Set Indoor Bike Simulation Parameters!
11:20:05.877 -> Wind speed (1000): 0.00 | Grade (100): 0.20 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:06.896 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 14 00 35 33 00 ]
11:20:06.896 -> Set Indoor Bike Simulation Parameters!
11:20:06.896 -> Wind speed (1000): 0.00 | Grade (100): 0.20 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:07.924 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 14 00 35 33 00 ]
11:20:07.924 -> Set Indoor Bike Simulation Parameters!
11:20:07.924 -> Wind speed (1000): 0.00 | Grade (100): 0.20 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:08.937 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 E7 FF 35 33 00 ]
11:20:08.937 -> Set Indoor Bike Simulation Parameters!
11:20:08.937 -> Wind speed (1000): 0.00 | Grade (100): -0.25 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:09.922 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 DE FF 35 33 00 ]
11:20:09.922 -> Set Indoor Bike Simulation Parameters!
11:20:09.922 -> Wind speed (1000): 0.00 | Grade (100): -0.34 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:10.911 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 CE FF 35 33 00 ]
11:20:10.953 -> Set Indoor Bike Simulation Parameters!
11:20:10.953 -> Wind speed (1000): 0.00 | Grade (100): -0.50 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:11.876 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 BF FF 35 33 00 ]
11:20:11.876 -> Set Indoor Bike Simulation Parameters!
11:20:11.876 -> Wind speed (1000): 0.00 | Grade (100): -0.65 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:12.935 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 A0 FF 35 33 00 ]
11:20:12.935 -> Set Indoor Bike Simulation Parameters!
11:20:12.935 -> Wind speed (1000): 0.00 | Grade (100): -0.96 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:13.905 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 9B FF 35 33 00 ]
11:20:13.949 -> Set Indoor Bike Simulation Parameters!
11:20:13.949 -> Wind speed (1000): 0.00 | Grade (100): -1.01 | Crr (10000): 0.01 | Cw (100): 0.51
11:20:15.902 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 A8 FF 35 33 00 ]
11:20:15.902 -> Set Indoor Bike Simulation Parameters!
11:20:15.902 -> Wind speed (1000): 0.00 | Grade (100): -0.88 | Crr (10000): 0.01 | Cw (100): 0.51
11:21:08.391 -> Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2a63]
11:21:08.425 -> Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2a5b]
11:21:08.425 -> Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2ada]
11:21:08.425 -> Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2ad2]
11:21:08.425 -> Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2ad9]
11:21:08.425 -> Central Updated CCCD --> Notify/Indicate Disabled for Char: [0x2a37]
11:21:08.425 -> ESP32 Server disconnected from Client device with MAC Address: [80:86:F2:7E:B2:87] Handle: [0]
11:21:08.467 -> --> Server is advertising again!

Notice how myWhoosh sets the Bike Simulation Parameters that result in resistance when moving the pedals...
This is what one expects..... not a trace of problems.... however....

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Continued..

Tested myWhoosh with the ESP32 Bridge tool:
skipped the opening

09:20:40.001 -> Central Updated CCCD --> Notify Enabled for Char: [0x2ada]

09:20:40.048 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 28 0A AC 00 69 00 7B ]
09:20:40.048 -> Average Speed: 26 KPH Instantaneous Cadence: 86 RPM Instantaneous Power: 105 Watt Heart Rate: 123 HBM
09:20:40.270 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 28 0A AC 00 69 00 84 ]
09:20:40.270 -> Average Speed: 26 KPH Instantaneous Cadence: 86 RPM Instantaneous Power: 105 Watt Heart Rate: 132 HBM
09:20:40.313 -> Central Updated CCCD --> Notify Enabled for Char: [0x2ad2]
09:20:40.535 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 28 0A AC 00 69 00 85 ]
09:20:40.535 -> Average Speed: 26 KPH Instantaneous Cadence: 86 RPM Instantaneous Power: 105 Watt Heart Rate: 133 HBM

09:20:40.535 -> Central Updated CCCD --> Indicate Enabled for Char: [0x2ad9]

09:20:40.797 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 8C 0A AE 00 6E 00 79 ]
09:20:40.797 -> Average Speed: 27 KPH Instantaneous Cadence: 87 RPM Instantaneous Power: 110 Watt Heart Rate: 121 HBM

09:20:40.797 -> Central Updated CCCD --> Notify Enabled for Char: [0x2a37]

09:20:40.937 -> --> Raw FTM Control Point Data [len: 1] [OpCode: 00] [Values: 00 ]
09:20:40.937 -> Request Control of Machine!
09:20:41.018 -> -> Client Rec'd Raw FTM Control Point Response Data: [0] [3] [ 80 00 01 ]

09:20:41.018 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 8C 0A AE 00 6E 00 75 ]
09:20:41.063 -> Average Speed: 27 KPH Instantaneous Cadence: 87 RPM Instantaneous Power: 110 Watt Heart Rate: 117 HBM

09:20:41.063 -> --> Raw FTM Control Point Data [len: 7] [OpCode: 11] [Values: 00 00 00 00 00 00 00 ]
09:20:41.063 -> Set Indoor Bike Simulation Parameters!
09:20:41.063 -> Wind speed (1000): 0.00 | Grade (100): 0.00 | Crr (10000): 0.00 | Cw (100): 0.00
09:20:41.107 -> -> Client Rec'd Raw FTM Control Point Response Data: [0] [3] [ 80 11 01 ]

09:20:41.222 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 8C 0A AE 00 6E 00 6C ]
09:20:41.222 -> Average Speed: 27 KPH Instantaneous Cadence: 87 RPM Instantaneous Power: 110 Watt Heart Rate: 108 HBM
09:20:41.500 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 8C 0A AE 00 6E 00 76 ]
09:20:41.500 -> Average Speed: 27 KPH Instantaneous Cadence: 87 RPM Instantaneous Power: 110 Watt Heart Rate: 118 HBM
09:20:41.721 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 F0 0A B0 00 73 00 74 ]
09:20:41.721 -> Average Speed: 28 KPH Instantaneous Cadence: 88 RPM Instantaneous Power: 115 Watt Heart Rate: 116 HBM
09:20:41.985 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 F0 0A B0 00 73 00 67 ]
09:20:41.985 -> Average Speed: 28 KPH Instantaneous Cadence: 88 RPM Instantaneous Power: 115 Watt Heart Rate: 103 HBM
09:20:42.205 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 F0 0A B0 00 73 00 74 ]
09:20:42.250 -> Average Speed: 28 KPH Instantaneous Cadence: 88 RPM Instantaneous Power: 115 Watt Heart Rate: 116 HBM
09:20:42.438 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 54 0B B2 00 78 00 71 ]
09:20:42.438 -> Average Speed: 29 KPH Instantaneous Cadence: 89 RPM Instantaneous Power: 120 Watt Heart Rate: 113 HBM
09:20:42.655 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 54 0B B2 00 78 00 7B ]
09:20:42.702 -> Average Speed: 29 KPH Instantaneous Cadence: 89 RPM Instantaneous Power: 120 Watt Heart Rate: 123 HBM
09:20:42.922 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 54 0B B2 00 78 00 75 ]
09:20:42.922 -> Average Speed: 29 KPH Instantaneous Cadence: 89 RPM Instantaneous Power: 120 Watt Heart Rate: 117 HBM
09:20:43.202 -> -> Client Rec'd Raw FTM Indoor Bike Data: [1] [9] [ 47 02 B8 0B B4 00 7D 00 6C ]

A ride was selected and the output remained essentially the same during the ride... After inspection: ONLY ONCE Bike Simulation Parameters were sent by myWhoosh to the bridge that responded correctly. With every change in road feel myWhoosh should have sent the new parameters (that determine the resistance when you pedal).... however that never happened.... Compare with the output of the Server tool. I am now looking into this behavior that is not very obvious to put it mildly.... The positive thing is: it can be reproduced!

from simcline.

davidbonenfant52 avatar davidbonenfant52 commented on May 25, 2024

Hi again Jorgen
That is interesting! Like I said previously, when I don't use the esp32 with mywhoosh everything works flawlessly with the trainer ( I feel a change in resistance as I progress through the ride). It is only when I use the esp32 that I don't feel any change in resistance. That suggests that mywhoosh is functioning properly on its own. When paired with the esp32, it seems the esp32 is either (1) not receiving the updated info or maybe it is (2) receiving info but not relaying it to the trainer? Is it possible that mywhoosh code is calling the updated parameters something other than initial parameters so the esp32 can't understand the updated info being sent? Would that throw an error code? Keep me posted on your findings!

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Good morning,
The above behavior took quite some time before I understood what is happening... Please realize that the code in different versions is running for years with minimal corrections and used weekly (in the indoor season) by tens of people on different devices and with Zwift and Rouvy. The question is in what way is myWhoosh so different from Zwift that it connects, starts the trainer and then backs off (invisibly) while you can still move the avatar in the myWhoosh virtual world as if everything is fine...?
No error messages or any clues of what goes wrong... It was really a complex puzzle. After testing for timing issues (out of sync, timeout), software handshaking between packet exchanges, (wrong) settings of FTM Status or Training Status fields, none of these turned out of being capable of reproducing the same behavior... Finally it turned out that the FTM Feature settings were the critical factor for myWhoosh to calculate (correct) resistance parameters. If these do not fulfill myWhoosh's expectations it simply stops sending resistance parameters without any detectable feedback. Notice that Zwift and Rouvy never failed due to these FTM Feature values, they just make the best of it and simulate a ride that you seriously feel when pedalling!
I have adapted the code (Bridge version) and it is working like a charm now with myWhoosh and my virtual trainer versions! Thank you for bringing this issue to my attention: it has helped to improve the code and raised its robustness. In the end everybody will benefit! I will upload Bridge version 1.5 a.s.a.p. and then you can test for yourself.
Best wishes, Jörgen.

from simcline.

davidbonenfant52 avatar davidbonenfant52 commented on May 25, 2024

It works! Good job Jorgen! Thank you so much for your help.
Best wishes, David

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Thanks! After your ambiguous experience with the Client code it was clear to me that the Volcano Circuit data were not distinctive enough. Simply not enough road gradient to experience a clear resistance during pedaling, so I have changed that to a more challenging road profile! Furthermore I have redesigned the code to make more visible what simulation parameters the trainer is offered by the Client code. In the previous version that was hidden for no reason! I would appreciate if you give the Client code another try against your Volt...
Regards, Jörgen.

from simcline.

davidbonenfant52 avatar davidbonenfant52 commented on May 25, 2024

Hi Jorgen,
I have tried the client code on mywhoosh and everything is working perfectly! I have since changed to Rouvy and all the code works properly with that platform as well.
As recommended in your instructions, now that I know that the code works well with my trainer, I have built the simcline with recycled parts! Because I have used parts lying around, there are little differences in design compared to your simcline. The main difference is that as the wheel goes up, the TOF sensor gets further away from the reflection plate. This is causing the simcline to behave opposite of what it should be. When there is an uphill (or when I press the "up" arrow on your companion app), the wheel goes down. When there is a downhill (or when I press the "down" arrow on your companion app), the wheel goes up. Can you point me in the right direction as to change the code so that it behaves as it should? Is it in the lifter library or in the main code? If its too complicated to change the code I will try to find a design workaround to make it work!
Thank you and have a great weekend
David

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Good morning David,
Nice to hear that you build your Simcline with used parts!
About your setup moving in the "wrong" direction, can't you swap/interchange the 2 wires from your DC-motor (12V actuator) that are connected to the 2 pins of the motor driving board?
Swap the wires equals swapping the polarity equals swapping the current direction equals swapping Up and Down movement...
Just interchange the 2 DC-motor wires where they are connected to 2 pins of the motor driving board.... give it a try!
It is virtually impossible to know in advance what the polarity of these DC-motor wires is, their colors are not meaningful.
Have a nice day,
Jörgen.

from simcline.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.