Read BLE Beacons from react PWA - reactjs

I'm designing a PWA for customer support.
One of the functionalities will require precisely (5 meters error margin) positioning the user's phone.
I'm thinking of using beacons as their range and precision suites my needs.
the thing is: How can I read beacons from a react.js (no native) PWA? Of course for triangulation, this would require reading several beacons.

Sorry, there is no practical way to make a web app that scans for bluetooth beacons due to the lack of browsers' support for bindings to raw bluetooth scanning.
Google Chrome does support BLE interaction via JavaScript through the Web Bluetooth API. However, it only supports discovering and connecting to GATT services, not arbitrary BLE scanning needed to find beacons. This means you cannot find iBeacon, Eddystone or AltBeacon compatible devices.
You might be able to discover a connectable custom BLE device that simulates beacon behavior through a connectable GATT service. But even if you did this, it would only work on Chrome, not on Safari, Microsoft or Firefox browsers, because Web Bluetooth is not supported on those platforms.
Even if you get this working on Chrome with a custom beacon, bluetooth beacons only provide very rough distance estimates. Triangulation only works decently at very close ranges of 3 meters or less. More practical indoor positioning techniques with beacons use RSSI fingerprinting not triangulation. And again, even Google Chrome with Web Bluetooth does not support the arbitrary scanning needed to do this.

Related

Finger print scanner with webusb

Is possible to connected/paired usb finger print scanner with webusb (https://wicg.github.io/webusb)?
I have digital persona U.are.U 4500 and want to connect to browser (chrome) with react.js and get image file and can compare image
WebUSB is a generic API for communicating with USB devices and so supporting any particular device requires knowledge of the data protocol used to communicate with the device. Manufacturers may or may not provide public documentation for this protocol and so it is often necessary to reverse engineer it by observing the communication between the device and a closed-source driver. In the cases where an open-source driver is available then that can be a reference for building a Javascript application to control the device.
In the case of the DigitalPersona U.are.U 4500 it appears that the open-source libfprint library includes a driver for this series of devices: https://gitlab.freedesktop.org/libfprint/libfprint/blob/master/libfprint/drivers/uru4000.c
This would be a good starting point for understanding how to communicate with the device.

How to use bluetooth in Marmalade SDK?

I'm writing a mobile application on Marmalade SDK. How can I connect to other device via bluetooth?
https://answers.madewithmarmalade.com/questions/7285/bluetooth-support.html
No, Marmalade doesn't have a Bluetooth API. However, you could write
an extension to do it.
iOS has a CoreBluetooth API that allows you to interact with devices
supporting the Bluetooth 4 Low Energy GATT profile - this is only
supported from iOS 5/iPhone 4S/iPad3 and up, and will only
interoperate with Bluetooth 4 LE capable peripherals exposing a GATT
service. For earlier iOS devices, the only option is to use Apple's
proprietary iAP protocol, which means you can't "talk" to generic
Bluetooth devices - only those that implement iAP.
Android on the other hand offers Bluetooth 2.x + EDR connectivity. A
number of profiles (e.g. RFCOMM, A2DP) are supported. However, Android
doesn't have an API for Bluetooth 4 LE yet.
So, currently, the situation, from a cross-platform point of view, is
quite fragmented and it isn't straightforward to implement a
one-size-fits all Bluetooth connectivity solution.

Is there any framework to allow P2P communication via phone?

I want to build an app that allow P2P communication(send message, exchange files), I build the app with phonegap, since I want my app cross platform.
I know WebRTC allow real-time communication, but browsers doesn't support it very well. I also found Websocket plugin for phonegap, this satisfied part of my requirement, I can use this send message, but if I use websocket to send files from A to B, I guess all traffic will go through my server, it a pressure for server and I don't want my server carry so much traffic. I can't make a peer to peer connection between A and B.
Is there anyway to make a P2P communication on phone? Any workaround solution is also welcome.
You can do peer to peer connections using Flash or the recent WebRTC. Currently these are the only options you can use to do so, as WebSockets will only connect to a server.
As Flash is not supported by most phones (only Android < 4.0 has support), you can only use WebRTC. But WebRTC is only available on Chrome Beta for now, so you'll still have a cross platform app that will not work in most platforms/devices.
You will have to go through server (WebSockets or HTTP) to increase the number of devices you can cover.
You can use Boost asio sockets to build you own P2P app. but you need to build it for Android NDK and IOS.
Please do take a look at these links before you get into a conclusion
Official "Boost library" Support for Android and iOS?
Limitations to using (Boost) Asio with Android NDK
http://beta.boost.org/development/tests/trunk/developer/summary.html
http://www.codeproject.com/Tips/555070/Boost-vs-OSX-iOS-XCode
Hope it helps
On WebRTC you can use RTCDataChannel, in my experience, on chrome, using this involves writing a lot of code around reliability as the packets arrive out of order or not at all if sent too quickly.
However I think as the WebRTC spec evolves this will improve with implementation.
Use this for generating a RTCDataChannel enabled peerconnection:
var localpeer = new webkitRTCPeerConnection(localConfig,{ 'optional': [{'RtpDataChannels': true }] });

Connecting an Adobe AIR mobile app to Arduino wirelessly - what are the options?

Is there a way to connect an Adobe AIR mobile app to an Arduino hardware wirelessly with no pc or router?
either with bluetooth or directly to an Xbee piece connected to the Arduino?
I need both iOS and android solutions
thanx
You could use the Native Extensions for Adobe AIR (ANE) for iOS and Android, although it means you might have to do a bit of C coding (or at least have basic understanding of the C programming language). A couple of projects have been created for either Bluetooth or Arduino connection using ANE already.
There is an ANE based project called as3-arduino-connector on Google Code, which gives you an ActionScript 3 API and mimics the Arduino serial port.
Another useful project might be AirNativeiOS-Bluetooth, an AIR Native Extension to add Bluetooth support for iOS apps. A corresponding project for Android is Bluetooth ANE, although the website mentions that it's early beta only, not ready for production.
Digi International has a Wi-Fi XBee now; that might be a good option since Android and iOS devices have Wi-Fi already. The more commonly used XBee modules (Series 1 and 2) use 802.15.4 networking (instead of Wi-Fi's 802.11).
I haven't used one yet, personally, so I don't know how you access the serial port connected to the Arduino. It might be possible to telnet to the XBee and send/receive data from Arduino.

GetSampleAsync does not fire in MediaStreamSource on WP7 device

I've been developing an audio app for Windows Phone 7 and up to this point have been using the WP7 emulator. The app uses a custom MediaStreamSource class to stream audio to a MediaElement.
On a real device, the custom MediaStreamSource completely fails. After calling MediaElement.Play(), the MediaStreamSource's GetSampleAsync method never gets called. It works just fine in the emulator.
I've started the app in the debugger (running on the device) and no exceptions get thrown anywhere.
I'm wondering if maybe my stream source is using a sample rate, bits per sample, or channel count that is not supported? I cannot find any documentation on what values are supported - however I find it hard to believe that my settings are not supported (44,100 Hz, 16 bits/sample, 2 channels).
Thoughts?
The answer is that the Zune software interferes with the phone's media capabilities. The app will work on the device if you disconnect the device from the computer, or by using the WPConnect tool: http://blogs.msdn.com/b/jaimer/archive/2010/11/03/tips-for-debugging-wp7-media-apps-with-wpconnect.aspx

Resources