we are creating a game for android and iOS, where we want to modify the story based on relaxation/stress levels.
We are thinking about using heart rate sensors like the Polar chest sensors and similar.
I was wondering if any knows about a repo to include in our app to handle the Bluetooth part of the sensors, we don't have experience with accessing to hardware, we implemented some connections and readings but connection is unstable, sometimes it connects, another's connection is lost, sensor is not found....
Thanks in advance
take a look at the developer's page of https://www.rookmotion.com/api, it is an app already made for heart rate monitoring but also has an SDK for third-party developers
Related
first of all i would like to say that beacons seems to be something great and usable, i am very enthusiastic still i saw it for the first time.
Now, i would like to try them and to make an Android app, but i'm confused about some things that i didn't found it clearly on internet:
Are beacons available already?
How much does a beacon cost?
Does it need to be charged ?
How much time can a beacon work without charging?
Do i need to setup every device for interaction with it?
Can i implement beacon in Unity App ?
Is there any tutorials about using it?
I know, post is a little big, but i would be very glad if i will found here answers. Have a nice day! ;)
Are beacons available already?
yes, check out the internet.. radius networks, kontakt.io, estimote etc., you could also hit Alibaba, or buy a raspberry pi and a bluetooth dongle
How much does a beacon cost?
cheap. Small beacons could be as little $1 each, but these have drawbacks like non-replaceable batteries and short range, Bluetooth 5 beacon could be more expensive, but these can cover a 1km radius (personally I think that's pointless). Typically expect around $30 for a "good" or top-tier beacon company's primary beacon choice. If you buy bulk you get cheaper, but you might want to experiment with a few different kinds before you do that. Our company bought like 300 at one stage and we might need to replace them with a different manufacturer now
Does it need to be charged ?
some have replaceable batteries, some are only available to be plugged in, some are just disposable - you need to track that yourself
How much time can a beacon work without charging?
it can't - you may be thinking of NFC here - a Bluetooth radio/antenna requires more power than you might think (but probably less than both of us think to be honest), however it needs a dedicated power source both to transmit and receive data
Do i need to setup every device for interaction with it?
no, you make an app that listens for it. Well.. there are actually lot of options, however, not with straightforward detection/processing. Eddystone promotes a notion of "the Physical Web", which is like using URLs sent by Eddystone beacons to show you the right content, or iPhones actually have more built in support for some (mainly) retail use cases. Android is great because you can do so much in the background, and foreground services give you a lot more say about how and when you are stopped. You should also be aware that 4/5/6/7 all have different caveats around scanning/receiving, but most of the differences will/should be absorbed by any SDK you might use
Can i implement beacon in Unity App ?
certainly, just find a use case (AR/VR and a drone with a beacon for a Dragon? :O)
Is there any tutorials about using it?
so many, google about, but I would recommend starting with Radius Network's Android Beacon Library.(This uses Altbeacon, but is VERY easily changed to work with iBeacon and even Eddystone, also it's free and these guys know their stuff). Also, there are many beacon apps you should download as the consistency is not guaranteed across devices, and a few apps have a few different features that you might want for debugging. Try Locate Beacon (by Radius) NRF Toolbox and basically any other BLE app with a decent score - it can be really good to cross reference the hits when funny stuff starts happening.
A lot of people talk about Beacons and managing them as if it's more complex than it is, you have an object that just screams an ID every X milliseconds, you hear that, you do something with it, once, every X seconds, or whatever you want
I would say you should get very familiar with the difference between BLE/ Bluetooth Smart and regular Bluetooth that interacts via a GATT server. With beacons you're essentially just listening to a peripheral device that advertises in a set format. As the developer, it is up to you to take this and make it meaningful for your user
I am currently developping an Android application that can monitor the signal strength of an iBeacon with the library Android iBeacon Library (http://developer.radiusnetworks.com/ibeacon/android/).
But because we want to use iBeacons with very slow frequency to save battery, I need to be able to increase the frequency for a few minutes to have frequent detections during the signal strength monitoring. The problem is that the library I am using does not seem to provide this functionnality. I searched the web for other libraries that would offer this feature, but I can't find any.
Do you know a library that would let one change the beaconing frequency of an iBeacon? If not, how should I proceed to code it?
My revised understanding of your question is this: You want an Android library that communicates with an iBeacon to dynamically change its advertising rate.
Unfortunately, I think the Android side is the easy part. The hard part is that no iBeacon manufacturers I know of have an open API that allows you to dynamically change the advertising rate. (Although some do let you use an app to configure this rate over a secondary Bluetooth connection. Radius Networks' small USB-powered iBeacons work this way.) Because each vendor's service works differently, you'd have to reverse-engineer how each of their configuration BLE services works.
If you really want to do this, here is how I would approach it:
Build your own custom iBeacon that has a secondary Bluetooth LE service that allows you to connect to the beacon and change its advertising rate. A great way to prototype this would be with an iOS device acting as an iBeacon or with one of my company's iBeacon Development Kits. For an iOS-based beacon, you can write the secondary service in Objective C. For the IDK beacon, you can write the software in any language supported by Linux.
Write custom Android code that connects to the bluetooth service and sets the advertising rate as needed. You could use this alongside the Android iBeacon Library. And as an open-source project, you could always offer to merge your code into it once you have it working. (I'm the guy to talk to!)
Once you have this working, talk to an iBeacon vendor to make custom firmware for a battery-powered beacon that does the exact same thing. Hardware suppliers will tell you how to make custom firmware. This typically requires a proprietary workbench tool and is done in C or in a proprietary scripting language.
Yes! The Android iBeacon Library from Radius Networks Supports this. Below is sample code that changes both the foreground and background scan period to be every 5 minutes. What this means is that the library will spend five minutes doing scanning, and let you know what iBeacons it sees during that time. (The foreground default is 1.1 seconds.)
You can change this frequency as you wish based on some algorithm in your app.
iBeaconManager = IBeaconManager.getInstanceForApplication(this.getApplicationContext());
...
#Override
public void onIBeaconServiceConnect() {
try {
long five_minutes_in_millis = 5*60*1000l;
iBeaconManager.setForegroundScanPeriod(five_minutes_in_millis);
iBeaconManager.setBackgroundScanPeriod(five_minutes_in_millis);
} catch (RemoteException e) {
e.printStackTrace();
}
}
Full disclosure: I am an employee of Radius Networks and the primary author of this library.
The project objective is something like this:
We would have a locomotive robot having on-board GPS on it.
Now using that GPS we want to track the position of robot and trace it on android cellphone.
(as they provide best interface with Google services)
Not only that
We even want to control the robot from android cellphone.
Is it possible to send control signal from android cellphone to that robot so that robot can make a move according to control signal.
How can we make a connection between android cellphone and on-board GPS of robot.
(We are somewhat newbie to robotics)
Any better ideas, suggestions are most welcome.
Check out Dension Wirc module:
WiRC module by Dension
It works for RC controlled platforms by sending a pulse width modulated train, allowing you to control servos and electronic speed controllers. There are 8 channels. I'm using it to control 2 tracks and a pan/tilt turret, it works great. I emailed the support team, and they sent me an iPhone project, which got me running in a matter of hours. The WiRC kit comes with a camera, so I can drive my robot remotely via wifi.
In terms of GPS, I did a test on iPhone, under clear sky, and the GPS signal drifts badly. The accuracy is indeed somewhere between 30-50 feet, it is not enough to track position of a small robot precisely. I will post a screenshot of my experiment.
Check out this screenshot: I'm walking along the white paths on the map with the phone in my shirt pocket. Every second it places a pin on the map. You can see how badly the red pins deviate from the white path. This is 30-50 feet off path. For a 2 feet long robot, this is a major trouble. If it tries to correct it's path with such resolution of GPS, it is likely to become very confused.
I've seen a differential drive equation on wikipedia (a motor with slit encoders), counting the number of slits that passed past encoder in a certain interval of time. This may help correct the GPS, but requires additional hardware
I am working on something same like this
I am trying to make an autonomous robot capable of moving itself based on some extensive robotics algorithms but certainly you don't need that.
But I think it will be better for you to mount the Android phone on the Robot and then control it with your laptop via WiFi or any other medium.
Mounting an android phone will have many advantages like:
Having a nice GPS and where there is no need to do extra work to integrate it with other hardware and software.
And you can have other hardware like accelerometer, proximity sensor, gravity sensor etc. which can be useful in many ways.
Now there is a lot of data for making Robots based on Android. Here is the Cellbots
they work on making robots from android and control them remotely from laptops or Android.
To read the sensor's data on an Android platform (i.e. Accelerometer, Gyroscope, Magnetometer, Barometer, GPS ), people over the internet are talking about two ways to acquire such data
Primary way: reading the data using the Android SDK via JAVA.
The 2nd way is related to reading the data using the Android NDK.
What about communicating with the sensors directly via SPI,I2C, or UART without the use of the SDK or the NDK ? I understand that I'll be burdened by understanding the communication protocol with the sensors and reading specific registers from which I can acquire the data in a more efficient way. Is this possible ?
In theory it is possible, Walid. If you throw enough time and money at most technical problems, solutions become possible. But I would have to ask why anyone would want to do it that way?
It would be like saying "I'm pretty sure I can drive my car, inverted. I'll operate the accelerator and brake with my hands, and I'll add a couple of extra mirrors to reflect the windshield view down to me. And I'll steer with my legs. Don't ask me how I'll operate the horn!" It's just doing it at a goofy level.
You'd surely need details of the individual chips, which means you'd need to tear your XOOM apart - that kind of implementation info is not published. Not because it's a big secret, but because it keeps costs down if manufacturers don't publish info that 100% of consumers don't need.
Bottom line: there are more productive uses of your energy and brainpower.
Peter
I have a microcontroller collecting sensor data at a rate of about 4 Hz. I would like to send this data over Bluetooth to a remote entity. I'm thinking the serial port profile (SPP) would be best, since it emulates a physical cable. Under normal usage, it would not be unreasonable to expect the connection to be held open for 10 to 12 hours at a time.
Has anyone done any work in this field? Does anyone know the best profile to use, or any resources to use as reference? Thanks in advance.
Yup I'd use SPP/RFCOMM. That will be supported in all Bluetooth versions and all implementations (except for the very very very basic which might not support RFCOMM/SPP). There shouldn't be any problem with keeping the connection open for a long time.
Bluetooth 2.1 supports a streaming mode over a basic RFCOMM channel, if your API will let you configure it.