FabianRig / ArduinoMoonBoardLED

LED system compatible with MoonBoard based on Arduino Nano 33 BLE
GNU General Public License v3.0
70 stars 14 forks source link

Bluetooth issues #8

Closed Jstar018 closed 1 year ago

Jstar018 commented 1 year ago

Hi Fabian,

Thank you for pulling together. I am new to alot of this so apologies if this is an ignorant question. I have got the board, connected it up. compiled and uploaded the content to it but the Bluetooth is not visible on the moonboard app.

I have been playing around for a while looking at different options. When I go to 'build' there are 47 error messages mostly with the bluetooth setup (below is the output). I assume that this is what is driving it. Wondering if it is me or there were some changes in the reference libs that this uses.

Any advice and guidance on what I need to do to address is appreciated.

Cheers,

Processing nano33ble (platform: nordicnrf52; board: nano33ble; framework: arduino)

Library Manager: Installing SPI Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nano33ble.html PLATFORM: Nordic nRF52 (9.6.0) > Arduino Nano 33 BLE HARDWARE: NRF52840 64MHz, 256KB RAM, 960KB Flash DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink) PACKAGES:

FabianRig commented 1 year ago

Those are "only" warnings and in the end it says "SUCCESS". It might still work.

Could you connect the Nano to your computer and check the Nano's console logs? What does it say?

Jstar018 commented 1 year ago

Hi Fabian,

After uploading the project the nano does not connect and the com-port not recognised. I have tested some simple programs to blink and respond and I am able to upload then connect back in wiht the computer and monitor the output. However when I upload the project it disconnects - See below outputs.

It looks like something is creating an error in the code.

Any advice is appericated.

image Screenshot 2023-05-31 075250
FabianRig commented 1 year ago

Sorry for taking so long to answer. Currently, I don't have a lot of time... Sorry!

Do you have an original "Arduino Nano 33 BLE" or another brand?

Have you tried starting totally fresh? Reinstalling VS Code, Platform IO and all packages?

FabianRig commented 1 year ago

I just gave it a try in a new environment. There are indeed 45 warnings with respect to the libraries used. Warnings aren't errors however and the build is successful:

RAM: [=== ] 26.7% (used 69920 bytes from 262144 bytes) Flash: [=== ] 33.3% (used 327476 bytes from 983040 bytes) =========================== [SUCCESS] Took 38.53 seconds ===========================

The problem you're seeing might be something else. As soon as you successfully flash that file, you should see messages in the terminal.

Jstar018 commented 1 year ago

Hi Fabian,

Apologies, I have been traveling. Yes I am using an original "Arduino Nano 33 BLE"

I have reinstalled VS Code, Platform IO and the project.

Interestingly I am getting 47 error messages not the 45 you got on your build. Build size etc is exactly the same.

Still crashing and not able to monitor the COM Port or link in with Blue tooth....

FabianRig commented 1 year ago

That's weird. Let's try a systematic approach.

Jstar018 commented 1 year ago

I can flash without errors I can connect to the right com port with only the USB connection and nothing else connected to the PC I can flash another project and monitor it

I have not tried with another PC...

FabianRig commented 1 year ago

OK. That's a good start. If you can successfully flash it without errors and connect to it without any error, then it should work. (Otherwise you should see "BLE setup failed!" -- check https://github.com/FabianRig/ArduinoMoonBoardLED/blob/main/src/main.cpp line 29.)

What puzzles me is that the MoonBoard app doesn't see the device. I've used many different Android devices (mobile phones, tablets) and friends are successfully using various iPhones. The range isn't too good (less than 4 or 5 meters for me), other than that it's stable and reliable.

If you're using an Android phone: Please make sure the app has the location permission which is needed for bluetooth. Perhaps try reinstalling the app? Or could you maybe try another mobile device?

FabianRig commented 1 year ago

One more idea: If you're using an Android device, please download nRF Connect for Mobile (https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=de&gl=US) and use the scanner. You should see "MoonBoard A". This app also needs the location permission.

svigani4ok commented 1 year ago

I also had a problem with bluetooth, neither moonboard app nor nRF Connect for Mobile was discovered the device. But the issue was with nordicnrf52 v.9.6.0 platform (see issue here), so I downgraded it to 9.5.0 and it started to work.

FabianRig commented 1 year ago

Thank you for letting us know! Great find!

@Jstar018 Could you please change the line to "platform = nordicnrf52@9.5.0" in platformio.ini (https://github.com/FabianRig/ArduinoMoonBoardLED/blob/main/platformio.ini) and check if it works? If yes, we have a fix.

Jstar018 commented 1 year ago

Hi @FabianRig @sviga

I downgraded the platform and it works perfectly. I can see the output in the monitor with the correct LEDs referenced. Bluetooth connects.

Thank you!

jordigrau83 commented 1 year ago

I have used this app on many different arduino BLE 33 without any issue, but if you want you can buy a cheaper ESP32 on AliExpress, and it also works flawlessly, so if you still have problems with the Arduino try the ESP32 😉

On Sun, 18 Jun 2023, 07:24 svigani4ok, @.***> wrote:

I also had a problem with bluetooth, neither moonboard app nor nRF Connect for Mobile was discovered the device. But the issue was with nordicnrf52 v.9.6.0 platform (see issue here https://github.com/platformio/platform-nordicnrf52/issues/175), so I downgraded it to 9.5.0 and it started to work.

— Reply to this email directly, view it on GitHub https://github.com/FabianRig/ArduinoMoonBoardLED/issues/8#issuecomment-1595960880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AENEE5EDZXUKID4VI6OHFO3XL2GKPANCNFSM6AAAAAAYRSS3DI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

FabianRig commented 1 year ago

Great! Good to know that it works now. I'll include the fix asap.

And thanks for the info regarding the ESP32!