sleep tracking with open pandora


b_o_b

Advanced Member
Joined
Sep 7, 2010
Messages
1,485
Does anyone has experience with using the Pandora for sleep tracking?

There are tons of tracking apps on phones for this purpose (I think they use the sound of breathing to determine quality and quantity of sleep), but I would prefer using my Linux laptop / Pandora with OS software. Have searched a bit, but couldn't find something for Linux/Ubuntu and as far as I can tell never mentioned on this board.

There are solutions for fitbit : https://bitbucket.org/benallard/galileo

Probably possible to use on pandora with debian / slackware.

This is awesome btw:

 http://marc.merlins.org/linux/talks/ArduinoSleepMonitoring/ArduinoSleepMonitoring.pdf
 
After more searching I found some interesting software that might work on the Pandora and laptop with the Xiaomi Mi Band

The Mi Band is quite similar to the fitbit but a lot cheaper. There are some python libraries that can interface with the band and there is even a desktop GUI

https://bitbucket.org/OscarAcena/mibanda

https://bitbucket.org/OscarAcena/pygattlib

https://bitbucket.org/OscarAcena/mibui/overview

Someone mentioned hooking these libraries with emacs/org-mode. Fun stuff.

I think I will buy a Mi Band from dx (18 Euro)
 
Last edited by a moderator:
You could compile the Software for the Pandora, and use an Bluetooth USB-Stick directly on the Pandora.
 
Pandora has bluetooth built-in so a USB stick should not be needed.
 
But I don't know, if the Pandora supports Bluetooth 4.0. Well at least you can try it out with the built-in Bluetooth.
 
Received the mi band and just bought a cheap USB 4.0 dongle.

http://www.dx.com/nl/p/ultra-mini-bluetooth-csr-4-0-usb-dongle-adapter-black-143276#reviews

Haven't tried with the Pandora, but I am pretty sure Pandora doesn't support that. First devices with 4.0 were developed in 2012 - Pandora is from 2011.

I tried to install mibanda, pygattlib and mibui on my laptop.

mibanda and pygattlib were only possible to install in Ubuntu 14.04 using pip method - repository method kept complaining about dependencies even when I installed them. Probably because the repository is a Debian repo. There is always a risk it will not work.

Only option to install mibui is the repo method - tried pip anyway, but as I already expected it was not found. So I downloaded the source and started the main python script from command line / python mibui-service.py

The script starts chromium -> http://127.0.0.1:7154/static/index.html

I am not sure if I will ever get this working. Tons of dependencies and even if it appears to be somewhat working without the bluetooth 4.0 dongle testing I can't be sure it works.  There are a lot of comments of guys with more Python experience on bitbucket that couldn't get it to function correctly.

So for now I would not recommend anyone buying it if you don't have an Android 4.3 - 4.4 or IOS device. My asus memo pad tablet is shipped with Android 4.2 and no custom rom available.  
 
Last edited by a moderator:
Jeah I also thought about that but Bluetooth 4.0 and Pandora.. I just wasn´t sure about that. I have a Mi-Band since February or so, but I use it with my Blackberry Q5 :D

I also thought about Bluetooth Heart rate sensors and things like that, why not make a Pandora a Fittnes tracker... but then again to less time and to less knowledge :(
 
Try using .next (AKA Pyra OS) maybe it'll work then!

As far as I have understood .next is not ready for Pandora yet, but maybe I am wrong (I am not following the Pyra development closely). If you can provide a link to the latest Pandora image I can use I will certainly try it out. Did some searching, but couldn't find a Pandora image.

BTW - changing bluetooth to 4 will probably be only possible by a hardware update. I don't think it can be done by software only.
 
This MI-band is interesting.

I tryed to build the lib pygattlib with codeblocks and wxpython...but failed in some file of bluez that requiring uint128 that is not defined/available on Pandora or ARM devices...or maybe i can't be able to find a way to compile it.
 
Wow, uint128?! That's a large thing, and defently not defined here (isn't this kind of data only used on SSEx thingy?).
 
This MI-band is interesting.

I tryed to build the lib pygattlib with codeblocks and wxpython...but failed in some file of bluez that requiring uint128 that is not defined/available on Pandora or ARM devices...or maybe i can't be able to find a way to compile it.
I didn't need to install uint128 on ubuntu. Maybe it is part of the bluez package and indeed missing for arm. I didn't find it searching for it in synaptic. 

Nice to see some developers interest - this is probably beyond my skill set to solve so any help is appreciated. 
 
Oh.. always nice to publicly show my lack of knowledge. Luckily this community is not jam-packed with IT professionals so nobody will notice :) Anyway, thanks for the info.

I just found an open source android app "gadgetbridge" that is very actively being developed for the mi band and pebble. https://github.com/Freeyourgadget/Gadgetbridge

Unfortunately needs android 4.4 as well.  
 
Last edited by a moderator:
Played around with virtualbox today and installed android 4.4 http://www.howtogeek.com/164570/how-to-install-android-in-virtualbox/

Due to a kernel panic I needed to start the image with cpuidle.off=1 and took some time to get my old bluetooth 2 dongle working in android. Got it working and was able to install android 4.4 and gadgetbridge. It couldn't find / pair with the mi band but that is probably because it needs the bluetooth 4 dongle. Tested bluetooth connection with my N900 phone and Android paired fine so everything is working fine.

Will probably take another two weeks for the bluetooth 4 dongle to arrive and to be able to test the mi band with Android, Ubuntu and Debian on one of my Pandora's.  
 
Last edited by a moderator:
Received  the USB dongle today - I managed to get the MI band working with android 4.4 in Virtualbox with the Mi Fit app . It crashed a lot though - not sure what the reason was. Needed to restart the android image a few times.  I installed this version http://en.miui.com/thread-53761-1-1.html 

Just noticed there is a newer version http://en.miui.com/thread-110066-1-1.html

Gadgetbridge found my mi but couldn't connect.

Steps seem to be working fine - not really interested in that though - will try out the sleeping functionality tonight.  I will test functionality on Ubuntu and Pandora later wanted to know first if I could get it working with the official app.
 
Back
Top