[SOLVED] BLE - BlueNRG-MS (SPBTLE-RF module)

Dear Blynk community,

I´m working on a project in which I´d like to explore the possibility of using a BLE module for sending commands and visualizing my virtual pins outputs.

These are the webpages of the modules I´m using:

In the tutorial linked at the end of the BLE module website, it is shown how to control the module as if it was an nrf8001 module. They themselves do it for back compatibility with their previous products; at least that´s the way I understood it. With the suggested simple UART terminal app from Nordic Semiconductor and the given arduino libraries, I was able to communicate with the device, send commands and receive sensor readouts.

Now I would like to substitute the UART app with Blynk. I know that Blynk supports the module nrf8001 and I was wondering if someone could give me some hints about how to modify the Arduino libraries given in the tutorial to make it work with Blynk. That would be absolutely wonderful.

I myself did some experiments already: out of curiosity, I tried to use Blynk directly without doing any modification to the code given in the tutorial. I manage to connect to the device thanks to BLE widget; when I press my buttons I can see on the serial terminal that something is going on.

See attached picture.
NB: “9:□” --> I´m not doing anything; “11:□”–> I´m pushing a button on the Blynk interface
: 20, 17, 9 and 11 indicates the length of the received string -

Despite the fact that I´m not using any “Blynk compatible sketch”, it seems that the 2 guys could potentially communicate. However, when I use the “Blynk sketch” for the module nrf8001, I can´t even see and connect to the BLE module.

Clearly I have to do some customization to make the tutorial sketch Blynk-compatible.

Now come my questions:

  • Does anyone have experience with this BLE module?
  • Do you think it would be possible to make it Blynk compatible?
  • Does anyone have a clue about how I could achieve my goal?

Thanks a lot for your support!

2 Likes

Honestly I haven’t really dug into your project details, but I think the jist of it is that you want to use BLE for your own data transfer purposes within Blynk…

If so, then sure, why not? Just DON’T use the BLE widget or the Blynk BLE libraries. Blynk uses BLE (and BT) as a serverless link between the App and the hardware, and thus it is “unavailable” for custom needs.

However if you use the traditional WiFi based App/Server/Hardware connection, then you should be able to also use a standard BLE/BT serial connection to other hardware/devices just as you would with any non-Blynk based Arduino project.

Dear Gunner,

Thanks a lot for your prompt reply! :slight_smile:

Unfortunately, as you said, I do want to use the BLE module as a serverless link between the App and the hardware and use my mobile phone as the internet gateway. As far as I understood, it is still not possible to work with Blynk and BT/BLE offline, right?

I guess my verbose question can be rephrased this way:
I would like to use the BlueNRG-MS BLE module (not supported by Blynk). Since it seems that it could be made compatible with the nrf8001 module (supported by Blynk), do you think it could be - at least theoretically - possible to modify the BLE libraries so that the module could work with Blynk?

I did some experiments myself without success, but I don´t want to spend too much time on it if it just not possible.

Thanks for your precious suggestions.

1 Like

Ahh, I see. OK, firstly, Blynk works either “serverless” (as far as sharing data between App and Hardware) using BT/BLE between phone/tablet and hardware device:

AppBLE/BTHardware

Or as “normal”:

Appinternet/networkServerinternet/networkHardware

But not “mixing” or using phone as a gateway (at least when using the BT/BLE link).[quote=“acca, post:3, topic:14510”]
As far as I understood, it is still not possible to work with Blynk and BT/BLE offline, right?
[/quote]

The phone still needs to be online (or at least connected via WiFi to a Local Server), but that is in order to access your account and your projects (which are actually stored on the server, not the phone)… So Yes, internet is required with Cloud Server, but you could make an “off-line” portable setup with a RPi ZeroW as both a Local Server and WiFi AP - search for that here - Setup PI ZERO W as ultra portable server and AP (tutorial) updated to 2022 :)

I am afraid that is out of my experiential range to fully answer… but the plausible answer is maybe :wink: but that might take some good programming and BT protocol knowledge.

Currently BT/BLE seems in Beta and possibly a bit on the back burner, but perhaps post a hardware support request into the Developer’s GitHub page?

Dear Gunner,

Thanks a lot for your answer! That´s exactly what I wanted to know :slight_smile:
I will post a hardware support request and see how things go.

Thanks again!

4 posts were split to a new topic: Getting TinyShield (BlueNRG-MS chipset) to work with Blynk