Code Monkey home page Code Monkey logo

Comments (28)

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

solved

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear CherryPhilip,
At Lifter.init in the Simcline code the Lifter library is initializing the Time-of-Flight-Distance sensor VL6180X and programming its registers for appropriate operation. Further the code will test the correct collaboration of this sensor and the linear actuator to avoid damage when malfunctioning! I suppose there is no sensor and actuator in your present setup. The Simcline code will only execute without failure or fatal errors when the basic electronic components of the Simcline are present and connected. It was simply not designed to operate in an other situation.
Kind regards, Jörgen van den Berg.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear CherryPhilip,

I connected also oled led (1.3"), but not info is visible on the screen. i see only parallel rows and on top edge of screen a possible few informations. Is it depend maybe always from my partial configuration?

Why are you not applying the included Arduino programs for testing the different electronic components?
Like: Test_I2C_scanner or Test_OLED_SSD1306
This is very basic Adafruit sample code that you can adjust to detect possible problems with the components and/or included component libraries.

Still notice that: the Simcline_V03 code will only execute without failure or fatal errors when ALL the basic electronic components of the Simcline are connected and working correctly together.
Kind regards, Jörgen van den Berg.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear CherryPhilip,
I have included a Test program (Test_FEC_over_BLE.ino) that will probably help you to test for BLE connection to your trainer. If the code connects succesfully to the trainer you will see road grade info and cycling variables like Power, RPM and KPH, when you are using it during a workout session. Norice that a 1306 Oled display is needed to make the data visible. However, you can use the Serial Monitor to see the same information produced on your PC as well as debugging data....
Hope this is helpfull,
Jörgen.
Test_FE-C_over_BLE.zip

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,
I have just uploaded the latest version of "Test_FE-C_over_BLE.ino" to the SIMCLINE/Arduino repository. Small changes since you received it from me before. You should run it to be sure that your Feather nRF52 will connect to the trainer and receive meaningfull data about road grade and cycling variables. Read carefully the comment section at the beginning of the code, it might apply to your setup!
Running it will show at least relevant info in the Serial Monitor of your Arduino IDE about how well the connection is established (or not).
Beste wishes,
Jörgen.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

Dear Jörgen!
here below the output from serial monitor:

Serial Feedback over COM3 Initialized!
SSD1306 is running...
Bluefruit52 Central

Scanning for TACX ...
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...

Disconnected, reason = 0x16
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...
...
Disconnected, reason = 0x16
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...

Disconnected, reason = 0x3E
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...

Disconnected, reason = 0x22
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...

Disconnected, reason = 0x16
Connected! Now checking for critical services...
Discovering FECPS Service ...
...
Disconnected, reason = 0x16
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...

Disconnected, reason = 0x22
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...

Disconnected, reason = 0x16
Connected! Now checking for critical services...
Discovering FECPS Service ...
Failed and disconnecting ...

Not paired between TACX smart with nRF52.
Other the serial output, here below some screenshot acquired from nRF52 Connect APP, just to understand if it's needed to modify or adjust the UUID code:

WhatsApp Image 2021-11-05 at 8 50 26 AM (1)
WhatsApp Image 2021-11-05 at 8 50 26 AM
WhatsApp Image 2021-11-05 at 8 50 27 AM (1)
WhatsApp Image 2021-11-05 at 8 50 27 AM
WhatsApp Image 2021-11-05 at 9 03 02 AM (2)
WhatsApp Image 2021-11-05 at 9 03 02 AM (1)
WhatsApp Image 2021-11-05 at 9 03 02 AM

I hope that you help me to solution,

Best Regards
Filippo

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,
The Serial Monitor output shows:

  1. Your Genius firmware version has BLE support with the regular GAP services for cycling speed, cadence and power;
  2. that the TACX_FEC_PRIMARY_SERVICE UUID 6E 40 FE C1 - B5 A3 - F3 93 - E0 A9 - E5 0E 24 DC CA 9E is NOT exposed by the firmware version of your Genius trainer. In none of the other screen dumps (of your BLE sniffer), that you sent, can I detect this TACX_FEC_PRIMARY_SERVICE UUID.....
    Conclusion your TACX Genius firmware version does NOT support the FEC protocol over BLE as described in the TACX documentation (https://github.com/Berg0162/simcline/blob/master/docs/How_to_FE_C_over_BLE_v1_0_0.pdf). The document is published in 2015, however, I do not know from what date on TACX started to include this FEC-support in smart trainers and which types of trainers were actually supported. I own a very first generation TACX Neo (2016/2017) and that has FEC-support, although it only allows one single BLE connection despite the latest firmware update.....
    Kind regards,
    Jörgen.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

Dear Jörgen,

if I understand well so SimCline is not able to create a valid connection with my TACX Genius due to FEC protocol not used from my trainer.
Now I'm happy less and have no skills to move forward with the project and I will put the hardware inside a box-
I think that is important to highlight that SimCline is not compatible with all TACX smart trainers without FE-C or with those that have not the UUID appropriate code

Thanks a lot for your support.

Best Regards
cherryphilip

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

New update
I changed the primary, rx and tx code with these:

image

the outputs data from serial monitor is this

image

Any suggestions

Best Regards
cherryphilip

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

New Update
image

image

Not shown measurement data (Grade, Power, Cadence and Speed) on Oled screen

best regards
cherryphilip

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

I put the same UUID code found by APP nRF52 in simcline .ino.

image

It seems that simcline connects to the trainer but I am unable to go forward, here short video

WhatsApp.Video.2021-11-05.at.22.22.47.mp4

Best Regards
cherryphilip

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,
I feel bad for you! I do not see an essentially better result, surely a different result since you have replaced the TACX-documented Primary-FEC-service-UUID for a service UUID that is characteristic for cycling variables, like power, cadence, speed.... So it will connect to and use these services and characteristics.
As a consequence the Feather (still) has NOT been connected to the "FEC over BLE service" and the request for "data page 51" is logically not recognized nor responded by the trainer, resulting in a "data page 71 received" message at the Feather side! This is a very typical and critical part of the FEC-service protocol; it gives us access, among others, to the road grade the trainer is working with.....
The Simcline program has essentially the same code parts (and more or less program flow) as the test FE-C program and is showing the same errors: in addition a "Not Functioning" message (Actuator plus Time-Of-Flight sensor are not working together) then it shows "connected", NOT to FE-C service but to the service UUID that you replaced it with, then the firmware revision number is shown on the Oled display, the very same the Serial Monitor is showing when the test program is run....
I am sorry for you but this brings us to the earlier conclusion, the firmware of your Genius trainer has NO support for the TACX documented Primary-FEC-service, although it is labelled "Smart Trainer" by TACX. TACX smart trainers are not equally smart apparently, some are smarter than others. Check with TACX, TACX forum, or the reseller what the latest firmware version is and/or if your Genius should have support for the TACX-documented Primary-FEC-Over-BLE-service. By the way how old is your Genius? I had one (not "smart", only ANT+) for many years before I moved to the Neo in January 2017.
Best wishes,
Jörgen.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

New Update (It works)!!!!
Hi Jörgen,
finally my trainers works with simcline.
Here the procedure followed:

  • 3.1.22 firmware updated by Tacx Utility
  • nRF52 just to verify is trainer receiving the correct UUID frames (C1,C2,C3)
  • Run Test_FE-C_over_BLE ino
    image
    Serial monitor outputs
    image
    OLED outputs
    photo_2021-11-06_18-22-41
    then i uploaded the simcline .ino, here oled informations:

photo_2021-11-06_18-31-19

photo_2021-11-06_18-31-25
At the moment I've difficult to pair tablet and feather with both APK files versions
photo_2021-11-06_18-31-34
Status: no change always "connecting to device"

Any suggestions

Best Regards

Filippo

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,
Great! Hope you appreciate the learning moment: smart users work only with latest versions to stay out of unnecessary problems! I am curious: How old is your Genius? Was this the very first update after you bought it?

Now about connecting to an Android device:

  1. Older Android devices do NOT support Bluetooth-LE, which is critically different from previous Bluetooth without Low Energy! Modern smartphones all support BLE. Check!
  2. Do you have the latest version of Android OS installed? Check!
  3. Did you grant the App access on the tablet? Check! When I install the App on my Samsung it is asking to grant certain privileges on the Android device.... Grant access!
    Try installing the App, as an alternative, on a modern Android smartphone.....
    Regards,
    Jörgen.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

Dear Jörgen,
I took it second hand and I think it was around 5 years with not recent firmware version (3.1.6).

I had doubts when i saw the uuid code from another trainer (vortex) of my friend, in fact it works with 3.1.22 fw version and FE-C protocol section.
So, basing on your answer i searched if was possible to upgrade my trainer with 3.1.22 latest firmware.
In google play i found Tacx utility and when connected my trainer with the smartphone a new firmware (3.1.22) was available.
After updted i saw the UUID code of FE-C protocol.

Regarding to your questions:

  1. I have a Samsung A50 (i can pair smartphone with feather witout issue and on oled screen i can see the notice "paired with ..." same for my Tablet A8
  2. Smartphone with Android 11, Tablet with Android 12
  3. App istalled succeful

At the moment i cannot paired with any devices, i see only the status: CONNECTING TO DEVICE

Other point, simcline report same information of BKOOL, but when slope change the grade change but the actuar linear motor not move.
Does it depend on the non-pairing from the tablet with the Feather?

Regards
Filippo

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,
Check the Github repository for a new Arduino Test program for Android Smartphone <-> Feather connection over BLE.
That will connect your Android device and the Feather, hopefully.

NOTICE that the SIMCLINE code will only work when all the components are working together in a correct way.... It takes more than connecting them over a wire.....

Question: Does the Time-of-Flight-Sensor and the linear Actuator have a working relationship in your setup? In other words does the Time-of-Flight-Sensor detect the movement/position of the linear Actuator? Or are they just connected over I2C with the Feather.
The SIMCLINE code expects the Time-of-Flight-Sensor to give feedback about movement/position. Study carefully the mechanical construction/design to understand how the Time-of-Flight-Sensor is doing its measurements of the movement of the linear actuator and how that relates to the position of the front wheel!
Best wishes,
Jörgen.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

Dear Jörgen!

here below the serial monitor output from new .ino file (Smartpfone paired with Feather) :

photo5784874945879324614

Seems that smartphone and feather are paired, but the companion app not show the connection due to partial setup, I think, (at the moment i don't have connected the MDD3A board and actual linear motor).

I can see the I/O activity for MDD3A because i put a led for each A0 and A1 pin. Led switch on and switch off according to the VL6180 sensor (test_Standalone_Function_And_Library and Test_VL6180_RangeSingleShot).

MDD3A board will be delivered today, I hope to complete all connections within tomorrow.

Regards
Filippo

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,

Seems that smartphone and feather are paired, but the companion app not show the connection due to partial setup, I think, (at the moment i don't have connected the MDD3A board and actual linear motor).

Sorry, you misunderstand completely! The Arduino Test program for Android Smartphone <-> Feather connection over BLE has NOTHING to do with any of the other electronic components. It even does NOT use the Oled SSD1306 ! All output is shown on Serial Monitor! No connected electronic components are used!

It is fully stand-alone and it is just establishing and testing what it says to test: Phone-Feather connection using BLE.
The Serial Monitor output is telling us that the connection is successfully established and that the Feather is sending cycling data to the App! Later the connection has disconnected... You closing down the Companion App?
Have you actually explored the SIMCLINE Companion App? Or did you exclusively look at the Pairing Devices screen all the time? Is the message shown (at Status: ) that it has connected to the Bluefruit-nRF52? Did you switch ON the Auto Connect switch, for easy auto connection next time you use the App? Having this switch ON exempts you from MANUALLY selecting the device (Bluefruit-nRF52) in the list of active BLE devices, you want to connect to......

Did you actually select the Monitor Operation in the menu and/or one of the other items (Pair Devices, Settings, Manual Control etcetera) that are offered when touching the Menu icon (left top bar) or by swiping left to right on the Phone's Screen, when the Companion App is active? When the Monitor Operation item is selected you will see how the cycling data are changing during run time of the test program... that will prove a working connection from Feather to Phone.
When you select the Manual Control item in the menu and tap the UP or Down icon, the Serial Monitor will show it received a UP or DOWN command... that will prove a working connection from Phone to Feather.
Best wishes,
Jörgen.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

I'm sorry maybe I could not explain well.
I reported 2 different scenario.
Scenario 1:
The Arduino Test program for Android Smartphone <-> Feather connection over BLE
Status from serial monitor shown the stable connection between smartphone and feather.
As further information I tried to open the Companion App after paired with smartphone, but on status is always :
connecting to device (no name device, no SSRI visible). I can see only the list of near BLE Devices, I also explored
manual control page and so on, but nothing.

Scenario 2:
I answered the second question
<Question: Does the Time-of-Flight-Sensor and the linear Actuator have a working relationship in your setup? In other words does the Time-of-Flight-Sensor detect the movement/position of the linear Actuator? Or are they just connected over I2C with the Feather>
My setup including:

Feather - Oled - VL680
Just to emulate the outputs from Feather to MDD3A board, I used 2 Led's, one for each I/O (A0,A1)
As describe on previous post, when I load the Test_Standalone_Function_And_Library or Test_VL6180_RangeSingleShot, I can see the Led (up or down) switch on and switch off according to the VL6180 sensor,
while from OLED SSD1306 show the distance read from sensor to target.

Just to summary:

  1. Test program for Android Smartphone <-> Feather connection over BLE --> OK, smartphone paired
  2. Companion App --> not able to connect with smartphone. Status: connection to device;
  3. Test_SSD1306_RangeContinuous--> Ok, I can see from serial monitor all distances read from sensor to target;
  4. Test_VL6180_RangeSingleShot --> Ok, I can see from serial monitor all distances read from sensor to target;
  5. Test_Standalone_Function_And_Library --> OK, Led switch off when target is reached.
    I see on OLED SS13 after booting these messages:
    TESTING --> Function --> ERROR * Is it depend of partial configuration?
    and then start with randoms measurements;
    Test_FE-C_over_BLE --> OK, Feather paired with Trainer
    Simcline_v03 -->
    After booting:
    Feather paired with trainer
    Feather not paired with companion app
    TESTING --> Function --> ERROR * Is it depend of partial configuration?
    OLED SSD1306 shown WATT, RPM, KPH and % according to BKOOL or ROUVY App.
    led's still are switch off also slope is changed (remember you that i use 2 leds connected on A0 and A1 pins for emulate MDD3A)* Is it depend of partial configuration?

I received now the MDD3A module, I want to assemble all components, restore the smartphone and try again.
I think that I missing some step or there are some issue on my tablet / smartphone

Best Regards
Filippo

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,

Problem to solve:

The Arduino Test program for Android Smartphone <-> Feather connection over BLE. Status from serial monitor shown the stable connection between smartphone and feather. As further information I tried to open the Companion App after paired with smartphone, but on status is always : connecting to device (no name device, no SSRI visible). I can see only the list of near BLE Devices, I also explored manual control page and so on, but nothing.

--> The smartphone is not establishing a successful connection with the Feather; It looks like the App is scanning correctly and listing nearby BLE devices. The Feather is one of them but when connecting with it, the App is "hanging", can't finish the connection process! The Feather thinks, however, it has a working connection (was notified positively and it has got the name of the Smartphone right, as shown on the output!), consequently it sends cycling data that are NOT processed in the APP and therefore not shown.
However when the App is disconnecting this is notified and shown at Feather-side in Serial Monitor.
BLE connection is only partly not working well.... Unfortunately this can have many dark causes....

To rule out that it is a version, type or smartphone-specific problem: install the APK's of the App on different Android devices. The more the better!
--> One at a time, activate the App, run the test program and remove the App; repeat with the other one; carefully check if you see a different behaviour/result between App versions and Android devices.

Notice that the latest APK-version is updated with the latest BLE library version, it does not get much better.... :-(
On my Galaxy A5 (2017), Android version 8.0.0, it is working flawlessly (both APK versions!) .
I will search for comparable BLE problems with MIT App Inventor on Android devices .....
Kind regards,
Jörgen.

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

I came across the following:
Ensure you have Location switched on before any BLE functions are called. Note that BLE requires 'fine' location, which seems to be the default in Android 11 but if your phone offers a choice, 'fine' is the one to choose.

Please check that setting to be sure, before you start the App!

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Reply Continued....

Dear Filippo, (= FilippoC12 ?)

Test_Standalone_Function_And_Library --> OK, Led switch off when target is reached.
I see on OLED SS13 after booting these messages:
TESTING --> Function --> ERROR * Is it depend of partial configuration? YES, lack of mechanical construction!
and then start with randoms measurements;

In your setup the Time-of-Flight sensor and actuator are not physically connected! In other words the sensor does not detect the movements of the actuator, i.e. no laser beam reflection from the actuator carriage back to the sensor for determination of the path the carriage is following! The Test_Standalone_Function_And_Library and SIMCLINE code as well expect the Time-of-Flight-Sensor to give feedback about movement/position of the carriage. Study carefully the mechanical construction/design to understand how the Time-of-Flight-Sensor is doing its measurements of the movement of the linear actuator and how that relates to the position of the front wheel! Notice that in the SIMCLINE mechanical design an Alu reflection sheet is part of the carriage and needs accurate installment to allow for the reflection of the (invisible) laser beam of the Time-of-Flight-Sensor!

Simcline_v03 -->
After booting:
Feather paired with trainer
Feather not paired with companion app
TESTING --> Function --> ERROR * Is it depend of partial configuration? YES, the very same cause as above!

The Simcline code and the Test_Standalone_Function_And_Library code as well do (after start up) testing of the collaboration of the Time-of-Flight sensor and the Actuator. It has the actuator step up and step down some seconds while checking the readings of the sensor... this is to avoid serious damage when the two are not working properly together... If the test fails further operation is stopped in the Simcline code! Otherwise the front wheel is positioned in neutral position and pairing with devices is started!
When you add the MDD3A module: that is a necessary step in the building process but it is very clear that you will still see fundamentally the same results from above (when running the codes) with your setup....
Regards,
Jörgen.

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

Hi Jörgen!
thanks for your suggestions.
Unfortunately yesterday i cannot tested, but I hope to do something tomorrow.

I have an idea about of the linear actuator construction and how to allocate the sensor and of course i will use an aluminum tape as target for flight sensor.

My focus now is to verify follow items:

  • Pairing from Feather to Smartphone
  • TESTING --> Function --> ERROR. In this case i putted on front of flight sensor a static obstacle / target (box paper), I see one of them led switch on for few seconds (I don't know if is UP or DOWN depend on random value provide from SimCLINE) and then the pairing with trainer.

When these item are ok, i can spent more time for final construction.

Update will follow soon

Thanks again for kind support

Regards
Filippo (no FilippoC12 but cherryphilip74)

from simcline.

cherryphilip74 avatar cherryphilip74 commented on May 25, 2024

Dear Jörgen!
I tried my wife's tablet and finally smartphone and Feather paired.
From tablet i can see that:
Status: connected
Device Name: Bluefruit-nRF52
Device RSSI: -54
Also OLED SDD1006 now I can see the bluetooth icon on top right corner.

Now i can dedicate for movement construction, I bought a actuator linear 250mm, could you explain me as you found / calculated the follow parameters:

MEASUREOFFSET 100 (Is this dead point of sensor? 10mm)
#define RGVMIN 19000 (How did you determine this value?)
#define RGVMAX 22000 (How did you determine this value?)
#aRGVmin = 19500 (How did you determine this value?)
#aRGVmax = 21500 (How did you determine this value?)
#MINPOSITION 265 (max distance btw vl6180 and alu plate protected by microswitch)
#MAXPOSITION 535 (min distance btw vl6180 and alu plate protected by microswitch)
aRGVmax = map(iMax, 0, 20, 20000, 22000); 0 and 20 what are these? 20000 = 0%, 22000 =20%
aRGVmin = map(iMin, 10, 0, 19000, 20000); 10 and 0 what are these? 19000 = -10%, 20000 =0%
All values are in mm?

Here is a draft of how I want to use linear actuator:

image

Thanks in advance for your answers

Best Regards
Filippo

from simcline.

Berg0162 avatar Berg0162 commented on May 25, 2024

Dear Filippo,
First things first: What is the Android version and the type of the tablet you applied and successfully paired with? After all that was the problem we were addressing on your behalf!
Kind regards,
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.