How to send Struct data from app to ESP32 over BLE? - bluetooth-lowenergy

I want to send struct data from my flutter app to ESP32 over BLE. Is it possible? if yes, How?

Yes it is possible. You can send serialized data over BLE. Serializing data means converting your data into binary data (googling serialization will give you more information). You can use any serialization library you want. Choose one that has both Flutter and ESP32 support. I've used PROTOBUF before and I thought it was pretty cool, but it doesn't have ESP32 support. I've used JSON before and it works wonderfully in Flutter, but I'm not sure if there's a ESP32 library.
Let me know if this helped!

Related

WT901BLE not showing/advertising service UUID to the ESP32

We are pairing WT901BLE device with the ESP32.When WT901BLE is paired with smart phone application NRFConnect then service UUID is shown. I have read on some forums that some devices don't advertise service UUID and ESP32 only analyzes advertised data so that's why ESP32 can't see the service UUID of WT901BLE.Someone proposed on git to a similar issue that library code need to be updated for ESP32 to read scan response for data other than advertised data also then it will work. Can someone tell whether this is the only solution or there is some better way to do it. Secondly, which library need to be updated to get the desired result?

Using android GPS for Arduino

I'm currently doing my project on IOT.I need a GPS for that.I would like to use my Mobile's GPS for Arduino. How can the connection can be done?
Actually, your question is a little broad. But I would give you some tips to do it.
If you want to get your Android phone GPS data you need to create two apps; one for the Android side and one for the Arduino side. The procedure can be something like this:
Read Phone's GPS data based on what you need (E.g Lat/Long or other GPS parameters).
Create a JSON based on the data, e.g:
{
"lat": 1.234,
"lng": 5.678,
"speed": 100,
"hdop": 1.2
}
Send data to Arduino board through a proper connection (I will explain this).
Get data in Arduino board from the proper connection.
Parse received data (e.g JSON) and convert it to desired variables inside your Arduino code.
Continue your work with the received GPS data.
Let me explain a little more about proper connection. There are many options to do that. A simple option is to use Android Bluetooth and based on that on the Arduino side you need a Bluetooth receiver module which there are many out there like HC-05.
There are a bunch of tutorials to get a Bluetooth module working that you can find based on your Bluetooth module like this.
Another solution for the connection is to use wifi. For the Arduino side, you can use esp8266 and directly program it. There are some variants for it like Node-MCU
which has a builtin circuit to directly program it with an Arduino IDE software.
You can also go one step forward and use the newer ESP32 module which has both wifi and Bluetooth.
The good thing about using esp modules is that there are good APIs for creating your app and. You can find more about that on similar projects like here and here.

Movesense direct access to GATT endpoints

I am trying to read ECG real-time data from a movesense sensor by using another generic BT-LE module.
GATT characteristics can be used for Heart Rate (read or notify) or other predefined services : we simply send a raw command to an endpoint, for example a 0x0100 (START_NOTIFY) on the corresponding UUID for a heart rate notification streaming.
The problem is that with a micro controller and a BT LE module we can not use any of the C, Java, React... libraries since all of the underlying code is not open source ( the movesense device-lib and community-lib do define how to use and program the services, but we can not discover what to send on one of the 2 other services that are defined, the UART service or the Unknown Service, which are probably used by the movesense library to send all of the URL requests).
As a footnote, we access our generic BT-LE module with AT UART commands to communicate to the movesense platform.
Thanks for any help or guidance,
FS
Have you looked https://bitbucket.org/suunto/movesense-device-lib/src/master/samples/ble_std_services/CustomBleController.cpp
void CustomBleController::OnUartData(uint8_t * p_data, uint16_t length)
for receiving and
send_ble_nus_data(buffer, BUFFER_LENGTH);
to send using NUS (Nordic UART service).
It is possible to do your own GATT service on Movesense sensor (since v. 1.6.0) using the CustomGATTService module. Please look into latest movesense-device-lib and the sample "custom_gattsvc_app" (and with 2.0, the "gatt_sensordata_app")
Full Disclaimer: I work for the Movesense team

Arduino 101 and BLE

I'm using Arduino 101 and a HM-10 Module(BLE). I want to make an android app to send and receive data from Arduino via this Bluetooth module.
I was unable send data or receive data. I was able to connect to module.
Can you tell me a good tutorial how to do it? or to provide some useful information
I had to figure with the same problem currently on IOS, but i have found a good example Project to get startet. Look for one on the internet. Best is to look for a example that is basically a Serial Monitor/Terminal. After you have found your Example you should be able to modify it after your needs.

Passing objects from smartphone app to Arduino through bluetooth

I'm writing a windows mobile app that connects to an Arduino board.
Currently in order to pass data i'm sending strings from and to the Arduino board.
Is there a way to pass objects or formatted data?
you could use json, which is very easily parsable on the mobile phone side.
it all depends on the kind of data you want to send.
As the arduino is a simple C++ device, you may go with a c structure or a binary object. If you are connecting from windows mobile OS <=6.5.3, you can write in c++ or c# (or vb). You can then use a serialized to convert from/to a structure/object. How many data do you need to transfer? And what types?

Resources