SparkFun Forums 

Where electronics enthusiasts find answers.

#228635
I have this issue when I use two Artemis DK boards with Mbed Studio as a developing platform that they do not connect to each other.

Here is what are included to my project:
files.PNG
mbed-os is from here https://github.com/ARMmbed/mbed-os
since if I use mbed-os-ampiq-apollo3 from here https://github.com/sparkfun/mbed-os-amb ... pollo3-dev
I get this error message:
apollo3oscordioerror.png
Utils are attached from here: https://github.com/ARMmbed/mbed-os-ble-utils

Example codes are tested from https://github.com/armmbed/mbed-os-example-ble
This example on first board BLE_GattClient_CharacteristicWrite and BLE_GattServer_CharacteristicWrite on the second.
I also tested to use these BLE_GattClient_CharacteristicUpdates with BLE_GattServer_CharacteristicUpdates but same issue happens: We found "GattServer", connecting... is the last print from original code. Others in the following image from Serial Monitor are just my debugging prints:
connecting_issue.png
This indicates that Client finds the Server board which is advertising but something prevents them to establish the connection. Server side will continue advertising like nothing happened.

I also had the issue that Artemis DK board MAC addresses were the same so I changed the other board address by adding some lines from following this https://github.com/sparkfun/mbed-os-amb ... /issues/49 but still no connection can be made.

I was able to connect both Server board and Client board separately with Android phone mobile app nRFConnect so the boards and code is able to connect to some devices but why not to each others?
You do not have the required permissions to view the files attached to this post.
#228911
@Enoma
I am also having having difficulties with BLE on Mbed for about a year now. I tend to think i was expecting too much from BLE.
Do not use Sparkfun's fork of Mbed OS, they used that for an initial commit but after that Sparkfun is not really updating that repo or actively fixing bugs. You are better off by using the official Mbed OS releases which contain some fixes since the Artemis boards have been released.

As for BLE in Mbed... it is a work in progress and to be honest i really do not understand the concept Mbed is following in this regard. By that i mean:
  • they changed to Cordio BLE stack 2-3 years ago. So basically one could program Mbed BLE in Cordio, however i did not find any documentation on that.
  • I guess Mbed is trying to come up with their "own" BLE APIs based on the Cordio stack, but they seem to prefer showing off capabilities of advanced usage of C++ language instead of coming up with a reliable BLE API everyone could use easily
  • If you carefully examine the code of all their examples and also the ble utils repo, you will discover 2-3 different BLE coding flavors to make it more confusing than it should be
  • Inside the ble utils repo you will find ble_app.h in which they show a new concept in case BLE is not the main and only feature of your application (which is the case about 100% in real life), however no advancement ever since that
  • With ArduinoBLE i could cover my basic needs in just 2-3 days, the same took several weeks with Mbed BLE API
  • In the last 6 month i learned to implement custom BLE services with Mbed BLE, also made a UART-like service to stream data via BLE...however throughput is way behind any expectation: have a really hard time to stream 8-bit data at 512Hz (~4 kbit/s) into my phone despite 0.27 Mbit/s should be feasible even with basic MTU based on my readings.
  • While things seem to work with nRF connect App while testing, odds are about 0% anyone would use that for data exchange...
  • I made my mobile app with AppInventor, but for some reason my Artemis board programmed with Mbed BLE APIs has a hard time connecting to the phone. In about 50% of the cases it connects as expected, but then in 50% of cases it seems to hang up somewhere in the middle of trying to connect and when i start scanning again for BLE devices it succeeds to establish the connection in the middle of the scanning phase even before i would select any BLE device from the list of found devices. So for me it seems that Mbed BLE (or just the Artemis board??) does not communicate it's state in a reliable fashion to other devices. The root of this is beyond my capabilities. It might be my phone, Mbed BLE, some weird and hardly documented limitation of Android, or who knows what.
In general BLE might be a good idea if you are about to turn the lights on in a room, but you will have a really hard time in case of data streaming and with Mbed you will hit throughput limits way before those are expected.

I am really torn by my own findings and by what i read from other users as with bluetooth classic i can stream data with 2 Mbit/s in a reliable fashion using https://github.com/bluekitchen/btstack. I tend to think BLE just s***s with Mbed BLE API and this seems to be specially true on Android HW.
#228915
@Emona, @TS-Russel
Just visited the support site of Ambiq. They recently released patch2 for Artemis SDK 2.5.1. LINK
Here they tell the patch fixes a bunch of BLE related issues, i guess this patch might fix the connection issues described by Emona and me.

If so this patch should be incorporated in the Arduino core and also ported to the upcoming official Mbed OS release on github.
#228921
Thanks @idea--list for the information.
Its nice to hear that the SparkFun fork of the Mbed OS is not usefull. It seemed abit shady from the beginning.
I have the exact same problem as Enoma. I was in that belive MBED would be a fast and good platform for software development but so far i am just very dissapointed by the lack of information about how to use or develop anything using these libraries. Also the fact that example programs don't work is bad.

Hopefully there is someone who knows better and can share more info on the topic.
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum