Closed davidbonenfant52 closed 4 months ago
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.
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?
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.
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 ]
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 ]
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!
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...
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
10) Make Serial Monitor output window visible on top of the Zwift window 11) 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?
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 ]
Thanks for the ongoing support!
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!
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....
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!
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!
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.
It works! Good job Jorgen! Thank you so much for your help. Best wishes, David
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.
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
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.
Hi berg0162, I get "Client Reads HR Location Sensor:Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled." error when I try to run the ftms_client code. I have pasted the serial monitor output below of the full cycle everytime the board reboots. I also tried the FTMS_server code and it works just fine. Let me know if you need more information to find out why it is not working with my particular set up. Thank you in advance.
-> 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 HR Location Sensor:Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump: PC : 0x4009140c PS : 0x00060c30 A0 : 0x8011ae48 A1 : 0x3ffc85d0
A2 : 0xff00ffff A3 : 0xff00fffb A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x3ffc8a06
A10 : 0x3ffc8a03 A11 : 0x3ffc87d1 A12 : 0x00000003 A13 : 0x00000001
A14 : 0x00060e20 A15 : 0x00000001 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0xff00ffff LBEG : 0x4009142d LEND : 0x4009143d LCOUNT : 0xffffffff
Backtrace: 0x40091409:0x3ffc85d0 0x4011ae45:0x3ffc85e0 0x40121e7a:0x3ffc88f0 0x40121eb6:0x3ffc8980 0x400e6e46:0x3ffc89c0 0x400d25fa:0x3ffc8a60 0x400d34fc:0x3ffc8ab0 0x400d3552:0x3ffc8ad0 0x400e7ab9:0x3ffc8b10
ELF file SHA256: 22369bb919dc67f3
Rebooting... ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_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.0 -------------------- Client Starts Scanning for Server Device with CPS, CSC and FTMS! BLE Advertised Device found: Name: , Address: 52:13:3e:f4:ba:09, manufacturer data: 4c001005231828fa3f, txPower: 7 BLE Advertised Device found: Name: , Address: 40:a0:23:a6:b2:78, manufacturer data: 4c001005171857574b, txPower: 11 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]