{"id":840,"date":"2012-04-05T23:05:20","date_gmt":"2012-04-05T22:05:20","guid":{"rendered":"http:\/\/six40winks.com\/?p=840"},"modified":"2012-04-05T23:05:20","modified_gmt":"2012-04-05T22:05:20","slug":"day-2829-zeo-mobile-programming","status":"publish","type":"post","link":"https:\/\/six40winks.com\/?p=840","title":{"rendered":"Day 28\/29  &#8211;  Zeo Mobile Programming"},"content":{"rendered":"<p><strong>Warning!<\/strong>\u00a0<strong> Geek post!<\/strong> If you&#8217;re not interested in the tech side of measuring sleep, just scroll to the bottom for todays sleep graphs.<\/p>\n<p>It&#8217;s been very frustrating to find out that the very tool I bought to track my whole experiment didn&#8217;t have the option to track naps.\u00a0 Instead it records naps and core sleep\u00a0 but then &#8220;forgets&#8221; all the naps.\u00a0 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.<\/p>\n<div id=\"attachment_1042\" style=\"width: 290px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/P2283816-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1042\" class=\" wp-image-1042 \" title=\"sleeping with zeo and fitbit\" src=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/P2283816-1.jpg\" alt=\"picture of me sleeping with zeo and fitbit sensors\" width=\"280\" height=\"368\" srcset=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/P2283816-1.jpg 400w, https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/P2283816-1-228x300.jpg 228w\" sizes=\"auto, (max-width: 280px) 100vw, 280px\" \/><\/a><p id=\"caption-attachment-1042\" class=\"wp-caption-text\">sleeping with zeo and fitbit to track movement and brainwaves<\/p><\/div>\n<p>So if I do Everyman today with <strong>3h30 <\/strong>(core sleep)<strong> &#8211; 22m <\/strong>(nap)<strong> &#8211; 29mn <\/strong>(nap)<strong> -25mn <\/strong>(nap), synchronise with the <a title=\"my sleep, my zeo\" href=\"http:\/\/mysleep.myzeo.com\/\">mysleep.myzeo<\/a> site, and look at the statistics online, it will only display the <strong>3h30<\/strong> sleep.\u00a0 There&#8217;s an option to download the data as a <a title=\"comma separated value or CSV\" href=\"http:\/\/en.wikipedia.org\/wiki\/Comma-separated_values\" target=\"_blank\" rel=\"noopener\">CSV<\/a> file, but when you look inside only the <strong>3h30<\/strong> episode appears.<\/p>\n<p>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.\u00a0 To the company&#8217;s credit the bedside version allows one to track the naps after <a title=\"zeo viewer\" href=\"http:\/\/zeodecoderview.sourceforge.net\/starting.html#firmware\" target=\"_blank\" rel=\"noopener\">some tweaking<\/a> (update the firmware, install some software, reset the SD card).\u00a0 There&#8217;s even the option to access the raw data but it requires <a title=\"hacking for zeo Raw Data\" href=\"http:\/\/zeorawdata.sourceforge.net\/starting.html\" target=\"_blank\" rel=\"noopener\">some hacking<\/a> (update firmware, rewire serial cable, and use the <a title=\"zeo raw data library\" href=\"http:\/\/zeorawdata.sourceforge.net\/\" target=\"_blank\" rel=\"noopener\">ZeoRawData Library<\/a> with a bunch of dependencies).\u00a0 However the product I have (and I suspect a lot of people too) is the cheaper more convenient version:\u00a0 The Zeo Mobile, with no serial cable, SD card or RawData Library.<\/p>\n<p>The company does have a good track record of respecting privacy and being open (sharing code and specifications) &#8230; even if they are sometimes slow to reply on the forums or add features.\u00a0 So I thought I&#8217;d try to hack the mobile to access and process my own data.\u00a0 Here is the process I followed in my 1st attempt:<!--more--><\/p>\n<p>(1) Browse the <a title=\"zeo forums\" href=\"http:\/\/www.myzeo.com\/sleep\/zeo-mobile-data-access\">Zeo forums<\/a>. Aha! a Mobile API!<\/p>\n<p>(2)\u00a0 Go to Github&#8217;s <a title=\"open zeo mobile API\" href=\"https:\/\/github.com\/zeoeng\/zeo-android-api \">Open Zeo &#8211; Android Mobile data API<\/a>, scan the README.rst diagonally.\u00a0 Hum &#8230; not sure what he&#8217;s talking about.\u00a0 Maybe this German at <a title=\"schlaf hacking\" href=\"http:\/\/www.schlafhacking.de\/blog\/?p=19\">schlafhacking.de<\/a>?\u00a0 What? <em>4C:98:EF:00:1E:E5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 clock offset: 0x026f\u00a0\u00a0\u00a0 class: 0\u00d7080700<\/em> and then some <em>00000000-deca-fade-deca-deafdecacaff<\/em> &#8230;. What the heck is he talking about?\u00a0 Ok, back to Github. Let&#8217;s look at the <a title=\"demo sleep zeo\" href=\"https:\/\/github.com\/zeoeng\/zeo-android-api\/tree\/master\/demos\/zeo-sleep-csv\">demos<\/a>.\u00a0 Hum &#8230; I&#8217;ve never seen this kind projects full of &#8230;\u00a0 .xml, .ant, .cfg, .properties.\u00a0\u00a0 All right, all right &#8230; I give up:\u00a0 I will read the <a title=\"read me\" href=\"https:\/\/github.com\/zeoeng\/zeo-android-api\/blob\/master\/README.rst\" target=\"_blank\" rel=\"noopener\">README file<\/a>!<\/p>\n<p>(3) It seems I have to create an Andoid App of my own which piggybacks on the libraries from Zeo.\u00a0 That&#8217;s a whole new and different <a title=\"kettle of fish\" href=\"http:\/\/www.worldwidewords.org\/qa\/qa-ket1.htm\">kettle of fish<\/a>!\u00a0 I&#8217;ve never made an android app or programmed in Java for that matter. So on to the <a title=\"Android reference library\" href=\"http:\/\/developer.android.com\/guide\/developing\/projects\/projects-eclipse.html#ReferencingLibraryProject\" target=\"_blank\" rel=\"noopener\">Android Developer Docs<\/a>.<\/p>\n<p>(4) WHAT?\u00a0 I have to use the <a title=\"Eclipse IDE\" href=\"http:\/\/www.eclipse.org\/\" target=\"_blank\" rel=\"noopener\">Eclipse IDE<\/a> instead of my beloved Emacs.\u00a0 Let&#8217;s ask <a title=\"stackoverflow\" href=\"http:\/\/stackoverflow.com\/questions\/5045025\/android-development-without-using-eclipse\">stackoverflow<\/a>, <a title=\"emacs android\" href=\"http:\/\/code.google.com\/p\/gshengji\/wiki\/EmacsConfig\">google code<\/a>, <a title=\"elipse android emacs\" href=\"http:\/\/ubuntuforums.org\/showthread.php?t=1727861\">Ubuntu Forums<\/a>.\u00a0 They recommend ECB. What is ECB? <a title=\"ECB emacs\" href=\"http:\/\/ecb.sourceforge.net\/\">OK<\/a>.\u00a0 Well, it seems developing Android apps without Elipse is pretty painful.\u00a0 Even &#8220;<a title=\"hello world\" href=\"http:\/\/developer.android.com\/resources\/tutorials\/hello-world.html\">Hello World<\/a>&#8221; is plagued with Elipse dependencies.<\/p>\n<p><em>It&#8217;s 5am &#8230; my eyes are getting tired.\u00a0 Let&#8217;s shave, wash my face and come back.<\/em><\/p>\n<p>Ok.\u00a0 One nap later, after installing and testing Elipse a little I decided to step back.\u00a0 <strong>It&#8217;s 7:30am<\/strong>.\u00a0 I&#8217;ll contact the developer on GitHub and ask for advice before diving into a new Android App.<\/p>\n<p><strong>12h and one nap later<\/strong>\u00a0 &#8230;\u00a0 he sent a very prompt and friendly reply. It is possible.\u00a0 A tutorial to install the Android SDK and JDK will be left for another post.\u00a0 Below is the sleeping data for today and yesterday:<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>(<strong>2012\/04\/04<\/strong>, (3:15,7, &#8220;well awake, working&#8221;), (4:50,7,&#8221;aware, email, code&#8221;), (5:45,6,&#8221;a little drowsy&#8221;), (5:56, 6.5,&#8221;eat, move, back&#8221;), (7:08, 6, &#8220;yawn&#8221;), (7:11,5,&#8221;bedtime&#8221;), (7:45,5,&#8221;temptation to snooze&#8221;),(7:50,7.5,&#8221;well rested, nice REM&#8221;))<br \/>\nHigh energy levels all day.\u00a0 2nd nap at 13h, 3rd nap at 19h &#8230; tired after 22h30.\u00a0 Probably doing so well because the day before I did around 6h of sleep.<\/p>\n<div id=\"attachment_1059\" style=\"width: 814px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120404_core_hypnogram-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1059\" class=\"size-full wp-image-1059\" title=\"sleeping data from zeo in an everyman sleep schedule with 3 naps\" src=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120404_core_hypnogram-1.png\" alt=\"sleeping data from zeo in an everyman sleep schedule with 3 naps\" width=\"804\" height=\"138\" srcset=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120404_core_hypnogram-1.png 804w, https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120404_core_hypnogram-1-300x51.png 300w, https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120404_core_hypnogram-1-768x132.png 768w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><\/a><p id=\"caption-attachment-1059\" class=\"wp-caption-text\">sleeping data in everyman sleep schedule for April 4th 2012<\/p><\/div>\n<p>(<strong>2012\/04\/05<\/strong>, (3:35,4, &#8220;eyes more irritated than yesterday&#8221;), (4:25,4.5,&#8221;very tired, sandy eyes&#8221;), (5:10,5,&#8221;more sleepy than normal. hard to keep eyes open&#8221;), (5:15,4,&#8221;nod off&#8221;), (5:25,5), (5:30,6,&#8221;standing in kitchen to stay awake&#8221;),(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))\u00a0 Clearly not adapted.\u00a0 Unfortunately this week I need to work from the sofa (<em>visitors in the house<\/em>) .\u00a0 To avoid falling asleep I had to abandon the sofa and sit at our uncomfortable kitchen chairs.\u00a0 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\u00a0 so I had to skip that nap. This made me extremely tired after 22h.<\/p>\n<div id=\"attachment_1063\" style=\"width: 772px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120405_core_hypnogram-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1063\" class=\"size-full wp-image-1063\" title=\"sleeping phases measured with zeo with REM, light, deep, sleep\" src=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120405_core_hypnogram-1.png\" alt=\"sleeping phases measured with zeo with REM, light, deep, sleep\" width=\"762\" height=\"140\" srcset=\"https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120405_core_hypnogram-1.png 762w, https:\/\/six40winks.com\/wp-content\/uploads\/2012\/04\/20120405_core_hypnogram-1-300x55.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/a><p id=\"caption-attachment-1063\" class=\"wp-caption-text\">sleeping phases for April 5th 2012<\/p><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning!\u00a0 Geek post! If you&#8217;re not interested in the tech side of measuring sleep, just scroll to the bottom for todays sleep graphs. It&#8217;s been very frustrating to find out that the very tool I bought to track my whole &hellip; <a href=\"https:\/\/six40winks.com\/?p=840\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1042,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5,7,8,13,15],"tags":[20,30,32,48,50,73,74,133,177,178,179,180,186,187],"class_list":["post-840","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code","category-fitbit","category-log","category-measurement","category-schedule","category-zeo","tag-11-10","tag-android","tag-api","tag-coding","tag-complaint","tag-hack","tag-hacking","tag-programming","tag-ubuntu","tag-ubuntu-10-11","tag-ubuntu-11-10","tag-useability","tag-zeo","tag-zeo-mobile"],"_links":{"self":[{"href":"https:\/\/six40winks.com\/index.php?rest_route=\/wp\/v2\/posts\/840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/six40winks.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/six40winks.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/six40winks.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/six40winks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=840"}],"version-history":[{"count":0,"href":"https:\/\/six40winks.com\/index.php?rest_route=\/wp\/v2\/posts\/840\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/six40winks.com\/index.php?rest_route=\/wp\/v2\/media\/1042"}],"wp:attachment":[{"href":"https:\/\/six40winks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/six40winks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/six40winks.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}