======Project: Zeo Sleep Manager====== A project for HPC by Kyle during Fall 2014 - Ongoing. =====Background===== With my constant struggles for energy and focus, it's important I get a great night's rest. Matt offered me a chance to borrow his spare Zeo Sleep Manager, a discontinued sleep monitoring product made by Zeo, Inc. in 2011. The now defunct company had released a special open firmware allowing users to grab raw data from its serial port, and a library to utilize this data. =====Objectives===== My goal is to improve my quality of sleep by gathering and interpreting the data being output by this device and utilizing the tools Matt had previously made. I would also like to document the steps needed to do this, so that others may do so in the future. =====Prerequisites===== ===Flashing the Zeo Sleep Manager=== Zeo, Inc. released two different open firmware versions as they went out of business, 2.6.3**O** and 2.6.3**R**. 2.6.3**O** outputs unencrypted data to the onboard SD card. In order for this to work, previously encrypted data must be removed from the SD card. 2.6.3**O** outputs data in the same manner as the Zeo used to operate, when data was then uploaded to the Zeo site. This data is output in large intervals, seemingly at least a minute to 5 minutes between readings. 2.6.3**R** is the more interesting firmware and the firmware I'll be using for this project. This firmware enables data output to the serial port located on the back of the device. This data is output every second, making the Zeo a live brain-monitoring device. To read data from this port to your computer you will need a serial to USB adapter. To flash the device with the desired firmware, perform the following. - Put the .img file on the Zeo's SD card - Press the Settings button - Press the Right button 8 times to show the software version - Press the Down button to load the new firmware - Erase the SD card using the Zeo ===Connecting to the Zeo Sleep Manager=== To read from the Zeo's serial port, I'm using [[http://www.amazon.com/gp/product/B006JKNWLE/|this]] serial to USB adapter, however a [[http://www.sleepstreamonline.com/rdl/starting.html#interface-cable|modified FTDI cable]] or similar device should work fine. Located on the back of the Zeo you will find a small door directly to the right of the power adapter port. Remove the door to expose the 5 pins inside. {{:user:klockwo1:portfolio:zeoback.jpeg?nolink&400|}} Once removed, you should see these pins, labeled below. {{:user:klockwo1:portfolio:zeopins.jpeg?direct&500|}} - Rx (receive - unused for now) - Tx (transmit - data out) - Gnd (ground) - DTR (unused, can put Zeo in flash programming mode) - Vcc (3.3v power from Zeo) Currently, only the Tx and Gnd pins need to be connected to the serial adapter, but in case the Rx is ever enabled I have it connected as well. Here is the pinout of the serial adapter. {{:user:klockwo1:portfolio:adapterpins.jpeg?direct&500|}} Using the jumper wire included with the adapter I've hooked up the Zeo to the adapter. * Zeo Tx -> Adapter TXC * Zeo Rx -> Adapter RXC * Zeo Gnd -> Adapter GND {{:user:klockwo1:portfolio:adapterconnected.jpg?direct&300|}} {{:user:klockwo1:portfolio:zeoconnected.jpg?direct&300|}} =====Scope===== Give a general overview of your anticipated implementation of the project. Address any areas where you are making upfront assumptions or curtailing potential detail. State the focus you will be taking in implementation. =====Attributes===== State and justify the attributes you'd like to receive upon successful approval and completion of this project. * attribute1: why you feel your pursuit of this project will gain you this attribute * attribute2: why you feel your pursuit of this project will gain you this attribute * etc... =====Procedure===== The actual steps taken to accomplish the project. Include images, code snippets, command-line excerpts; whatever is useful for intuitively communicating important information for accomplishing the project. =====Code===== Upon completion of the project, if there is an applicable collection of created code, place a copy of your finished code within blocks here. /* * hello.c - A sample "Hello, World!" program * * written by NAME for COURSE on DATE * * compile with: * gcc -o hello hello.c * * execute with: * ./hello */ #include int main() { printf("Hello, World!\n"); // Output message to STDOUT return(0); } =====Execution===== Again, if there is associated code with the project, and you haven't already indicated how to run it, provide a sample run of your code: lab46:~/src/cprog$ ./hello Hello, World! lab46:~/src/cprog$ =====Reflection===== Comments/thoughts generated through performing the project, observations made, analysis rendered, conclusions wrought. What did you learn from doing this project? =====References===== In performing this project, the following resources were referenced: * URL1 * URL2 * URL3 (provides useful information on topic) * URL4 Generally, state where you got informative and useful information to help you accomplish this project when you originally worked on it (from Google, other wiki documents on the Lab46 wiki, etc.)