Movesense low level API - movesense

I am planning to connect Movesense to Arduino with BLE Shield.
Where I can get deep protocol description to get position data from the Movesense? Do this information public?
On Android I have library mdslib-1.39.0(1)-release.aar that allows connection to Movesense, but have not able to get code from it, to create Arduino connection to Movesense, based on Android sample.

The "Whiteboard protocol" that MDS implements on top of BLE is quite complicated as well as proprietary, so it is not possible to have that on Arduino (or outside the common environments). However that is not the only way to communicate with the Movesense sensor.
For low level BLE access, you can either define your own GATT service using CustomGATTService, or use one of the existing "out of the box" profiles (HRS or Nordic UART Service. These will be nicer in 2.0).
The new 2.0 comes with a sample that provides any sensor data over GATT (as a binary stream) and we've back ported it to 1.9.4 as well (find it in https://bitbucket.org/suunto/movesense-device-lib/downloads/).
In my opinion if you just want IMU-data, the "gatt_sensordata_app"-sample is by far the easiest way to go.
Full disclosure: I work for the Movesense team

Related

Flutter read from polar heart rate monitor

I would like to build an app with Flutter that can read data from a Polar H9 or H10 heart rate monitor (Bluetooth).
I must say that I am a bit lost and don't see how to do.
I would appreciate some clues and a little guidance for it.
Thank you very much !
Best Regards
The best way to start with any new BLE would be to look for any kind of documentation describing the process of connecting and accessing the data. I found the official polar SDK on GitHub. It's written for either iOS (Swift) or Android (Java) but might help you anyway.
In case it is not possible to use native libraries with flutter you should start by using a generic BLE scanner such as nRF Connect to find out more about the device and the available BLE services. It could be that nRF Connect already recognizes the Heart Rate Service in case Polar uses the official Service structure. If that's the case you need to read the specification of the Heart Rate Service (Found here).
If they decided to use a custom service or protocol you could use nRF Connect to try to find out something about the device by sending some messages. This is a tedious process of try and error. A BLE sniffer might also help to collect data about existing communications between the sensor and a device.

Movesense with Unity BLE plugin

I am trying to get the Movesense to work with a Unity BLE asset as originally I thought MS would be simple enough. I have managed to connect to it and subscribed to the "61353090-" starting service and the "34802252-" starting charasteristic. I think I even got some notifications. Now the problem is, that I am not receiving or able to decode any data from there.
I also ended up reading the example codes and found out the complex system the Movesense uses and the "whiteboard", which I am unfamiliar with. I cannot find anything sensible by googling, as whiteboard is a whiteboard :)
Now my questions are:
What should I do to progress? Do I need to write something to the "17816557"?
What is the "whiteboard" actually?
Would it actually be smarter to just make a Unity plugin for the Movesense?
Thank you
Your are quite right that the answer is in the "Whiteboard" component. Whiteboard is the embedded REST framework (Note: it is not over HTTP!) that Movesense uses to implement REST services within as well as inter device (e.g. over UART or BLE). As you can imagine it is not a simple component, so decoding the traffic without Amersports'/Suunto's help is quite a big challenge. The actual BLE layer is simple: one characteristic to each direction (write & notify), the complexity lies in what goes inside that data pipe.
However, if you are trying to use Unity to make a mobile app the situation is not so bad. There has been a prototype of Movesense mobile library integration for Unity (Android) that uses the existing Movesense mobile library. If you ask Movesense team (info (at) movesense.com) they might be able to help you further. For Windows (Unity or plain) there is nothing done (at least not yet) mainly because until Windows 10 there was no official BLE API for Windows.
Full disclosure: I work for the Movesense team

Raspberry-pi as connectable beacon

