Error receiving BLE data from Arduino

Hello all,

I am a student finishing my degree, attempting to finish my last project which is designing a wireless motion sensing device that works with an android application. I am using Nicla Sense ME board that connects via BLE to my Galaxy s6 host device Bluetooth version 7.0 Android 7.0 for phone, Bluetooth info for Arduino attatched via picture below. My application starts up, connects to my Arduino (Arduino LED red IF not connected and App label change to "Connected" indicate a connection), but then never receives the data that my Arduino is sending.

BLE extension -- MIT: BLE Extension version 20201223 Released: 23-12-2020 Package Name: BLE-device-sort.aix

I have tested my Arduino sketch/board using serial monitor and LightBlue BLE Development application. I am receiving BLE data on LightBlue and Serial monitor prints various strings throughout entire program so It seems to be doing its part. I attatched my code.

I am not worried about getting everything to work right now, I know there is work I have to do still. I want to get to where the "set Label 1 ( OR 4 ) test to "data found" shows up on my application, then I can work through making sure the comparison operations and other things are working.
I am currently attempting to send data as strings and shorts, I have tried other data types with no change in problem. Any advice would be greatly appreciated

ProjectCode.ino (6.2 KB)
!!




image

[deleted]

I'm not sure what you meant by your response, Maybe that was supposed to be typed somewhere else and that's why you editted it..

It was a Power User - to - Power User message which is usually unseen.

Hello to all who have read this,

I have solved my own problem by modifying just about everything, on Arduino side and MIT.app inventor side.

This post can be removed/locked if necessary

Gotcha Chris, thanks for the info. It was visible in my email!

On the contrary, please share your solution for the benefit of other BLE Users.

ProjectCode-2.ino (7.0 KB)

1 observed problem --- The Nicla is somewhat limited on its ability, I'm not technical enough to fully understand, but If I had 5 characteristics with "read and notify" BLE capability it was shutting down my Arduino and causing it to lock up. Turns out it worked much better with 1 advertised BLE characteristic.
I could have all 5 characteristics but they all couldn't have notify, which was limiting the functionality.

2nd observed problem -- App inventor software didn't like all those data items coming in at the same time, With all 5 characteristics on Arduino sketch, if I removed all but 1 register I was starting to receive some data.

3rd observed problem -- Shouldn't use the short version of the Uuid, it should be the full version so it doesn't get confused, the app didn't do well processing the characteristics with the limited Uuid.

** Disregard per ChrisWard ** 4th observed problem - - I'm not completely sure about this one, but I think that the BLE registers should be part of a reoccurring loop, like a clock, not part of a 1 time event, like "If Bluetooth connected"

There may very well have been other issues, I did upload what I have now which is mostly functioning but my Arduino sketch needs a lot more work for the actual purpose of properly analyzing the throwing motion. The data is transferring from Arduino to app now without issues.

I shared what I can/remember off the top of my head, Thanks for the support.

2 Likes

They should not be in a loop :thinking:

You will possibly hit a permissions issue in the new App Inventor nb190 released yesterday. Solution:

Snap3

Edit: A sample BLE project to use or abuse:
BLE_RECEIVE_3_INTEGERS.aia (192.4 KB)

Okay, I edited my post to make sure no one takes my poor advice. I will implement the addition you mentioned.

Thanks again,
Josh

1 Like