Manage Float Data Received From Ble - MIT App Inventor Help Home » Arduino Ble Float » Manage Float Data Received From Ble - MIT App Inventor Help Maybe your like Arduino Ble Github Arduino Ble Hc-05 Arduino Ble Hid Keyboard Arduino Ble Hm-10 Example Arduino Ble Iot Loading Manage float data received from ble MIT App Inventor Help Seagull_Of_Quiet June 28, 2020, 10:36am 1 Dear Community, this is my first topic, so please advise me if miss any informations. I receive a float data from Arduino Nano 33 Ble, I view succefully this value (negative and positive number) with a label in App Inventor. But I don't understand how I can manage the float data to make some operation, like multiplication. Here the extract about App Inventor: image743×205 29.3 KB This is the error: Thanks you for your help ChrisWard June 28, 2020, 12:26pm 2 Hi We cannot help you with just that code snippet. We need to see all the BLE related blocks and the Arduino Sketch. Seagull_Of_Quiet June 28, 2020, 3:41pm 3 Dear ChrisWard, thanks you for your fast reply, below the Arduino code: /* ARDUINO_BLE___send float data */ //includo le librerie #include <ArduinoBLE.h> // library bluetooth #include <Arduino_LSM9DS1.h> // library accellerometer //dichiaro servizio bluetooth BLEService TotalService ("19B10000-E8F2-537E-4F6C-D104768A1214"); // BLE TotalService // BLE - custom 128-bit UUID, read/write central BLEFloatCharacteristic ComandAccY1("19B10012-E8F2-537E-4F6C-D104768A1214", BLERead); //variable float AccX = 0; float AccY = 0; float AccZ = 0; //variable for millis unsigned long time3; unsigned long deltatime3; //---___------***---___------***---___------*** void setup() { //open serial comunication Serial.begin(9600); //open serial comunication: ok while (!Serial); //Nano 33 BLE and sensors: ok if (!BLE.begin()) { Serial.println("starting BLE failed!"); while(1); } if (!IMU.begin()) { Serial.println("Failed to initialize IMU!"); while (1); } // set advertised local name and service UUID: BLE.setLocalName("FLOAT DATA"); BLE.setAdvertisedService(TotalService); // add the characteristic to the service TotalService.addCharacteristic(ComandAccY1); // add service BLE.addService(TotalService); // set the initial value for the characeristic: ComandAccY1.writeValue(0.00); // start advertising BLE.advertise(); Serial.println("Ready to start"); } //---___------***---___------***---___------*** void loop() { //list central BLEDevice central = BLE.central(); //central is connected if (central) { Serial.print("Connected to central: "); //print MAC of central Serial.println(central.address()); //while central is connected while (central.connected()) { //call function FUNZAccelerometer1 (); } //print note when central is disconnected Serial.print(F("Disconnected from central: ")); Serial.println(central.address()); } } //---___------***---___------***---___------*** void FUNZAccelerometer1 () { //make 'delay' with millis deltatime3 = millis() - time3; if (deltatime3 >= 1000) { time3 = millis(); //read values if IMU: ok if (IMU.accelerationAvailable()) { IMU.readAcceleration(AccX, AccY, AccZ); Serial.print(AccY); Serial.print('\t'); AccY = AccY * 100; ComandAccY1.writeValue(AccY); Serial.println(AccY); } } } //---___------***---___------***---___------*** And here App Inventor app: BLE_float_data.aia (246.4 KB) Do it possible make a PNG file of all code with just one click? Because, I know make a PNG one block for time. ABG June 28, 2020, 5:41pm 4 The When Floats Received block always gives you a list, even though it is a list of one item. Use the for each block to get the item(s) in that list one by one, and process them individually. Her is a draggable replacement block ... when BLE Floats Received744×240 25.2 KB 1 Like Seagull_Of_Quiet June 28, 2020, 8:06pm 5 Dear ABG, thanks you for yuor best support. Best Regards ChrisWard June 28, 2020, 11:33pm 6 Seagull_Of_Quiet: possible make a PNG file of all code with just one click? Yes, via the right-mouse-click menu in the Blocks Work Area, select "Download Blocks as Image" ChrisWard June 28, 2020, 11:49pm 7 ... let us know how you get on. The Sketch has a lot of Serial.print functions that could get picked up by the App. If that is your intention, the data receive block in App Inventor should be .Strings Received. When it receives a float value, the value arrives as text but you can still use that value for math in App Inventor robocop April 6, 2022, 3:33am 8 Hi Chris, I am using a commercial sensor for my project and when I get data over BLE my string values is like that DATA: V[]^]][[� DATA: DCBA@?>==>=<<;;<>BIP DATA: YX DATA: �D ", "bH DATA: JKKKJIHGp DATA: :BJPSTSRPNMKJHGFFGHI DATA: ", "FE DATA: �D ", "bH ", " DATA: ,,,-----� DATA: @><;97653210/...---- DATA: ", "03 DATA: �D ", "bH ", " DATA: DBA@@@@@ DATA: -,,++,05>FLOPPOMKIGF Do you have any idea about how can I get correct sensor data ChrisWard April 6, 2022, 10:57am 9 robocop: V^]][[� DATA: DCBA@?>==>=<<;;<>BIP DATA: YX DATA: �D ", "bH Hello Omer What does the Data look like in the Arduino Terminal? Edit - also, I need to see your Sketch robocop April 6, 2022, 12:15pm 10 OXIMETER.aia (334.0 KB) I am not using Arduino, I am using this smart device and I am able to establish Ble connection, However, I did not get human-readable data. Thanks ABG April 6, 2022, 1:05pm 11 robocop: how can I get correct sensor data Do you have a brand name, model number for this device, to allow searching for technical data on it? There are several articles in this Google search showing how to reverse engineer BLE oxymeter readings. BLE oximeter UUID 1 Like ChrisWard April 6, 2022, 4:09pm 12 OK, I see that your data example is not raw data, you embellish it with "DATA:". While trying to establish type, do not add anything at all to incoming data, just let it stream into the TextBox, one data packet overwriting the next. I have tried converting the data to UTF-16, among other flavours, seems there is either something special or the data gets corrupted. So yes, we need as much Technical data from the manufacture as possible. ChrisWard April 6, 2022, 4:47pm 13 ....probably need to read Bytes. Also, use the most recent MIT BLE extension (make a fresh Project): Extension Version: 20201223 Now, here is an old BLE Project, BLE Health Thermometer, which demonstrates how to extract data, developed by Gerrikoio. It will be different for an Oximeter but the principle is the same. Note that as an old Project, it is not using the latest MIT BLE Extension. BLE_HealthThermometer.aia (185.7 KB) PLXP_v1.0.0.pdf (1.3 MB) https://www.professorcad.co.uk/appinventortips#TipsBluetooth (latest BLE AIX here) robocop April 20, 2022, 2:14pm 14 Hi Chris, Thank you for your help! I've read a lot of your comments on the MIT app forums and it's been very helpful, you're very supportive of everyone working on MIT App Inventor. I really appreciate it. I have one more question, I read output data from the oximeter via nRf connect, and the output is like this: image1271×1029 140 KB In my app when I listen to these Characteristics I am able to see the first byte array which starts at 0x33 or 0x11 in the figure. I am sure my app is reading other value also but small amount of time so I can not see them. I need to read two bytes in the spesific byte array which always starts with 0xFF I am confused about two things First, how can I only monitor byteArray which starts with 0xFF Second after that how can I read only the fifth and sixth indexes. thanks Read indexes in Byte Array ChrisWard April 20, 2022, 2:18pm 15 Hi Omer robocop: First, how can I only monitor byteArray which starts with 0xFF Second after that how can I read only the fifth and sixth indexes. I actually do not know But I think ABG would know. ABG April 20, 2022, 4:38pm 17 robocop: In my app when I listen to these Characteristics I am able to see the first byte array which starts at 0x33 or 0x11 in the figure Show us your .aia? robocop April 21, 2022, 7:14pm 18 Hi Abg, I got some progress on my app. I am able to reach the required ByteArray and my output is below that fifth index shows oxygen level and the sixth is heart rate. I need to get rid of other numbers. Do you have any idea about that Thanks OXIMETER_Bytes.aia (345.3 KB) DATA: [255, 68, 1, 0, 99, 82, 38, 2, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1]DATA: [255, 68, 1, 0, 99, 81, 48, 2, 0, 0, 0, 0, 5, 4, 4, 4, 4, 4, 4, 4]DATA: [255, 68, 1, 0, 99, 81, 48, 2, 5, 5, 5, 5, 2, 1, 1, 1, 1, 0, 0, 0]DATA: [255, 68, 1, 0, 99, 81, 48, 2, 3, 3, 2, 2, 0, 1, 2, 4, 5, 5, 22, 6]DATA: [255, 68, 1, 0, 99, 81, 48, 2, 0, 0, 0, 0, 4, 3, 3, 3, 3, 3, 3, 3]DATA: [255, 68, 1, 0, 99, 80, 48, 2, 5, 4, 4, 4, 2, 2, 1, 1, 1, 1, 0, 0]DATA: [255, 68, 1, 0, 99, 80, 48, 2, 3, 2, 2, 2, 0, 0, 0, 0, 1, 2, 4, 5]DATA: [255, 68, 1, 0, 99, 79, 48, 2, 0, 0, 0, 0, 0, 5, 4, 4, 4, 3, 3, 3]DATA: [255, 68, 1, 0, 99, 79, 48, 2, 6, 6, 5, 5, 5, 3, 3, 3, 3, 2, 2, 2]DATA: [255, 68, 1, 0, 99, 78, 48, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1]DATA: [255, 68, 1, 0, 99, 78, 48, 2, 2, 2, 2, 1, 1, 6, 22, 6, 6, 5, 5, 5]DATA: [255, 68, 1, 0, 99, 78, 48, 2, 1, 2, 3, 5, 5, 3, 3, 3, 3, 3, 3, 3]DATA: [255, 68, 1, 0, 99, 78, 39, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0]DATA: [255, 68, 1, 0, 99, 77, 39, 2, 0, 0, 0, 0, 0, 0, 1, 3, 4, 5, 6, 22]DATA: [255, 68, 1, 0, 99, 77, 39, 2, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3]DATA: [255, 68, 1, 0, 99, 77, 39, 2, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0]DATA: [255, 68, 1, 0, 99, 77, 39, 2, 0, 0, 0, 0, 0, 1, 2, 4, 5, 5, 5, 21]DATA: [255, 68, 1, 0, 99, 77, 39, 2, 5, 5, 5, 5, 4, 4, 4, 3, 3, 3, 3, 3] ABG April 21, 2022, 9:09pm 19 These blocks should show the required numbers as you see them: blocks1660×1240 344 KB initialize global byteValues to766×52 10.4 KB The global variables are to help debug. Since you did not name any Labels to receive the requested data values, I mushed them together with a JOIN. P.S. These blocks can be dragged directly into your Blocks Editor workspace. See A way to group projects by theme - #10 by ABG for a demo. OXIMETER_Bytes (1).aia (346.2 KB) P.S. I have not seen any reference to floating point numbers in your project, and I am taking your word for it that the 5th and 6th bytes hold the data you want. Bytes are not floating point numbers in AI2. They are whole numbers in the range 0-255 (unsigned) or -128 - 127 (signed). 2 Likes robocop April 22, 2022, 4:40pm 20 Thank you Abg, I appreciate it. This is very helpful Also, I have another question about the list. I am looking for an efficient way to do this or any sample in MIT app inventor. Reading multiple indices from a list MIT App Inventor Help Hi All, I am using an IMU sensor that has a built-in BlueTooth module. I am able to read data from the device via classic Bluetooth. My output and my sensor are in the following picture [image] As you can see it starts with 58 which is hexadecimal format. And I need to read 7-10 or 11-14 ..... indexes separately because let's say indexes 7-10 is represents Float32. There is almost 26 float 32 or int16 data type in this Byte Array. My question is How can I obtain 7-10 indexes into a new list… biesys July 12, 2024, 3:16pm 22 Hello Chris, I just tested your BLE_HealthThermometer project. It worked on the first try. Thank you for this example !! How complicated is it to also read other Health BLE devices? Besides the Thermometer that just worked great with your App, I have a PulseOxymeter, Scale, Blood pressure and Glucometer. Any pointers? Any links you may want to share? Can you work with me reading these other devices? I'm willing to pay for your services. I have a BLE scanner that can read all charateristics etc. Thank you in advance, Carlos Bieberach next page → Tag » Arduino Ble Float Passing Float Values With Bluetooth - Arduino Forum Sending Float Over BLE - Nano 33 IoT - Arduino Forum Sending Multiple Floats Over BLE - Nano 33 BLE - Arduino Forum Sending Lat And Long Via BLE - Nano 33 BLE - Arduino Forum Nano 33 BLE, Bluetooth Values - Arduino Forum CurieBLE Library | Arduino Documentation Conversion From Float To Formatted Character Array On Arduino Nano ... Get Continuously The Value Of A BLE Service, Communication ... Best Way To Send Float Values Over BLE - Arduino - Stack Overflow Receiving Float From Arduino "BLEFloatCharacteristic" Via BLE What Is The Correct Approach To Transmit Rapidly Changing Real-time ... Sending A Float Value Through BLE With A Custom Characteristic #1755 Can't Discover Arduino Nano 33 IOT With BLE Scanner