I want to build some kind of two-way bluetooth connection on Raspberry-pi which actually works as beacon. Based on RadiusNetworks tutorial (How to Make an iBeacon Out of a Raspberry Pi http://developer.radiusnetworks.com/2013/10/09/how-to-make-an-ibeacon-out-of-a-raspberry-pi.html) I've built beacon on my Raspberry-pi, but it's working in "advertise and not-connectable" mode (which is connected with problem described here: Raspberry Pi iBeacon connection timing out).
What I want to achieve is beacon device, which works in advertise mode and also allows to receive some events from other device (i.e. iPhone). When iPhone discovers Raspberry-pi beacon I want it to send some data to Raspberry-pi to trigger some action. I know that in the simplest way my iPhone should send data via network to raspberry while it enters to the beacon region, but unfortunatelly my solution has to work in offline mode, so I'm looking for some kind of direct (and possibly fast) connection. I think that PayPal beacon is a good example of my needs (as it is decribed here: https://devblog.paypal.com/how-does-paypal-beacon-work/ their device works as gate for communication user smartphone with PayPal services).
I'm complete beginner in BLE topics, so I would be grateful for any hints where I can start exploration or how to properly ask Google for any good answers in this topic.
For complex interaction, you need to learn how to build a connectable Bluetooth service with BlueZ, which is the Linux open source Bluetooth stack. Once you have this service, you can write iOS code using CoreBluetooth to connect to this service when the beacon is nearby.
Unfortunately, I do not know of a good tutorial for building services on BlueZ. The BlueZ code is open source at least, so the code is a good place to start looking:
http://www.bluez.org/development/

Using the new MonoTouch.CoreBluetooth namespace

I have found a few samples on how to use GameKit for bluetooth communication and even accessing bluetooth functionality using native code but no example on how to use the MonoTouch.CoreBluetooth namespace.
Seems a shame using hacks when the full implementation is just waiting to be used.
Can anyone please share a sample or source (a link to a book would work as well) for the new MonoTouch.CoreBluetooth.
CoreBluetooth is just for communicating with devices that utilise the Bluetooth Low Energy Profile, such as watches, heart rate monitors etc.. It is not possible to use any other profiles with CoreBluetooth, so not possible to connect to another phone, a computer etc...
(Although given the name, I hope in future apple will provide lower level access to bluetooth comms in this framework)

Wireless communication: AVR based embedded system and iPhone

What is the best way to realize wireless communication between an embedded system (based on an AVR controller) and the iPhone? I think there are only two options: either WiFi or BlueTooth. The range is not really a problem, since both devices should stay in the same room.
I have no idea, if there are any useful WiFi boards that can be connected to an AVR based microcontroller system (or any small microcontroller), any hints would be highly welcome.
I guess the better solution would be BlueTooth, but there is also the problem: which BlueTooth board is best suited for attachment to an AVR system, and is it possible to use the iPhone BlueTooth stack for (serial) communication over BlueTooth with the AVR device.
I hope that somebody already realized such a system and can give some helpful tips...
You can get modules for both WiFi and Bluetooth that will connect to an embedded system through a UART interface, however a WiFi module will have far more processing power than your AVR microcontroller, often with spare capacity and I/O to execute additional user code, so connecting one to an AVR maybe somewhat redundant in many cases.
Bluetooth modules are simpler, less expensive, and the data-rate is better matched to the AVR's capabilities. For example these Parani modules. I have used them between an embedded system and a Laptop PC's Bluetooth, so given appropriate communications software, there is no technical reason why it could not be used with an iPhone I think. However this may be the flaw, on the PC the device was recognised as a virtual serial port, I don't know whether iPhone supports 'legacy' communications in quite the same way.
For comparison, a WiFi solution
From what I know, BlueTooth is very limited on the iPhone: There is only very few BlueTooth-Profiles implemented, and - even if they can be extended with a jailbroken iPhone - I doubt this is easy to use from the application layer.
On the other side, transferring via WiFi requires a lot of processing power and memory since much more things have to be implemented before you can even start transferring data: 802.11, cdma/ca, arp, tcp. That's a big task.
Is it an option to build a hardware extension to the iPhone ? You might be able to get the serial connection and power out of the dock connector. Then even ZigBee could be very helpful.
Here's an article you might find helpful. I would lean toward a WiFi solution just because of the added flexibility available.
http://www.embedded.com/design/networking/215801088
-t
Some of the other people at the office have done AVR <- Bluetooth -> Symbian and AVR <- Bluetooth -> PC solutions without trouble. There is lots of info, reference designs and source available. I have no idea of how hard it would be to use Bluetooth on Iphone.
The exact module is probability also not important as long as it got some type of serial interface (I2C,SPI) to interface to the AVR and some source code show how to use the module.
Is it an 8-bit or 32-bit AVR? For the AVR32 processors there's support
for WiFi in the Atmel 1.5.0 Software Framework using SD-card-mounted
WiFi modules from HD Wireless (http://www.hd-wireless.se), including
an IP stack (lwIP). Be aware that you need Ad-Hoc (IBSS) support to
connect directly to the iPhone.
There is WiSnap kit. It can connect directly to a standard RS232 interface or through the TTL UART interface to embedded processors. We are planning to use it in our project. It also has Ad-Hoc support.
There are some usage examples and an iPhone application for connection setup.
http://serialio.com/products/mobile/wifi/WiSnapKit1.php
What are you trying to communicate between your AVR and the Iphone? The Iphone is made for the web along with everything apple (which AVR's are decidedly not). So what works well is an embedded device that exposes a web-interface. Like the Transmission bittorrent client on Linux. Also nowadays many low-power small form-factor linux platforms exist that will allow you to do this.
For instance Gumstix has an ARM based platform that runs linux and includes WiFi (Overo Fire).