picture of me sleeping with zeo and fitbit sensors

Day 28/29 – Zeo Mobile Programming

| 12 Comments

Warning!  Geek post! If you’re not interested in the tech side of measuring sleep, just scroll to the bottom for todays sleep graphs.

It’s been very frustrating to find out that the very tool I bought to track my whole experiment didn’t have the option to track naps.  Instead it records naps and core sleep  but then “forgets” all the naps.  In particular the nap information stays on the phone but when all sleep episodes are uploaded to the myzeo site only the longest sleep in 24h is saved.

picture of me sleeping with zeo and fitbit sensors

sleeping with zeo and fitbit to track movement and brainwaves

So if I do Everyman today with 3h30 (core sleep) – 22m (nap) – 29mn (nap) -25mn (nap), synchronise with the mysleep.myzeo site, and look at the statistics online, it will only display the 3h30 sleep.  There’s an option to download the data as a CSV file, but when you look inside only the 3h30 episode appears.

Obviously this is pretty annoying, as the whole point of using ZEO-mobile to track polyphasic sleep is to study the structure of the naps.  To the company’s credit the bedside version allows one to track the naps after some tweaking (update the firmware, install some software, reset the SD card).  There’s even the option to access the raw data but it requires some hacking (update firmware, rewire serial cable, and use the ZeoRawData Library with a bunch of dependencies).  However the product I have (and I suspect a lot of people too) is the cheaper more convenient version:  The Zeo Mobile, with no serial cable, SD card or RawData Library.

The company does have a good track record of respecting privacy and being open (sharing code and specifications) … even if they are sometimes slow to reply on the forums or add features.  So I thought I’d try to hack the mobile to access and process my own data.  Here is the process I followed in my 1st attempt:

(1) Browse the Zeo forums. Aha! a Mobile API!

(2)  Go to Github’s Open Zeo – Android Mobile data API, scan the README.rst diagonally.  Hum … not sure what he’s talking about.  Maybe this German at schlafhacking.de?  What? 4C:98:EF:00:1E:E5       clock offset: 0x026f    class: 0×080700 and then some 00000000-deca-fade-deca-deafdecacaff …. What the heck is he talking about?  Ok, back to Github. Let’s look at the demos.  Hum … I’ve never seen this kind projects full of …  .xml, .ant, .cfg, .properties.   All right, all right … I give up:  I will read the README file!

(3) It seems I have to create an Andoid App of my own which piggybacks on the libraries from Zeo.  That’s a whole new and different kettle of fish!  I’ve never made an android app or programmed in Java for that matter. So on to the Android Developer Docs.

(4) WHAT?  I have to use the Eclipse IDE instead of my beloved Emacs.  Let’s ask stackoverflow, google code, Ubuntu Forums.  They recommend ECB. What is ECB? OK.  Well, it seems developing Android apps without Elipse is pretty painful.  Even “Hello World” is plagued with Elipse dependencies.

It’s 5am … my eyes are getting tired.  Let’s shave, wash my face and come back.

Ok.  One nap later, after installing and testing Elipse a little I decided to step back.  It’s 7:30am.  I’ll contact the developer on GitHub and ask for advice before diving into a new Android App.

12h and one nap later  …  he sent a very prompt and friendly reply. It is possible.  A tutorial to install the Android SDK and JDK will be left for another post.  Below is the sleeping data for today and yesterday:


 

(2012/04/04, (3:15,7, “well awake, working”), (4:50,7,”aware, email, code”), (5:45,6,”a little drowsy”), (5:56, 6.5,”eat, move, back”), (7:08, 6, “yawn”), (7:11,5,”bedtime”), (7:45,5,”temptation to snooze”),(7:50,7.5,”well rested, nice REM”))
High energy levels all day.  2nd nap at 13h, 3rd nap at 19h … tired after 22h30.  Probably doing so well because the day before I did around 6h of sleep.

sleeping data from zeo in an everyman sleep schedule with 3 naps

sleeping data in everyman sleep schedule for April 4th 2012

