Saturday, October 12, 2019

accessing CMS 50D+ using Python on Ubuntu linux



https://www.tranzoa.net/~alex/blog/images/Communication%20protocol.pdf

********************

https://github.com/paulvangentcom/heartrate_analysis_python
https://python-heart-rate-analysis-toolkit.readthedocs.io/en/latest/

********************

https://www.atbrask.dk/?p=244
https://github.com/atbrask/CMS50Dplus

git clone https://github.com/atbrask/CMS50Dplus.git
sudo python3 cms50dplus.py LIVE /dev/ttyUSB0 foo.csv

$ head foo.csv
"Time","PulseRate","SpO2","PulseWaveform","BarGraph","SignalStrength","Beep","FingerOut","Searching","DroppingSpO2","ProbeError"
"2019-10-13 00:48:55.022638",0,0,0,1,4,False,False,True,False,False
"2019-10-13 00:48:55.039349",0,0,14,1,4,False,False,False,False,False
"2019-10-13 00:48:55.056106",0,0,0,0,4,False,False,False,False,False

$ tail foo.csv 
"2019-10-13 00:49:15.130141",79,97,37,4,5,False,False,False,False,False
"2019-10-13 00:49:15.146497",79,97,35,4,5,False,False,False,False,False
"2019-10-13 00:49:15.163291",79,97,34,4,5,False,False,False,False,False
"2019-10-13 00:49:15.179896",79,97,33,4,5,False,False,False,False,False
"2019-10-13 00:49:15.196665",79,97,32,4,5,False,False,False,False,False
"2019-10-13 00:49:15.213300",79,97,32,4,5,False,False,False,False,False

********************
https://github.com/tobac/cms50ew

git clone https://github.com/tobac/cms50ew.git
sudo -H pip3 install matplotlib pygal
sudo apt-get install bluetooth libbluetooth-dev
sudo python3 -m pip install pybluez
sudo python3 cms50ew_cli.py  live /dev/ttyUSB0 --csv tobac.csv --mpl

$ cat tobac.csv 
Time [s],Finger out,Pulse rate [bpm],SpO2 [%]
5,N,0,0
6,N,0,0
7,N,0,0
8,N,0,96
9,N,0,96
10,N,96,0
11,N,0,0
12,N,96,96

********************
https://github.com/jimmynewland/paths-up-expeditions-in-computing-ret2018


