Realtime data streaming with react native and BLE: Possible and/or how performant? - real-time

I am a medical student working this summer to create a wearable device for children with cerebral palsy. The device should be capable of streaming via bluetooth LE to ios or android app, and I am hoping to have two bluetooth capable sensors each streaming (realtime) data samples (size: 3 float values per sample) at around 50 Hz (or the highest frequency possible). I do see that there is a react native library for BLE (https://github.com/innoveit/react-native-ble-manager), however I am concerned that I may run into performance issues if I go the route of developing with react native instead of native ios/android. Could you please either explain what route you think is best or link me some resources which may help? Main questions I have are 1. Is this possible? 2. What BLE library do you recommend 3. Will I be sacrificing on BLE real time data streaming performance by going with react native? THANK YOU VERY MUCH

Related

Wifi BSSID Signal Strength and Channel allocations IONIC

Id like to know if it is currently possible to conduct network scans in Ionic on android and IOS, effectively what id like to know is if its possible to read the 5.2ghz and 2.4ghz networks and return BSSID its signal strength and what channel its using coded under the ionic framework. currently building a network planning tool and its something that I would like to include. I had heard that at one point IOS was not allowing these tools onto the App Store, but ive also heard now that they do allow it.

How can I get real-time heart rate data in a progressive web app for phones?

I'm building a progressive web application (target is smart phones for now). The app needs to be able to access heart rate and heart rate variability, ideally in real-time. While it seems totally asinine, I'm open to using REST calls to some remote server if that is the only way. I'm also fine with restricting the app to only work with certain hardware if necessary. In this case, the ideal hardware would be some sort of earbud that uses optics to scan for heart rate, but at this point, I'm open...
The best that I have thought up is to find a heart rate monitor that converts the direct signal into audio and use the microphone web API. That seems like a lot more work than ideal, so I'm hoping someone has a better idea. Any ideas are welcome. Please, no one downvote anyone if it doesn't solve all my constraints. I've been working on this for a bit and I'm not sure that there is a clean and perfect solution yet. Thanks in advance!
If the sensor can speak Bluetooth, the Web Bluetooth API can perhaps help: https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web
How about use a Web Bluetooth that lets you control any Bluetooth Low Energy device like heart rate monitors. It will read the Service Location Characteristics (which tells your where the sensor is placed - which body part) and subscribe to notifications from the Heart Rate Characteristics, meaning you will get an event whenever the device performs a new measurement. Then use a service worker that will define the behavior of the app to mimic native app capabilities like offline support and notifications.
It's like a Physical Web that you can send a link to your website from a Bluetooth beacon to a user's device and with PWA, that link can be to your web app that looks, feels and functions like a native app. Then with Web Bluetooth, you can then speack to the device. Visit this blog post for more details.

Bluetooth LE Profile for reading measured data

I read a lot about Bluetooth LE in the past hours, but I do not really understand how profiles work. I want to pair an iPhone with a self-made device over BTLE.
The device should send measured temperature values, humidity or other values over Bluetooth and the iPhone should read that data.
I read about different profiles in the BTLE specs (even about heart measurement), but how does one proceed, when reading CO-emission for example?
Thanks a lot!
Regards, mary
There are two sides to this: the profile you'll define on your device and the code you'll write to communicate with this profile in your iOS application.
On the device, you'll define a profile with specific services for the measurements you want to gather. There are several standard Bluetooth LE profiles which you can find in a list on the main Bluetooth developer site. These include profiles for temperature, heart rate, and walking cadence, among others, so if you are providing measurements in one of these categories you can make your device provide one of those services and it will be usable with any iOS application that reads from that service.
For values that aren't covered by one of the existing services, such as the humidity readings you mention, you'll need to create your own custom service. You'll just have to define the service characteristics (what type of data you'll provide and how you'll provide it) and give this service a unique identifier, because it's one you're creating and not part of the standard ones laid out by the Bluetooth organization.
How you define these services and characteristics will depend on the specific Bluetooth LE hardware you use for your device. I've done most of my work recently on Bluegiga's BLE112 chip, which combines a low-power microcontroller with a Bluetooth LE transmitter. They have very good tools for defining device profiles and creating matching firmware, and it's reasonably straightforward to set this up on their chips. I can't speak for other manufacturers, but they most likely have something similar.
Once you have a profile defined on your hardware, you'll need to look for devices advertising it and be able to connect to them within your iOS application. You'll use Core Bluetooth for this, and I highly recommend starting with one of Apple's sample applications, such as their Temperature Sensor example. That example uses the standard health thermometer profile, but you can tweak it to find your proprietary services in addition to the temperature readings. You can see how they read and process the binary data returned from the LE device in that example.
I highly recommend watching Apple's two WWDC 2012 session videos on the topic, Session 703 - Core Bluetooth 101 and Session 705 - Advanced Core Bluetooth, because they provide a lot of background on the topic and show practical examples of this in use.

Make a simple iphone app that can connect another bluetooth device

I know some basic about iOS programming, now i want to connect my app to another non iphone device e.g. connecting to a bluetooth device that can control a light bulb on and off, or control any furnitures.
My question is, besides iOS xcode, what kind of program i need to learn in order to achieve my goal?
Is there any sources that i can learn from it?
For Bluetooth Low Energy devices, you can use the CoreBluetooth framework to access them.
For Classic Bluetooth devices or accessories that make use of the Dock connector, the protocols are not open, and joining the Made for iPhone (MFi) program is required. I do not suggest this for beginning.
My suggestion is to buy for example a Polar Heart Rate Belt that supports Bluetooth Low Energy. These use standard protocols. Sample code is available from Apple that shows how to read out the heart rate from such a device.
As soon as you have mastered the heart rate monitor example, a next step would be to acquire a programmable Bluetooth Low Energy chip (however, often, the development tools for those are rather expensive!). Those chips can be programmed with custom profiles to listen for Bluetooth Low Energy connections and then performing defined operations (lighting a LED) when writes to characteristics occur. So, you are not limited to heart rate monitors and similar devices.
Keywords that you can search for: GATT protocol, Bluetooth Low Energy, CoreBluetooth.
I know that it's a steep learning curve for beginners, but the area is pretty new. However, I can assure you that it's a fun area.
I also think that you should look in to embedded C programming for the slave device (Heart Rate Monitor)
You could get a tod Smart Beacon Development kit for ~$150 and then use BGScript to code the firmware to control the BLE device from your phone or pc. todhq.com for more info.

Phonegap app performance vs native app performance

we are looking at getting a barcode scanning application built. We are considering using PhoneGap but our only worry is speed.
All the application will do is just scan a barcode and check a server to see if it's valid or not. The application uses the camera very intensely to scan the barcode via an image.
My main question is, will scanning via phonegap be just as fast as a native app? Speed is really important as the user will have to scan multiple barcodes very quickly.
Phonegap uses the same native APIs, it just abstracts them so that you can write your application in html and javascript. The time to take a picture or any other native process is less important than the time the user perceives. This is the portion of the native execution time that you need to expose to the user + Abstraction API time + UI responsiveness.
There is always an overhead from an abstraction but I think that's negligible in an app like this (in phones newer than BB OS5). The current issues originate from the hardware rendering the HTML and the browser software installed on the device.
A lot of BlackBerry phones don't use webkit (OS5 and below) and the the browsers they do use can seem very sluggish while rendering webapps. BB OS versions less than 5 don't have a production worthy way of communicating between the native and javascript layers, the hack that's often seen is to set and poll for changes in cookies. Android has always had a good design for JavaScript to native interaction afaik.
BlackBerry phones and many lower end Android phones don't have GPU's, or some Android phones that do have GPU's don't compile webkit for the GPU! Without this your UI app may
have that sluggish feel, pages/buttons take that bit longer to respond which is very noticeable when you're trying to whiz through menus.
This has improved a lot since phonegap was released. UI lag should continue to decrease to a point where even new low end phones are production ready for webapps. But from my experiences we've not yet reached that point in 2011.
The phone's built-in software is what does the scanning and camera action. PhoneGap will only trigger the event and help transfer the data but the phone does all the work.
As others noted the html5-based UI may feel sluggish. Maybe it's not an issue; you just have to try it and see. For scanning a barcode and uploading to a server the Phonegap overhead might not be signficant.
I have developed a smartphone app where barcode scanning is an alternative to the primary function of scanning an image which is recognized by picture matching technology. I use PhoneGap. I have not compared this to native app performance. I am able to say that for my basic UI (it is a web app for the smartphone), my web pages are rendered fast enough not to be an issue. This performance has been observed on a 600MHz smartphone CPU (LG Optimus One running Android 2.2.1).
The picture matching as well as barcode scanning is done on a server backend, not on the smartphone itself. The issue becomes one of networking speed from smartphone over WiFi or service provider network, over the Internet and onto the server - then there is the response from server back to smartphone. The processing speed of picture matching or barcode scanning has to be less than a second (ideally half a second) so that by the time networking delay is added, it is still a 1-2 second response time for the user.
The image files that I am transferring from smartphone to server is targeted to be around 40KB. At a typical 54Mbps WiFi network or the going rate of around 40Mbps in HSPA+ service provider networks, I find the performance of my app to be suitable. Even with a fair signal WiFi speed of 15Mbps, end-user response is acceptable between 1-2 seconds.
The pace of smartphone development (dual core processors) and service provider networks (4G HSPA+) will only take the industry higher. It is a tremendous opportunity for apps development moving forward.
Side Topic:
I am using Zbar code on the server for barcode scanning and I am hunting for better alternatives. The challenge with ISBN barcode scanning from smartphones having non-zoom, non-macro lens is that the typical barcode size is too small for "simple" barcode scanning algorithms to work properly. I'd like to hear about alternatives and people's experience with barcode scanning. I would be looking for code that I can deploy in my server backend, as opposed to running smartphone resident barcode scanning.