(2012/04/05, (3:35,4, “eyes more irritated than yesterday”), (4:25,4.5,”very tired, sandy eyes”), (5:10,5,”more sleepy than normal. hard to keep eyes open”), (5:15,4,”nod off”), (5:25,5), (5:30,6,”standing in kitchen to stay awake”),(6:00,6.5),(7:30,6.5),(8:00,6),(9:00,7),(12:00,7.5),(19:30,7.5),(20:30,7),(21:00,6),(22:00,5),(22:30,4))  Clearly not adapted.  Unfortunately this week I need to work from the sofa (visitors in the house) .  To avoid falling asleep I had to abandon the sofa and sit at our uncomfortable kitchen chairs.  Later in the day, with the excitement of reading and organizing a trip I forgot about the 17h or18h nap only to realize at 19h. By that time I had agreed with our family guests to go out for dinner  so I had to skip that nap. This made me extremely tired after 22h.

sleeping phases measured with zeo with REM, light, deep, sleep

sleeping phases for April 5th 2012

 

Author: alvaro

A scientist, entrepreneur and wannabe polyphasic sleeper

12 Comments

  1. Pingback: Everyman3 / Day 7 – Back on track | Uberman Experiment

  2. Hi Alvaro,

    So, how did you end up doing it? Were all of the days you tracked before this and plotted in these posts tracked without the hack mentioned here? A buddy of mine is trying to do the same thing as you with short naps.

    Cheers,
    Nevin

  3. Hi Nevin,

    Yes … all the days up to a couple of weeks ago are tracked with zeo and then the graphs are painfully copy pasted :-/

    A couple of weeks ago I managed to build an android app with the help of a developer and I’ve been able to pull all the data out of the phone. You can find it in the Data Page. It contains about 386 naps and core sleeps. Now I need to clean it up and make some statistics.

    I’ve also been very busy with my own web startup, so the blog is a little delayed but I’ll make a post explaining how to pull out the data, post the code on github and possibly create an Android app for those wanting to avoid the hassle. Is that something that would interest you and your buddy?

  4. Well, I’m not his buddy, but I was actually just about to post a very similar question. So I’d love to get a copy of the app (apk preferred, rather than going through the market) to be able to get this kind of info and keep it for reference when I do my transition (probably going to start in a few weeks).
    Thanks!

    • Hi Anonymous,

      It did take me a good amount of effort to solve the problem, so I’ll probably sell the app on the android store. However, if you prefer to generate the apk yourself you can find the code on github,
      https://github.com/alphydan/zeo-android-csv

      • Awesome, thanks! In my particular case we ended up using a Zeo Bedside for our current experiment, but I’m guessing there are many others who would enjoy that detail post, and we may indeed use the Android code you posted in the future.

        Cheers!
        Nevin

  5. Seems like a strange choice if you’re going to opensource it (which I, at least, greatly appreciate), but who am I to argue? I’ve now got a built apk, so it’s all the same to me. 🙂

    One final question: How does one use it? I see a list of what I believe to be all of my sleep history, that I’m guessing I can email to myself or copy somewhere. Since I haven’t started napping yet, I’m not sure if I’d have to run it after every nap, or just every once in a while. I’m also not sure if there’s some trick you have to getting it into the pretty graphs (or if that’s still manual), or perhaps if I’m missing something else.

    Thanks again!

  6. Hi Anon, there’s two simple reasons to open source it:

    1. Open source code has helped me do a million things, for free. And I’m grateful for that. To those who can code, I give this freely as a little thank you.

    2. Someone may wish to add some features, expand the supported devices, etc … so pull requests are welcome.

    Most other people can’t be bothered to install eclipse, sort out the conflicting libraries, troubleshoot, compile, etc, etc … so they can download an app on the store (if zeo agrees to it).

    Concerning your second question, the app is still very rough around the edges. Every few months (or weeks, or whatever you want) you can open the app, press “Share” and send it to yourself by email (or any other sharing application). That’s all it does. No graphs, no statistics, … only a long file with all the sleeping episodes and their data. (you can check out what 350 sleeping episodes look like here: [CSV file])

  7. Pingback: Mobile napping | Momanimusic

  8. Yay!!! I’m downloading the app you made. Thanks so much!!!!!

  9. Chelsey… where you got it from ? Where’s the link ?
    M.

  10. Hey Mark,

    You actually need to compile the source-code from the repository, https://github.com/alphydan/zeo-android-csv
    Otherwise, maybe I can find a compiled version, but I don’t have much time at the moment.

Leave a Reply

Required fields are marked *.