Project 2: beyond metrics

ah42

The above image is known as the data pyramid. raw data is held at the bottom, the stuff that can be collected from the environment. Up at the very top lies choice, making a decision based on the data, information and knowledge presented with.

Tasked with collecting personal data with the intention to later induce a change in habit, I listed many types of metrics that I could collect.

  • number of times I sit down
  • hours spent vs standing vs walking
  • number of times I eat
  • number of times i move my jaw per day
  • number of breaths i take in a day
  • how many times I check facebook
  • number of conversations per day
  • number of tabs that I open
  • number of times I pick my nose
  • number of times I bite my fingernails
  • money spent/day
  • number of yawns
  • The status of my poop
  • emotional state at a given moment
  • stress level at a given moment
  • hours spent inside vs outside

The list continues, but those were a few of the many. Of that list, I chose to collect the number of conversations I have per day because I felt it had greater personal significance to myself. I feel as if I don’t talk that often, but was curious to find out how many times I actually strike up a conversation on a given day. With the behavior psychologist, Pavlov in mind, I thought I’d attempt to change my conversation behavior.

IMG_1911

IMG_1935

I created a simple wrist bracelet that I could log conversations with by marking it with a pen. This method was semi-effective, though definitely not the most accurate way to collect the data because it relied on me first, having a pen on hand at all times, second on me actively pulling out the pen mid conversation to mark it, and third on making the band every day(it disintegrated in the shower on the second day). But it more or less got the job done and I was able to see fluctuations in the amount of conversations I had over the course of a week.

Project 1: Testing R820T dongle w/ Pi Again

I was able to get the program to run on the raspberry pi after finding a very helpful google groups thread on this error:

Kernel driver is active, or device is claimed by second instance of librtlsdr.
In the first case, please either detach or blacklist the kernel module
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time.

SUPER HELPFUL!
Dongle connection error solved: claimed by second instance of librtlsdr

I typed:

sudo rmmod dvb_usb_rtl28xxu

and it unmounted the dvb portion of the dongle, or whatever was preventing it from connecting in the first place.

Im also using a slightly different dongle:
KEEDOX® RTL-SDR, FM+DAB, DVB-T USB Stick Set with RTL2832U & R820T.

Additionally I installed all of the neccessary libraries/dependancies for aplay to work (which is absolutely a must because it is used to process the radio real time and output audio).

full install guide here.

The ALSA utilities:
sudo apt-get install alsa-utils

MP3 tools:
sudo apt-get install mpg321

WAV to MP3 conversion tool:
sudo apt-get install lame

Also set the audio to analog output because I was using headphones:
sudo amixer cset numid=3 1

I tuned to the station suggested by http://sdr.osmocom.org/trac/wiki/rtl-sdr
rtl_fm -f 96.3e6 -M wbfm -s 200000 -r 48000 – | aplay -r 48k -f S16_LE

CPU is running below 30% while listening.

Project 1: using the R820T SDR & DVB-T dongle on Mac OSX

Setting up the R820T SDR usb dongle on a mac is relatively straight forward thanks to the hard work of Alain de Carolis who neatly packed all the dependancies and libraries into a DMG, ready to use out of the box (sort of). With this program there is also a small issue when hooking up the R820T. After opening up the server connection upon launching GNU Radio – borip_server, and subsequently running HDSDR, you need to change the device hint to RTL, not RTL e4k. Unfortunately, this failed the second time launching the program so I was forced to reinstall the DMG and go through the same process.

After getting the program to succesfully connect with the dongle, some noise should be heard. No official documentation has been put out by HDSDR, but because it is a free, open source software, there is a community built up around it to support. I went through this documentation and watched a few youtube videos. The program itself is fairly straight forward and the documentation is built in a way that lets you click on any area of a screenshot to bring up its description.

In order to receive the signals, an antenna is needed. The antenna provided by the kit is a monopole antenna, but I found it to be pretty much useless. All I could receive was static noise. I even attempted hacking together a dipole antenna from RadioShack, but to no avail.
IMG_1859

IMG_1858

IMG_1859

IMG_1860

 

The next step to get a clear signal will be trying to install the libstl made by Steve-m onto my mac and run it through terminal. Updates to come.

Project 1: hooking up the R820T SDR with the Raspberry Pi (Wont work)

In order to turn the R820T into an SDR (software defined radio) device, a number of programs need to be installed on the Raspberry Pi.

First of all, git needs to be installed on Pi. An easy install onto Debian can be done through terminal by typing in “$ apt-get install git”. If permission is denied, type “$ sudo apt-get install git” to initialize as superuser, which essentially overrides all permission.

Before jumping in, I wanted to learn what all these commands were, specifically “make”. I learned that make has a long history in linux. It is essentially a package compiler and installer. After downloading a repo, make must be used to build the app out. A great intro to make is here.

Also, before starting, its a good idea to update Raspbian with “sudo apt-get update” and after that, type: “sudo aptget install cmake buildessential pythonpip libusb1.00dev pythonnumpy git”

This will install the libusb repo, which to my understanding is what allows communication with the dongle.

After that, I followed adafruit’s installation commands for the stl-sdr library for interfacing with the dongle. The library they suggested to clone is:
In a fresh terminal window, type these commands exactly.
cd ~
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
make
sudo make install
sudo ldconfig

After that is installed, it is important to copy the rtl-sdr.rules file to /etc/udev/rules.d
I did this by opening up a terminal window from the rtl-sdr folder and typing: “sudo cp -i rtl-sdr.rules /etc/udev/rules.d”. The cp command takes two inputs, the file you wish to copy, followed by the directory path you wish to paste it to.

Finally, to test the R820T usb dongle. In a fresh terminal window, type sudo rtl_test -t. Theoretically, this should open up a connection with the dongle and start spitting out a frequency or at least show some data. Unfortunately for me, this was not the case. Instead I recieved a nasty error. It successfuly found the device, but it gave me a “usb_claim_interface error -6” and the device fails to open.

A great conversation about this issue is found on a post to hamradioscience.com. The specific thread is here.

When using the R820T, people consistently reported having the same issue. Some people suggest using an externally powered usb port, because the dongle may draw to much energy from the Pi.

Alternatively, I tried installing a fork of the original library that is more up-to-date. Unfortunately, this didn’t solve anything. It seems to be a hardware problem.

TL;DR The R820T dongle wont work on the Raspberry Pi unless it is externally powered (i have yet to test that, so i cannot confirm). Instead, people suggest using the 2832u E4000 chip, which is, unfortunately, not as finely tunable as the R820T. Hopefully someone will find a fix for this.