git clone https://github.com/bhpayne/paths-up-expeditions-in-computing-ret2018.git
The Python version is 2 :(
I made a bunch of changes
sudo -H pip3 install pyserial

sudo python3 read_from_1cms.py

CMS 50D+ pulse oximeter

I purchased a CMS 50D+ pulse oximeter from Amazon for $38 in 2015.

How a pulse oximeter works: https://www.howequipmentworks.com/pulse_oximeter/

USB

The first time I plugged the device into my USB port, dmesg reported the following:

[  113.192067] usb 4-1: new full speed USB device number 2 using uhci_hcd
[  113.581236] usbcore: registered new interface driver usbserial
[  113.581253] USB Serial support registered for generic
[  113.581288] usbcore: registered new interface driver usbserial_generic
[  113.581290] usbserial: USB Serial Driver core
[  113.590473] USB Serial support registered for cp210x
[  113.590511] cp210x 4-1:1.0: cp210x converter detected
[  113.700056] usb 4-1: reset full speed USB device number 2 using uhci_hcd
[  113.843245] usb 4-1: cp210x converter now attached to ttyUSB0
[  113.843265] usbcore: registered new interface driver cp210x
[  113.843267] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver


I'm not sure how to poll the saved data, or get live data from the USB device

See this analysis
https://www.tranzoa.net/~alex/blog/?p=371
and
http://www.jimmynewland.com/wp/about-jimmy/presentations/comparing-ppg-signals-open-vs-closed/
with source code
https://github.com/jimmynewland/paths-up-expeditions-in-computing-ret2018
specifically
https://github.com/jimmynewland/paths-up-expeditions-in-computing-ret2018/blob/master/cms50dplus.py

Ubuntu 

In Ubuntu, I installed SleepyHead
http://sleepyhead.sourceforge.net/wiki/index.php?title=Main_Page
http://jedimark64.blogspot.com/p/sleepyhead.html
http://sourceforge.net/projects/sleepyhead/
http://sourceforge.net/projects/sleepyhead/files/Releases/Linux/

sudo dpkg -i sleepyhead_0.9.2-1_i386.deb
SleepyHead
I can view live data and save data to file.

cd ~/Documents/SleepyHeadData/Profiles/
go into the most recent directory, ie
cd CMS50_560ee6c6

Although I am able to see the save files, they are binary and I cannot read them.
SleepyHead hits a segfault

Windows XP

The pulse oximeter came with a mini-CD with application software for Windows. I installed the SPO2 Assistant exe, which included a CP210x USB to UART Bridge Driver Installer.

Two programs are installed: "SPO2 Review v1.5" and "SPO2 manager v1.5"

"SPO2 manager v1.5" automatically saves the live data to "C:\program files\Sp02\Data" in both binary and CSV format! Yay


Monday, August 19, 2019

observations from hosting Tea with Strangers

number of participants sets the vibe

  • 1 person (plus the host) is direct and focused. There's no where to divert attention or take a break
  • 2 people (plus the host) is my ideal group size -- small enough to feel intimate, and small enough to prevent splitting conversations; large enough to allow breaks for participants
  • 3 people (plus the host) is the first group size where splitting the conversation is feasible. I find concurrent conversations distracting.

My first goal as host (usually stated explicitly at some point during the interaction) is to identify harm and address it directly. That includes both the person doing harm (intentional or unintentional) and the person being harmed.

While that criterion is necessary, it is not sufficient for me to feel I am getting value. I want to feel connection with the participants. I have a bag of tricks for building intimacy, but I feel it could be imposing (given my position of power and responsibility) on attendees to use it. 

Saturday, August 17, 2019

finding a community of people who measure meditation

https://cohack.org

tropes of perception


Here's the recurring chain of logic the lizard brain seems to engage in:
  1. I am different so I am alone
  2. I have a biological drive to connect with other people
  3. Creating and maintaining connection takes work
  4. Connection creates risk -- risk of loss; risk of rejection
  5. Risk of loss or rejection due to my badness
  6. I feel shame for my badness; I fear loss
  7. I want to minimize work and minimize risk

being authentic in interactions means finding balance

Listening to someone else present authentically is a rush. It's exciting to receive. The feeling of connection is delightful.

Being authentic when interacting with another person is difficult. The skill in describing your experience is to avoid being too generic in your descriptions of your experience, while also avoiding being too specific.

As an example of an overly specific description, "my foot feels heavy." As a listener, I probably don't care that your foot feels heavy.

While the specific description of your physical experience isn't of direct interest, what I (the listener) care about is

  1. what is your physical experience?
  2. what is your response/reaction to that felt sense?
  3. What consequence does your reaction to your own experience have on our interaction?



Monday, August 12, 2019

lessons learned from hosting a social meditation retreat at my house

Attendee behavior:
  • few will register early (weeks in advance)
  • some will register a week or two before the retreat
  • some will register a day in advance or the day of
  • some will not register (and will just show up)
  • some will register, not pay, and not show up
  • some will register, pay, and participate only part of the retreat
  • some will register in advance, pay, then not show up
I had 22 attendees Friday evening, 13 on Saturday, and 12 on Sunday.

Due in part to the above fluctuations, I bought too much food. 

The attendee fee was $75. I thought ahead and had change (many $5) since most attendees paying cash had 4x$20. Half the attendees paid using Venmo. 

The number of (facilitators, coordinators, speakers, hosts, guests) versus number of attendees is an important ratio since costs is bore by attendees and not all will be able to pay.  With 13 participants, I collected money from 6 people.

Refunding people who had paid and then didn't participate further decreased money available for food.

The speaker was ok with any amount of money paid. After paying him $240, then $300 was requested.


Sunday, July 28, 2019

first observations from attending skip the small talk

Demographics: 30+/-10 years old, mostly people who appeared to come alone (rather than as a group, with friends, or with a partner).

I found the environment too loud. About 50 people attended. Event lasted 7pm to 9:30pm.

There were parallels with speed dating, but at a slower pace and without the romantic intent.

Facilitator Announcements

  • Don't speak during announcements. Repeat attendees were specifically called out as they were familiar with the structure and therefore more likely to talk during announcements.
  • Thank you (the audience) for taking risk and participating with incomplete information
  • Thank the owner of the space
  • Thank helpers at the event
  • Guidance on interacting:
    • When you say or hear the phrase "I don't know" then you should wait. Give space to the speaker. This may feel awkward, but wait to see if there's more.
    • Take risks in interactions - default to sharing more. That's why people signed up
    • Avoid causing harm
    • Pause or stop as needed (eg to go to the bathroom)
    • Try saying no. No reason needed. Then the person being told no should respond with, "thanks for letting me know."
    • Observation of imperfection: acknowledge your own negative response. Respond with compassion for the imperfection

Following the announcements there were three rounds of one-on-one interaction with a random self-selected individual.

One-on-one interaction (x3)

In each interaction, there was a decision that was needed -- who talks and who listens. To decide this, the facilitator provided prompts:
  • Who has longer forearm?
  • Who has the larger hand?
These induce physical touch. They are not sexual. They are not conventional or routine physical interactions. 

Three cycles, each with a different partner, had the following phases. 
  1. Speaker speaks for three minutes; listener listens; bell sounds at 2:30 and then at 3
  2. The listener asks the speaker questions that they are interested in for 3 minutes. "Ask another question" is an acceptable response
  3. Roles reverse -- listener becomes speaker; 3 minutes
  4. The listener asks the speaker questions that they are interested in for 3 minutes
  5. Spend 5 minutes in open dialog
  6. Take 5 minutes for a bathroom break and physical reseating -- find a partner for the next cycle

Prompts for the first interaction: How are you actually doing?

Prompts for each of the following two interactions: choose from one of the following

  • Think of someone who loves you. Describe how they see you
  • Describe the kind of person you would like to be. What things are you already doing that are consistent with that version of yourself?
  • If all of your friends were to describe what you're like, what personality traits do you think most of them would agree on?
  • In what ways are you different from the way that you were five years ago?
  • Tell me about a time when you changed your opinion about something
  • What are some things you used to be afraid of that you are no longer afraid of?
  • Tell me a story about something that happened to you that changed your world view.
  • In general, what sorts of things tend to be the highlight of your week?
  • What are some things about yourself that you hope never change?
  • Tell me about one of your role models and what is it that you admire about them
  • Imagine a highlight reel of the happiest moments you've experienced in your life. Describe some of those scenes. Do you notice any patterns?
  • What is your mind gravitating towards most of these days?
  • What is a struggle you've experienced that you're grateful for in retrospect?

These questions are similar to the 36 questions for building intimacy.


After the first round, a verbal poll with participant eyes closed:
  • Raise your hand if you shared more than you should have
  • Raise your hand if you shared the right amount
  • Raise your hand if you didn't share enough
  • Raise your hand if your partner over shared
  • Raise your hand if your partner shared the right amount
  • Raise your hand if your partner didn't share enough

Closing

Green string on wrist - self reminder token


Veteran participant

Estimated 90% of participants are first timers.
Most attendees are seeking novelty and will not return again.
Why the veteran repeats the experience: for the diversity of experiences, creating relationships outside the event

questions from the veteran
  • Who are you when alone? What behaviors manifest only when you're alone?
  • How much sleep did you get?
  • What did you last eat?
The eat and sleep questions are personal, known answer, and lead to stories

Advice from the veteran

  • when to hand business card is situationally dependent
  • in mixed gendered interactions, mention in passing that I have girlfriend
claim: Academics are more comfortable going deep on a topic





    Tuesday, June 25, 2019

    template for announcing a weekend retreat

    The following is a template intended for announcing a weekend retreat.

    Hello,

    I will be hosting a weekend of social meditation <<MM-DD>> (<<DAY>>) to
    <<MM-DD>> (<<DAY>>) at <<LOCATION>> in <<CITY>>, <<STATE>>. The weekend
    will be led by <<name of facilitator>> (<<facilitator's website>>).

    Capacity is limited so please register early.
    You can register for the weekend retreat by emailing me directly
    (<<EMAIL>>).

    The cost of attending is expected to be $<<COST>>. If that cost makes the retreat less accessible for you, please pay what you can.
    Payment will be due to me the week before the retreat.

    I have Facebook event listed,
    https://www.facebook.com/events/<<EVENT ID>>/, though the official
    registration for the event is made by contacting me directly via email.
    Please let me know in your email if you have any dietary restrictions.
    Also let me know if you will need help with transportation to <<CITY>>. I will be coordinating carpooling.

    Kindly,

    <<HOST NAME>>

    Sunday, June 23, 2019

    enumerating various practices of meditation

    There are a variety of physical positions for your body to be in when meditating: laying down, seated on the floor, seated on a chair, standing. When you're in this position, what do you do?

    • Focus on breathing
    • Focus on the out breath
    • Focus on the in breath
    • Label thoughts
    • Loving kindness
    • Sensing
    • Body scan

    Wednesday, May 22, 2019

    Meditation in Plain English

    http://www.vipassana.com/meditation/mindfulness_in_plain_english.php
    'Vipassana' can be translated as 'insight', a clear awareness of exactly what is happening as it happens. 'Samatha' can be translated as 'concentration' or 'tranquility'. It is a state in which the mind is brought to rest, focused only on one item and not allowed to wander.

    http://www.vipassana.com/meditation/mindfulness_in_plain_english_3.php
    Go to a party. Listen to the laughter, that brittle-tongued voice that says fun on the surface and fear underneath. Feel the tension, feel the pressure. Nobody really relaxes. They are faking it. Go to a ball game. Watch the fan in the stand. Watch the irrational fit of anger. Watch the uncontrolled frustration bubbling forth from people that masquerades under the guise of enthusiasm, or team spirit. Booing, cat-calls and unbridled egotism in the name of team loyalty. Drunkenness, fights in the stands. These are the people trying desperately to release tension from within. These are not people who are at peace with themselves. Watch the news on TV. Listen to the lyrics in popular songs. You find the same theme repeated over and over in variations. Jealousy, suffering, discontent and stress.

    where to retreat

    http://bhavanasociety.org/retreats/
    http://pearlstonecenter.org/programs/
    https://www.karmecholing.org/programs/advanced-programs
    https://skylake.shambhala.org


    Friday, April 26, 2019

    levels of training in Shambhala

    https://shambhala.org/about-shambhala/the-shambhala-path/shambhala-training/
    https://en.wikipedia.org/wiki/Shambhala_Training
    https://shambhala.org/about-shambhala/the-shambhala-path/way-shambhala/

    Level 1 is introduction to basic goodness.
    Level 2 is the Cocoon of your own assumptions and perceptions.
    Level 3 is warrior in the world. The emergence from the Cocoon is recognized. Change can be delightful.

    Sunday, April 14, 2019

    I think it is possible to hold onto a feeling like love or compassion

    Exercise 1a: Say the word "goat" out loud a few times.
    Result: you can say the word "goat" repeatedly and thereby intentionally hold onto a verbal expression.

    Exercise 1b: Say the word "goat" in your head a few times.
    Result: you can say the word "goat" repeatedly and thereby intentionally hold onto an internalized expression.

    Exercise 2a: Tap your finger on a surface.
    Result: you can feel your finger intentionally for an arbitrary duration

    Exercise 2b: Feel your finger without moving it or touching anything.
    Result: With practice at interoception, you can feel your finger.

    The purpose of these four exercises was to demonstrate that it is possible to hold onto a thought and a felt sense. Therefore, it should be reasonable to extend the practice to emotions.

    Exercise 3a: Feel love or compassion by situational exposure
    Result: you can feel love or compassion

    Exercise 3b: Feel love or compassion by without situational stimulus.
    Result: you can feel love or compassion

    the value of a meditation retreat

    I previously described the logistics of a meditation retreat, which takes a lot of work. That work has a purpose: to minimize the cognitive and emotional processing of the retreat participants.

    A person has routines that are dealt with using patterns of behavior -- both in terms of thoughts and emotions. There are also ad hoc disruptions to the routine; these also are dealt with by the individual on a cognitive and emotional basis.

    In order to disrupt the routine, it is displaced by the retreat routine -- scheduled meals, specified meditation times. To decrease the normal disruptions, isolation is used to ensure a person can sustain focused attention.


    Monday, January 28, 2019

    paths to genuine interaction : how to interact authentically

    There exists repeatable approaches that enable interacting with other people in a genuine manner.

    "Be vulnerable" is a common refrain. There are multiple senses of vulnerable, so specifying which sense matters. Vulnerability means being exposed to risk. To illustrate various aspects, there is

    • fiscal vulnerability (risk of financial insecurity)
    • physical vulnerability (risk of being harmed)
    • computer vulnerability (risk of losing control of information and resources)
    • system vulnerability (risk of unintended access or unexpected action)
    • emotional vulnerability with oneself (risk of gaining self-knowledge?)
    • social vulnerability (risk of scaring other people off)
    In the context of genuine human interaction, emotional and social vulnerability are relevant. 

    To enable emotional and social vulnerability, feeling physically and emotionally safe is vital. 

    Genuine interaction means establishing a safe environment and communicating emotions (physical sensations, feelings) socially (with other people). 


    A second path to genuine interaction is intentionally exploring awkward now-ness with other people. 

    Examples: 
    • "What conversation would feel awkward now?"
    • "What question would feel awkward to ask now?"

    Establishing guidelines for a group focused on authentic presentation

    Context: a small group of experienced meditators met to form a new group focusing on authentic presenting.

    Below are notes I shared with the group after the discussion.


    I get value from negotiating. Negotiating is a form of communication that typically results in me better understand the person I'm negotiating with.
    Even if we take a while to get to the action of authentic presenting in a group, I'm getting pleasure from the interaction.


    What are our goals?

    * feel more self-connected and connected with others.
    * experience connectedness that results from doing hard work in the group
    * grow and improve through exposure to challenge, leading to improved
    self-understanding
    * recognize aspects of myself that I don't like and then explore how
    to relate to aspects of myself that I don't like
    * fulfill the potential of social meditation while filtering out clowns
    * relate to others in the group through consensus and negotiation [no
    facilitator/leader/teacher]
    * hold each other accountable
    * be able to question any aspect (nothing is held sacred)


    Phases of activity


    Phase: individual activity (when not in the group)

    * journaling
    * meditating

    Phase: group conversation

    * participants can write notes for themselves
    * intentionally break the conventional patterns of normal interaction,
    ie by using timers to constrain dominant participants

    Phase: authentic presenting to group

    * authentic presentation of your experience to other participants:
    present your feeling, verbal inquiry, reflective description of
    experience
    * undirected experiential-based awareness of thought, feelings,
    sensation, and other participants communicated verbally to other
    participants
    * private dyad with open-ended inquiry
    * private dyad with optional prompt
    * group circle
    * public dyad ("warrior exchange") in the circle
    * authentic presenter in the circle

    Phase: closing the group activity

    * solo meditation
    * circle harvest (verbal reflections not seeking response)

    Choreography of the practice

    * avoid constraints associated with ritual, ceremony, lineage; rely on
    communication and negotiation and consensus instead
    * avoid giving life advice to other participants
    * avoid giving advice on personal decisions of other participants
    * instead of merely expressing judgement of other participants,
    verbalize your exploration of your own experience reacting to the
    situation
    * socializing is separate from this practice
    * calling out desired behavior and undesired behavior of other
    participants is useful to the group
    * your experience is what is valid
    * communicating recommendations on participant behavior for
    consideration by the group is desirable
    * in order to have the authority needed to create accountability,
    participants need to participate in the group

    Issues to potentially discuss in the future after we have more
    experience in the group

    * finding and identifying candidate participants
    * on-boarding of new participants: how to teach the process, explain
    the reasoning, provide historical context, define jargon, negotiate
    conditions of participation