Tack till alla våra trogna sponsorer som stöttar och håller Rejsa rullande
RejsaRubberTrac
Issue initializing BLE and sensors not running continuously
145 besök totalt
rwense
United States
Här sen Mar 2024
Inlägg: 6


Trådstartare
Hi all!

First of all, I want to thank Magnus for such a well written tutorial, it has been incredibly easy to follow up to this point.

I have soldered together the controller as well as both the VL53L0XV2 and MLX90621 GY-906LLC-BAB and have confirmed that they all work via serial. However I have encountered 2 main problems.

First being that I cannot get BLE to initialize. In main.ino at line 152, the function call Bluefruit.begin(); seems to hang up and nothing else occurs afterword. Although, commenting this out allows the rest of the code to execute. As you can see in the below image, the sensors report data and the code runs fine, however the MAC address is obviously incorrect:



The other problem I've encountered is that the sensors do not poll continuously. As you can see in the above screengrab, data is collected about 25 times and then the loop ceases to run.

As for troubleshooting I will break these two problems down and discuss what I have done so far:

1.BLE refusing to initialize:

a. Moving the function call elsewhere in the code does not fix the issue
b. Adding the arguments 0, 1, or "0, 1" to fulfill the peripheral / central options also does not fix the issue
c. On line 238 of main.ino I added an else statement to the if statement checking to see if Bluefruit.connected() is successful to make sure BLE is not initializing. The else was triggered showing that BLE was indeed not initialized.
d. I ran the "controller" example under Adafruit Bluefruit nRF52 Libraries > Peripherals and encounter the same issue where the code stops at the "Bluefruit.begin()" function call.
e I will be soldering the other controller/sensors later today/tomorrow to test if it is something to do with this specific controller.

2.Sensors not polling continuously
a. No troubleshooting as of yet as I am working on problem #1 but I will update later.

Does anyone have any suggestions or solutions to this? I haven't read anything in the threads to suggest someone else has run into this problem.

Thanks!

_________________
Evan English
Citera
Magnus Thomé
Stockholm
Här sen Nov 2002
Inlägg: 41570

Forumägare
Forumägare

What is the MCU board model you are using exactly?

_________________
Magnus Thomé
Citera
rwense
United States
Här sen Mar 2024
Inlägg: 6


Trådstartare
Magnus Thomé skrev:
What is the MCU board model you are using exactly?


I am using an nRF52832 Bluefruit Feather.

_________________
Evan English
Citera
Magnus Thomé
Stockholm
Här sen Nov 2002
Inlägg: 41570

Forumägare
Forumägare

Have you tried using an older version of the board library? Im thinking maybe something has broken due to changes in a newer board library. Worth a try since its a pretty quick check.

I presume you are using the original code version and not the "develop" branch that added support for ESP32.

I did a build that compiled and worked fine maybe a year ago or so.

_________________
Magnus Thomé
Citera
rwense
United States
Här sen Mar 2024
Inlägg: 6


Trådstartare
Magnus Thomé skrev:
Have you tried using an older version of the board library? Im thinking maybe something has broken due to changes in a newer board library. Worth a try since its a pretty quick check.

I presume you are using the original code version and not the "develop" branch that added support for ESP32.

I did a build that compiled and worked fine maybe a year ago or so.


I just tried v1.2 and v1.0 of the board manager and that didnt seem to fix anything. What version was used in the original code version? Also that is correct, I am using the original version.

Thanks!

_________________
Evan English
Citera
Magnus Thomé
Stockholm
Här sen Nov 2002
Inlägg: 41570

Forumägare
Forumägare

I compiled and loaded the code "as is" from my github using "Adafruit nRF52 v1.6" (which seems to be the latest) and the distance sensor library from Polulu. BLE connected to Racechrono and all the sensor values were visible in there as they should. So all code and libraries seem to still be all okay.

Once someone downloaded some odd old version from a fork, just double checking that you got it from the correct url https://github.com/MagnusThome/RejsaRubberTrac/tree/master/main

_________________
Magnus Thomé
Citera
rwense
United States
Här sen Mar 2024
Inlägg: 6


Trådstartare
Magnus Thomé skrev:
I compiled and loaded the code "as is" from my github using "Adafruit nRF52 v1.6" (which seems to be the latest) and the distance sensor library from Polulu. BLE connected to Racechrono and all the sensor values were visible in there as they should. So all code and libraries seem to still be all okay.

Once someone downloaded some odd old version from a fork, just double checking that you got it from the correct url https://github.com/MagnusThome/RejsaRubberTrac/tree/master/main


I just redownloaded the code from that link and tried again with the most up to date versions of everything and still have the same issue unfortunately. I'll play around with it tomorrow and see if there's something I may have missed or something like that.

Thank you for the suggestions thus far!

_________________
Evan English
Citera
Magnus Thomé
Stockholm
Här sen Nov 2002
Inlägg: 41570

Forumägare
Forumägare

Try a board with nothing connected to it at all but power and use the "DUMMYDATA" option?

_________________
Magnus Thomé
Citera
rwense
United States
Här sen Mar 2024
Inlägg: 6


Trådstartare
Magnus Thomé skrev:
Try a board with nothing connected to it at all but power and use the "DUMMYDATA" option?


Ok so I tried my other board with nothing connected both with dummy data and without and was able to get the MAC address of the device as well as get it to connect to RaceChrono.

I tried doing the factory reset with the finished board and that didn't seem to do anything. I'm starting to wonder if its something with the board itself. I'll solder everything up on this bare board and try again later.

_________________
Evan English
Citera
rwense
United States
Här sen Mar 2024
Inlägg: 6


Trådstartare
Magnus Thomé skrev:
Try a board with nothing connected to it at all but power and use the "DUMMYDATA" option?


UPDATE 2:

I soldered everything up on the second board, loaded the sketch and BINGO it works! I connected to Racechrono to verify I could see the data along with in the Serial Monitor and it seems to be perfect. Maybe the other board is faulty. I contacted Adafruit to see what they say about replacing it.

Thank you so much for your support, it's genuinely appreciated

Now that I have this figured out, I have 3 or 4 more friends asking for a set haha

_________________
Evan English
Citera
Magnus Thomé
Stockholm
Här sen Nov 2002
Inlägg: 41570

Forumägare
Forumägare

thumbs up


PS:

Photos of your car with them on would be super fun to see when you are done

_________________
Magnus Thomé
Citera
RejsaRubberTrac
Issue initializing BLE and sensors not running continuously
145 besök totalt
Tack till alla våra trogna sponsorer som stöttar och håller Rejsa rullande