Go Down

Topic: Connect Nano 33 BLE to Android app (Read 1 time) previous topic - next topic

mnomn

Hi!

I have modified and uploaded some sketches from "ArduinoBLE" examples to my nano 33 ble board. I can control the app from "low level apps" like nRF Connect and LightBlue. But I want to control i my nano board from an android app with a Game pad or Remote control UI. I have currently  used a Custom BLE service name, is the the problem? Do I need to implement a standard service/characteristics. If so, which?

If I implement some predefined characteristic like "Human interface device 0x1812", do I also need to implement specific services?

The problem I am trying to solve is to use arduino nano 33 ble as a bluetooth remote control for a toy-car.

I will not build my own android app. Best would be to customize my arduino code to for with some existing app. Or in worst case create a web app that talks to arduinoBLE, which I have seen examples of.

Thanks, Ola

matt_lee_smith

Hello Ola,

I did a little digging and looked at the apps that are available on the google play store. I think the first problem you are really going to have is with the way the apps are designed vs the way the Nano 33s' BLE is designed.

So the apps are more or less designed with the Bluetooth modules you can buy such as the HC-05,06,10 etc. As such they are effectively connecting and just sending data across, sometimes in the form of characters, that the other module will just pick up/hear and use. If you have found an app that doesn't do this then please let me know.

The BLE in the Nano 33s doesn't work like that, it uses that central/peripheral style of connection, its that "bulletin board" bit they are talking about in the BLE library. This means the central device more or less knows what kind of characteristics it is looking for and listens to them instead of a general flow of data.

Furthermore, the current apps I tried are looking to connect to the device you are driving and as such are acting as masters/centrals whereas in this case, you would probably want the joystick to act as a peripheral because you are "advertising" the joystick data to the board.

If you look at the BLE example "SensorTag Button", which can detect a left or right button press, the board is connecting as a central device and listening to a specific characteristic from the tag.

This would probably mean that you need to look at either building a joystick with an integrated nano 33, which would give you the most amount of control or build an app that works with this form of Bluetooth. If you want you can use the nRF Connect app to create an advertised service to play around with sending data that imitates a joystick.

Alternately, you can use a different Arduino board with an external Bluetooth module, there are a lot of tutorials online on how you can do this.

Hope this helps,
Matt

mnomn

Thanks for the info. Very helpful. The built in bluetooth of nRF52 in (in theory) very nice, but I guess there need to be more useful examples/infrastructure to connect it to a phone or home server/raspberry. I will figure it out...

Regards, Ola

Klaus_K

But I want to control i my nano board from an android app with a Game pad or Remote control UI.
You would think it should be easy to create an app that can be used as a client for a BLE. But when you look at the Bluetooth SiG webpage it looks like they would like to make money of that.

https://www.bluetooth.com/develop-with-bluetooth/qualification-listing/qualification-listing-fees/

That look to me like you would have to pay $100 if you want to publish an app using GATT-based profiles. That could explain why there are only a few generic BLE apps available.

thomadtom

#4
May 07, 2020, 10:49 am Last Edit: May 08, 2020, 04:46 am by thomadtom
This app is very good, I like it, thank you I have used it at https://androidrub.com/apps app store for the latest phones.

gerrikoio

Quote
I have modified and uploaded some sketches from "ArduinoBLE" examples to my nano 33 ble board. I can control the app from "low level apps" like nRF Connect and LightBlue. But I want to control i my nano board from an android app with a Game pad or Remote control UI.
You are a being rather vague with describing your problem. The ArduinoBLE library starts with two options "Central" or "Peripheral". You haven't said which example group you chose, but it's easy to surmise that you tried some Peripheral examples. My ArduinoBLE library provides 3 options for LED and 1 for battery monitor. So which did you try? Once again as you mention using a "low level app" can presume an LED example.

Putting that aside, I am trying to visual your architecture. Are you wanting your Nano to connected to an Ardroid app, which in turn is connected to a Game Pad or Remote control UI?

From the looks of things, if your Game Pad or Remote control UI is using Bluetooth EDR (2.0) then you would be right to use an Android phone/tablet as the bridge.

Quote
The problem I am trying to solve is to use arduino nano 33 ble as a bluetooth remote control for a toy-car.
This statement says the opposite. In theory, if your remote control toy-car was using a bluetooth low energy device then you could connect the nano BLE device to the car directly by defining the nano as a "central" device.

Maybe clarify.

If we assume that the car uses "old style" Bluetooth, then I would suggest you look at MIT App Inventor as you can readily build your app fairly quickly as you can use both Bluetooth standard and Bluetooth Low Energy.

Quote
If I implement some predefined characteristic like "Human interface device 0x1812", do I also need to implement specific services?
If using MIT App Inventor as the means to make the bridge then you have to freedom to use what ever you want. The simplest and quickest is to use the existing custom service provided by the nano. There is no need to try and use the HID 0x1812 option here.

However, if the remote control device happened to be using Bluetooth Low Energy then you need to read the specification to find out what services it is using. You can of course try using your "low level apps" for this as it would reveal those details. Word of caution though; if the remote control device was using encryption (pairing) it make this option difficult if a password or pin code was required.

On the other, the simplest method might be just to purchase another nano (one for car and one for remote control).

Go Up