Sisyphus in Mauthausen

10

“Stairs of Death” at Mauthasen Concentration Camp

Touched by kisses,
Covered with bruises,
My body is a chain,
A snake eating its tail.

Step by step,
These endless stairs,
My life is a short sentence,
Written again and again.

Looking at a blind sun,
Talking to a deaf moon,
My tears are drops in a flood,
Evaporating before they hit the earth.

You won’t remember me,
And I don’t remember them,
The ones before and the ones after,
History, a silent heavy rock on our backs.

But I’ll live in your bones,
Sleep in your dreams,
Look through your eyes,
I’ll be the revolution under your skin.

I’ll push you forward and I’ll push you within,
Because we have to find out, we have to know,
What is on the other side of this coin, the meaning of this toil.

If we can’t ask life, let us ask death, and if he is also silent, we will ask our hearts, for they will know:
where do we come from and where will we go.

Note: I wrote this poem after visiting the Mauthausen-Gusen Concentration Camp Memorial. For more about my visit and the camp please see this post.

Advertisements

Mauthausen

The country road from Linz to Mauthausen is beautiful and peaceful. My bus stops at small villages and picks up polite and quiet passengers. The landscape is green and hilly. It is hard to imagine I am so close to a place that, for close to a 7 years, was the site of profound human suffering. I’m on my way to the Mauthausen Memorial.The Mauthausen-Gusen Concentration Camp was one of the most infamous Nazi labor camps. During its operation between 1938 to 1945 between 120’000 to 320’000 people died there.

The bus stops. I get off and follow signs up a side road. On the walk up the hill to the gate of the memorial, I pass several beautiful country houses. Later, I find out many of these were built by slave labor for the families of Nazi camp supervisors. I hear a stream flowing beside the road. The sky is grey and I can hear birds chirping before rain. I walk past a beautiful field of wheat. The stalks are dancing in the wind. I see a small red bicycle beside a farmhouse. Life goes on.

11.png

Field of wheat, close to Mauthausen Memorial

Austria’s cultural landscape is shifting. This is my second time in Linz. I first came here 6 years ago to attend the International Conference on Computers Helping People with Special Needs (ICCHP). I am attending the same conference again. Since the first time I came here, I notice many more refugees and immigrants in Linz and the villages that I pass on the way to Mauthausen. Here and there, I hear Farsi Dari (from Afghanistan) and I see a large Turkish flag on top of a cafe with mustached men sitting at the front drinking from small cups of strong tea.

I go up the country road and after a few breathtaking minutes see the camp. Mauthausen is located close to stone quarries. Linz was one of Hitler’s favorite cities and he planned to turn it into a center of Nazi culture and art. In his demented vision, his empire would last thousands of years, and so he wanted the best stones that last forever for his neoclassical imposing buildings. The camps were set here, then, as the perfect site of slave labor that would help build the empire. This changed later on and slowly even this absurd vision was lost. Towards the end of the war, the main purpose of the camp was to kill, especially Prisoners of War (POWs), through labor, deprivation and despair.

9

Mauthausen Concentration Camp Memorial

At the memorial, I join a small group of people for an English tour. Our guide is a German schoolteacher with sensitive eyes who looks a bit like Alain de Botton. His presentation is heartfelt. While he is informative and accurate, more than anything he helps us reflect:  how is this possible? He would not offer explanations for people’s motivations and a few times when people try to over simplify things, he gently reminds us that, “we don’t know”. At one point, when reading the description of the sleeping quarters, he pauses and says, “sorry, I can’t read this. Please search for it online.  This is all documented.” I appreciate his silence: this is a memorial and not a museum.

There are many questions about the people who lived in the surrounding areas. They must have known what was going on here. How could they bear it? Our guide is patient and says there was a range of responses. A few complained, some collaborated (most infamously in hunting down more than 480 Russian POWs who had escaped in what became known as the “Rabbit Hunt”) but mostly people were silent. This silence is easy to judge from a distance. A few days after my visit, I found a short video with interviews with some of the local residents years after the war and they described how they felt about living in such an infamous place. Sometimes a better choice than blaming or dismissing is to stay present.

10

Stairs of Death

We look down a high hill which is on top of the stone quarries. Prisoners were made to carry stones (sometimes as heavy as 50 kg) up a stairway infamously known as the “Stairs of Death”. Many people lost their lives here. I later walk down the steps and look at the tall silent stone wall. Sometimes prisoners were thrown off this hill to their death. Often SS officers and sometimes the kapos (prisoner functionaries who supervised other prisoners) forced the prisoners to conduct pointless exercises, such as running. Many prisoners died from exhaustion.

12

Shower Rooms – Many prisoners died of exposure while waiting stark naked and wet in the snow for “hygienic showers”

In the basement of a large building, we visit shower rooms, gas chambers, ovens. In the airless concrete rooms where many spent their last moments, I feel a profound void. Rather than the presence of evil, I feel the absence of God. A place empty of love, light, humanity. Often, people talk of the mystery of God and love, and how mystics seek to experience that. I am in the presence of another mystery, the mystery of darkness and absence of love. This mystery is also part of our existence, the other side of the coin or the shadow of our collective self. Perhaps, to really experience love, one has to experience the lack of it too.

13

Names of prisoners who died are written in the rooms where formerly bodies were kept before being burnt

Now I know why I am here. I feel an old pain deep in my heart: the pain of encountering darkness and having to incorporate it into your vision of the world. Like many others growing up in the Middle East in the 1980’s, I was exposed to war, revolution and extreme sociopolitical  pressures when I was a child. In a society where most people have experienced these, you don’t think of them as “traumatic”. They are part of “ordinary” life. I did not get exposed to the worst experiences directly: I did not see death first hand, did not get injured, did not disappear. But I was close enough to the people who did experience these to get second degree burns. The idea that people disappeared randomly and that there were other people out there who wanted to invade and kill us was a reality. I am far from being alone in these experiences and worst ones, as this memorial testifies. Everyday in different regions of the world, but especially in the Middle East as I am writing this, thousands of people face the harsh realities of violent human suffering: the darkness of lovelessness.

I survived. I grew up. I left. I forgot. Or so I thought. Years later, I still feel something painful deep inside: a hidden wound that you don’t know exists but hurts and makes you look for relief in the wrong places, a spell that pushes you towards an unknown point in your destiny, a quiet voice in your ear that says, “everyone you love can disappear in a moment!” These elements have created tremendous pressure in my life. Rather than making me give up, they have forced me to run forward. They have made me thirsty for life, but also afraid of disappearing. They have made me feel grateful for what I have but also afraid of losing it. And this fear is something I would like to leave at this memorial. I am tired of running and want to sit down and rest.

I start to make my way out of the memorial. I start to feel a strong bond with the people who have suffered here and with the ones who have suffered in other places and in other times: a bond of common human pain. I remember a book called “Man in the Search of Meaning” by Viktor Frankl who was a Holocaust survivor and a psychologist. Upon encountering tremendous pain and suffering, Frankl identified the search for meaning as an essential part of the human condition. Until we realize that the “unexamined life is not worth living“, we are like Sysiphus dragging the burden of our meaningless existence up the mountain of time. Perhaps our task is to face the mystery, search and find a meaning, the meaning, to our existence.

When walking in the middle of a dark cold night with sadistic guards hitting him with rifle butts, Frankl suddenly had a realization. I quote his book: “A thought transfixed me: for the first time in my life I saw the truth as it is set into song by so many poets, proclaimed as the final wisdom by so many thinkers. The truth—that love is the ultimate and the highest goal to which man can aspire. Then I grasped the meaning of the greatest secret that human poetry and human thought and belief have to impart: The salvation of man is through love and in love. I understood how a man who has nothing left in this world still may know bliss, be if only for a brief moment, in the contemplation of his beloved.” Frankl looked his heart in the face and found his meaning. In the midst of emptiness, he was able to see the one thing that was left and could not be taken away from him. I am inspired by this idea and I also realize that this meaning is something one has to find, to experience, to live, oneself:  while the “song of many poets” are previous road signs, they are not the destination or the road.

17.png

As I walk away from the gate, I come by a statue that rises out of the ground by the side of the road. A series of stone human heads are silently peering forward. They are surrounded by growing grass and small fragile flowers. Drops of rain start dropping from the sky. I continue to walk. The essence of the river is to flow.

To live is to love, to feel, to hurt, to hate, to seek, to know, and to love again.

 

 

 

 

Baking Pi’s 4: Working with Touch Pi

I have taken some time off from writing about my Raspberry Pi prototyping but I have been busy prototyping and making a GUI program for the Raspberry Pi.  I started with the wonderful Touch Pi design from the wonderful people at Adafruit that adds a Resistive Touchscreen to the Pi! I made many changes to this system which I will describe in future posts. But essentially, this is what the prototype looks like:

20160225_110925.jpg

My version of Touch Pi

So for my particular setup, where I wanted to use a large HDMI screen to write my program and then use the Touch Screen to test it, I needed to figure out a bunch of things that I will explain in this post. Please note that this is a fairly technical post that is aimed to help others who are running into similar challenges. I will have more application focused posts in the future (once I actually figure out the rest of my issues!).

For my implementation, I am using a Raspbian Jessie installation. For implementing my particular GUI (which I will discuss in a future post) I used pygame to interact both with the touch screen and the GPIO pins.

Detecting HDMI vs. Touchscreen

In any case, the first issue I had to figure out was how to automatically detect if the Pi was connected to the HDMI screen and then run the GUI from there. If an HDMI cable was not detected then I wanted the GUI to run on the touchscreen. One thing to note is to the best of my knowledge, you can’t run the GUI simultaneously on the touch screen and the HDMI TV because the system can’t handle input from two sources.

The solution I came up with involves modifying (or creating if it doesn’t exist) the rc.local file in the /etc/ folder:

cd etc

sudo nano rc.local

Then add these lines to the script:

if (/usr/bin/tvservice -s | /bin/egrep 'HDMI|DVI); then

     sudo cp /home/pi.displays/HDMI/99-fbdev.conf /etc/X11/xorg.conf.d

     con2fbmap 1 0

     echo "rc.local HDMI selected"

else

     sudo cp /home/pi/displays/TFT/99-fbdev.conf /etc/X11/xorg.conf.d

     con2fbmap 1 1

     echo "rc.local TFT selected"

fi

exit 0

Thanks to these forum discussions!

Note: This might cause a problem if you plan to use a Raspberry Pi Zero. In case your RPi Zero cannot use the display, comment out the added lines above and also copy the 99-fbdev.conf file form the HDMI folder to the X11 folder and everything should work on startup.

Starting programs on GUI startup

The next interesting challenge was to run my custom python code (or the shell script running it) on startup. I particularly wanted the program to run once the GUI is loaded. If you want your script to run at the beginning (with no graphical support), please see my previous post here.

There are many forum posts about where and how to change files to make this happen but it is important that you locate and change the right file for your particular setup. In Raspbian Jessie, you want to change the autostart file in the .config/lxsession/LXDE-pi directory:

cd .config/lxsession/LXDE-pi

sudo nano autostart

In this file you have to add your particular program path to the end of the list. So it will look something like this:

@lxpanel --profile LXDE-pi

@pcmanfm --desktop --profile LXDE-pi

@xscreensaver -no-spalsh

@lxterminal -e /home/pi/Foad/myProgramLaunch.sh

The last command specifies that I want my script to be called from a terminal. Depending on your needs you might or might not need to call from a terminal.

Making Desktop Shortcut

A final bonus tip (thanks to the information here)! If you would like to make a desktop shortcut with an icon that you can double click to start your program, you need to create a file in the Desktop directory:

cd Desktop

sudo nano mydesktop.desktop

In this file, you specify your icon, path, …:

[Desktop Entry]

Name=reMixer

Comment=This is the reMixer program

Icon=/home/pi/Foad/myProgramLaunch.sh

Type=Application

Encoding=UTF-8

Terminal=false

Categories=None;

You have to make sure that your script has execution privileges (set them with chmod) and you are set!

Thailand

Bangkok

The word “overwhelming” comes to mind when trying to describe Bangkok, and not in a bad way. There is so much to see, to taste and to think about that the city might give one a culture (and heat) shock!

The morning after I arrived in Bangkok, I walked from my hotel to a sidewalk restaurant and had a breakfast of fried rice and egg. It was excellent and invigorating with the right amount of chili to wake me up and give me strength to face the multitude of crowds that I encountered next at the entrance of Wat Phra Kaew and the Royal Palace.

IMG_20160311_153025.jpg

Ornaments at Wat Phra Kaew

Many many tour groups had lined up to get into the temple and, for a minute, I considered not going inside and heading back to the same breakfast stall for another serving of rice and some more relaxation. However, I persisted, stood in line for my tickets and walked into a stunning area that was covered in fantastic paintings, ornaments and sculptures. Given the number of people, it was hard to navigate the space and I sat on a step and read through the description in my guidebook for some, well, guidance.

IMG_20160311_152932.jpg

Mural detail, Wat Phra Kaew

Wat Phra Kaew is absolutely stunning; the buildings are beautiful and highly ornamented and the walls all around are covered in highly detailed paintings with motifs from the story of Rama and Sita. There is so much to see that one can easily spend hours just looking at the paintings. A great feature is that golden colors are incorporated into the paintings, such that they glow from a distant in the light, giving them a magical quality that is hard to describe.

The most sacred sight in the temple is the Jade Buddha. There are many stories and legends that surround this holy image and the room in which it is housed is full of praying pilgrims.

IMG_20160311_152404.jpg

Grand Palace, building with European body and Thai-style roofs

After spending a few hours in the temple I moved to the Grande Palace, which is used only for very special occasions such as coronations or royal funerals. The most interesting building for me was a large place that was built entirely in a European style but with Thai style roofs. The story being that it was designed in Europe but once the building was near to being finished the king was convinced to incorporate Thai elements into its architecture. Thus, giving it a final Thai touch.

20160308_123535.jpg

Animated story at Museum Siam

After visiting Wat Phra Kaew, I went into a small museum, Museum Siam, that was air-conditioned, full of interactive displays about the culture and history of Thailand, and specifically Bangkok, and provided a nice respite from the heat.

IMG_20160311_111939.jpg

Thai Coffees are to die for!

After this break, I had a nice Thai coffee and headed for the second temple on my schedule, the Wat Pho. This temple was much more chilled out than the first one and I found the atmosphere and many Buddha statues there relaxing. Among the statues in this temple were some Western looking characters that the guide explained might have been inspired by Marco Polo!

IMG_20160311_151743.jpg

Marco Polo as temple guardian?

As I walked around the temple, I saw a small room with the oldest inscriptions that describe the principles of Thai massage. This temple is believed to be the first place where this art and technique started to be taught and, therefore, has immense historical importance.

IMG_20160311_151701.jpg

Thai massage tablet

Given this significance, I decided to go into an on-site massage clinic and try a massage by an expert practitioner. I entered a big hall with neatly placed massage mats on the floor and many people getting Thai massages that looked more like partner Yoga poses to me. A couple of very old monks went ahead of me to get a massage. I was paired up with a polite young man and for an hour he pressed pressure points and pulled and pushed on my limbs. At times it was pretty painful but afterwards I felt much more relaxed and, how to say, fluid in my body!

After the massage, I took a commuter boat ride across the Chao Phraya River; the afternoon views were beautiful and I was starting to feel tired. As I was walking back to my hotel, I came across a university cafeteria and had a tasty salad there. People are very fond of having many small meals throughout the day in this part of the world and I had decided to follow suit!

As I walked back to my hotel, I came across a riverside park where a very energetic and small Asian lady with a big speaker system was giving group workout instructions to a similarly energetic and enthusiastic group of middle aged Asian ladies. At the back of the group an older European gentleman who looked like Bukowski in a sleeveless shirt and shorts was also following the instructions with a serious expression on his face.

Screen Shot 2016-03-26 at 4.34.37 PM.png

Many strange things can be had on Khao San Road

After getting back to the hotel and having a few lethargic resting hours, I decided to go for a little walk on the legendary Khao San Road.

The Khao San Road is legendary among travelers (especially backpackers and hippies) in Asia and … rightly so! It is a wild street full of travelers of all kinds, tourists, vagabonds, local hip Thais and everything in between walking through a street that offers many forms of (legal) worldly pleasures, from mouth-watering food (although definitely not authentic) to all kinds of drinks (and gases, laughing gas was apparently on order too!) to all kinds of BBQ’d creepy crawlies (e.g., worms, scorpions and cockroaches)! I walked down the street a couple of times and listened to the many cover bands (including an excellent Nirvana cover band) from the street and then walked back to my hotel for a sound night sleep.

In my second day in Bangkok, I continued my exploration with the usual theme of temples, museum and food. I visited Wat Saket, which is perched high on top of a hill overlooking Bangkok and has been there way before the skyscrapers started to scrape the sky!

I also visited an excellent museum called the Jim Thompson House. This is the former house of an American-born expat who was fascinated in Thai culture and single-handedly revived an appreciation for Thai silk though advocating for it New York fashion shows.

IMG_20160311_152020.jpg

Spirit House

Mr. Thompson had build his house in the original Thai style and had gathered together a very nice and eclectic collection of antiques from around the world. Among the many interesting objects in his house were a pair of astrology drawings that predicted a dangerous time for him when he turns 61. In fact, he disappeared without a trace that year when he was on an expedition in Malaysia! During the tour, I found out that it is a Thai tradition to make when a house is made, an altar be erected for the spirits who used to dwell in the land so they can move there and be happy. I saw many of these small spirit houses throughout my trip.

Screen Shot 2016-03-26 at 4.35.43 PM.png

Lights of Soi Cowboy

I continued with a walk in Chinatown where bird nest soup and (unfortunately) shark fin soup were advertised on shop windows. I ended my Bangkok tour by a compulsory walk through the infamous Soi Cowboy, aka the Brightest Street in Bangkok! Apparently, the name of this street comes from a retired American airman who opened one of the first gogo-bars here in the 1970s and used to wear a cowboy hat! As it was mid-week, this street was not super busy but still many girls in scant clothing were standing in the street and trying to talk to groups of walking men.

Once I exited the surprisingly short street, I was surprised to see a group of young Persian men sitting on a nearby platform and listening to one of their friends singing a Persian song, “yar-e man…”. With this nostalgic voice in my ears and the glow of the lights in my eyes, I thought about all the lonely men, from American soldiers to European and Middle Eastern tourists and everyone in between, who have walked these streets. And the many women whose lives somehow became entangled with the Brightest Street in Bangkok.

Chiang Mai

Screen Shot 2016-03-26 at 4.51.17 PM.png

Temple at night

The Northern town of Chiang Mai, a city close to the border with Myanmar, provides a nice relief from the heat and crowds of Bangkok. Many travelers who are interested in outdoor activities or visiting hill tribes use Chiang Mai (or its smaller neighbor Chiang Rai) as a base. Being a backpacker and tourist haven provides ample amenities for the weary traveler but can sometimes be a bit overwhelming. Chiang Mai was famously featured in the Chinese slapstick comedy blockbuster, Lost in Thailand, which prompted a lot of Chinese tourists to visit it in the last few years.

Screen Shot 2016-03-26 at 4.50.22 PM.png

Temple in Chiang Mai

I started my visit with exploring some of Chiang Mai many exquisite temples which are within easy walking distance from each other and each have unique features. Temples here have a different style from Bangkok and are often made from wood. The architecture and ornaments are breathtaking. In my humble opinion, the carvings at one of these temples, the Wat Buppharam, were the most exquisite. Paradoxically, this temple also included a bizarre Donald Duck statue among the traditional artifacts!

Screen Shot 2016-03-30 at 4.13.49 PM.png

Collection of artifacts at Wat Buppharam

Vibrant night markets are another great feature of Chiang Mai. On weekends endless rows of sellers present craft works, art pieces, food and everything-in-between to a slow river of flowing people. During these nightly walks, I tried some of the tastiest curries I’ve ever had. They were served in thin plastic bags, were piping hot (both temperature and spice heat) and absolutely delicious! I remember sitting beside the road with a couple of bags of fiery curry mixed with fragrant rice, and burning with joy!

 

IMG_20160313_121824.jpg

Curry heaven

This experience reminded me of one of my friend’s remark that in Thailand, much attention has been paid to worldly pleasures from some of the best foods and drinks to excellent massages (including one involving small fish!).

 

20160311_181610.jpg

Fish massage

Screen Shot 2016-03-30 at 4.18.02 PM.png

Animals in Chiang Mai zoo

The closest mountain range to Chiang Mai is Doi Suthep Pui National Park. Rather than a tranquil sanctuary, the park is home to many sights including the Wat Phra That Doi Suthep temple that overlooks the city of Chiang Mai, a couple of hill tribe villages, the Chiagn Mai zoo and many other attractions. I spend half a day exploring the zoo and a few hours at the temple. The animals in the zoo were quite fun to see (even despite their lethargic state given the humidity and heat!). A fun activity in the park involved paying a small fee to feed a variety of animals from emus and elephants to tigers and lions!

Screen Shot 2016-03-26 at 4.49.42 PM.png

Ska band Chiang Mai

One night I decided to check out the nightlife scene in Chiang Mai. Sitting on a patio in a backpacker bar, I met two unlikely friends, a truck driver from Australia and an insurance broker from San Francisco. We were soon joined by a firefighter from Korea and a big group of German travelers. Together, we checked out a surprisingly awesome jazz joint called, the North Gate Jazz Club, a cheesy outdoor dance floor called, Zoe in Yellow, a really nice live ska bar (that I don’t know the name of), and finally a slightly sketchy after-hours spot called, Spicy. This last place was closed down at 1:30 am, which left many a party goers in despair. But that’s a half-hour past the official close time. Anyways, I didn’t go out much on this trip and seeing the several venues in one night was kind of a treat! The next day, I grabbed a Thai omelette from a family restaurant and followed it by a special treat: the most delicious mango rice plate ever! Time to say goodbye to Thailand!

 

IMG_20160312_123747.jpg

Yummy mango rice!

Singapore

The multicultural city-state of Singapore provided me with a gentle entrance into Asia. Arriving at 5 am at the Changi International Airport, I took the efficient and clean metro train into town and walked into the financial heart of the city (which reminded me of Shanghai and Vancouver). A mix of well-dressed Asian, Indian and European people were walking to work with coffees, teas and other multicolored drinks in their hands.

Screen Shot 2016-03-20 at 2.26.03 PM.png

Marina Bay

After dropping off my luggage at a hostel on the waterfront, I went for a long walk around town. I changed some money in a small center full of money changers, called Change Alley, grabbed a strong traditional coffee mixed with concentrated milk and started walking to Chinatown.

12790836_10102929731731410_593584395718083801_n.jpg

Singapore Chinatown

As it turned out, this was the first of many Chinatowns and Little Indias that I visited during my trip in Singapore, Thailand and Malaysia. I find it interesting (and humbling) that these neighborhoods in South East Asia have been around much longer than our modern notions of globalization and multiculturalism became such fads.

Screen Shot 2016-03-20 at 2.31.30 PM.png

Mosque in Singapore

It was great to see Taoist and Buddhist temples, Muslim mosques and Hindu temples sit next to each other. I visited an interesting temple, the Buddha Tooth Relic Temple, that houses (you guessed it!) one of Buddha’s teeth in a golden shrine. The temple also had a number of very detailed wax models of senior monks in meditation poses.

Screen Shot 2016-03-20 at 2.39.39 PM.png

Wax model of meditation master

Screen Shot 2016-03-20 at 2.35.56 PM.png

Buddha Statue in the Buddha Tooth Relic Temple

Walking around Singapore, one runs into amazing buildings that are often combined with or inspired by themes from nature. Famous examples include the durian-shaped Esplanade, and, of course, the stunning Gardens by the Bay.

Screen Shot 2016-03-25 at 1.22.45 PM.png

Gardens by the Bay, Night and Day

Screen Shot 2016-03-20 at 2.40.46 PM.png

Durian-Shaped Esplanade Building

Other amazing buildings include the Marina Sands Resort that looks like a building with a ship on top (a tribute to Noah?!) and the Park Royal hotel.

Screen Shot 2016-03-25 at 1.31.15 PM.png

Park Royal Hotel

Other fun things to spot around town are tasteful uses of color in normal buildings:

Screen Shot 2016-03-21 at 4.42.04 AM.png

Colorful building

… and sculptures by some surprisingly famous people including, Dali and Botero!

Screen Shot 2016-03-25 at 1.14.41 PM.png

Dali and Botero sculptures

In Singapore, I visited several excellent museums and galleries. My favorite was the National Gallery of Singapore that is housed in the former Supreme Court Building and the City Hall. The site has historical significance, as it is the place where Japan surrendered to the Allies during WWII. The art in this museum was exquisite and ranged from meditations on nature by Chinese master Wu Guanzhong to refreshingly political and social art by a range of artists from Southeast Asia.

Screen Shot 2016-03-20 at 5.08.11 PM.png

Painting by Wu Guanzhong

Other interesting museums that I visited included, the Asian Civilizations Museum, with treasures from different corners of Asia (including Iran); and, the National Museum, which provides a nice overview of Singapore’s history (including a fascinating and dark account of its occupation by Japan during WWII). One of the things that I saw a lot of in Singapore was an interesting use of digital media including projection mapping around town, including at the i Light Marina Bay festival on the waterfront and in the National Museum.

Screen Shot 2016-03-20 at 5.00.42 PM.png

Projection Mapping at the National Museum

The most fascinating modern art piece I saw, however, was at the Changi International Airport: an amazing kinetic sculpture, called Kinetic Rain, by the German design firm ART+COM. I had heard about this work at the Design & Emotion Conference in Bogota before, but seeing it first hand was amazing.

Screen Shot 2016-03-20 at 2.42.06 PM.png

Kinetic Rain

I was pretty jet-lagged during most of my stay in Singapore, so I would get sleepy pretty early and also get up early. On one of these early mornings, I took a bus to the famous Singapore Zoo. Despite the heat and humidity, it was a fascinating trip and I saw some stunning animals. Some highlights was a crazy busy baboon colony (with some very naughty monkeys!); a man performing energy healing on an orangutan; a fascinating animal called Malayan Tapir, whose upper lip and nose are connected (!), and, finally, the Proboscis Monkey, a monkey with a stunningly large nose and bloated belly full of enzymes and bacteria that might explode if the monkey eats too much sugary fruits!

Screen Shot 2016-03-20 at 5.11.11 PM.png

Energy-Healing with Orangutan

The food in Singapore is fascinating and is a festival of Chinese, Malay, Indian, Thai and Singaporean tastes. I particularly enjoyed visiting traditional food courts, called Hawker centers, where you can try a variety of dishes from local family-run stalls for reasonable prices. Some amazing foods I tried were a spicy laksa soup, a magnificent fish head curry and a stunning chili crab!

12804819_10102929738078690_6538934117362349682_n.jpg

Fish head curry

This last dish was so deliciously hot that it almost destroyed my tongue and I could not feel it for about half an hour. Needless to say, I still highly recommend it!

Screen Shot 2016-03-20 at 5.00.28 PM.png

Chili Crab

Singapore has long been a trade center in Asia and a meeting place between West and East and this spirit still pervades. I walked through the financial section that funds the city many times and was reminded that the city’s heartbeat revolves around finance and commerce. A lot of the stunning buildings, beautiful light shows and fashionable events felt like pats on the back for the success of the city-state and its residents as a whole. Also, a pat for surviving in the most expensive city in the world!

Screen Shot 2016-03-20 at 2.30.13 PM.png

Am I being watched?

At the end of my stay, I had mixed feelings about Singapore: while it was easy to travel there (e.g., I imagine it’s an excellent place to travel with children), and it has good culinary, cultural and artistic offerings, I found it over-organized and a bit stifling. I had a feeling I was constantly being watched (the many security cameras did not help) and needed to behave. Despite the diversity, there seemed to be a clear path of “success” to be followed. I was ready to move to a more wild and open space. A feeling that was perfectly rewarded by my next stop: Thailand!

Baking Pi’s 3: A Networked Rafigh

In the “Baking Pi’s” series of posts, I describe a number of projects with the Raspberry Pi that I have been doing in the last few weeks. In this post, I will describe how to make a networked Rafigh using a Raspberry Pi. I will first describe how to connect the Raspberry Pi to the physical world and how to control it over the Internet. Next, I will describe how to connect this setup to a small water pump and living mushroom colony to create a networked version of Rafigh. I will be mostly using Raspberry Pi 1 (and later also try out Raspberry Zero). The same approach can easily be used with Raspberry Pi B+ as well. I will also use a Mac computer to connect to the Pi via wifi.

Setting up and Testing the Circuit

Starting from a Pi with the latest Raspbian OS, I connect it to a simple circuit that controls an LED light. For information on how to initially set up your Pi, please see my previous post. To check GPIO lists and locations on different Raspberry Pi boards, see here and here.

So using an example described in the excellent Make book, Getting Started with Raspberry Pi by Matt Richardson and Shawn Wallace, I use a breadboard to connect a single LED using female to male jumper wires to the Pi. I connect, Pi’s Ground to the Ground bus of the breadboard and the negative leg of the LED, and the Pi’s pin 24 to the positive leg of the LED. Next, I use the following Python code to blink the LED:

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.OUT)

While True:
   GPIO.output(24, GPIO.HIGH)
   time.sleep(1)
   GPIO.output(24, GPIO.LOW)
   time.sleep(1)

I save these in a file called blink.py and run it using the following command:

sudo python blink.py

You might notice that there are some warning messages when you run this code. Specifically, when you interrupt the program with a Ctrl+C you get a warning and also when running the script you get a warning about the channel being already in use. You can get ride of these warnings by putting the loop in an exception clause, like so:

while True:
   try:
      GPIO.output(24, GPIO.HIGH)
      time.sleep(1)
      GPIO.output(24, GPIO.LOW)
      time.sleep(1)
   except KeyboardInterrupt:
      GPIO.cleanup()
      exit()
Screen Shot 2016-02-10 at 7.02.59 PM

Using the Pi to turn on and off a light

Controlling the Light over the Internet

Once you can blink the LED, it’s time to control it over the Internet! Again, I’m using ideas from the excellent book, Getting Started with Raspberry Pi by Matt Richardson and Shawn Wallace. To access the Pi over the Internet, I turn it into a server and have it load a dynamic page which you can use to control the LED.

I’ll start by installing Flask which is a Python web framework and can be used to turn the Pi into a dynamic web server. The following commands should install Flask:

sudo apt-get install python-pip
sudo pip install flask

With Flask installed, I can create a dynamic web server that can interact with the GPIO pins. First, I create a directory called rafigh to put all the code in:

sudo mkdir rafigh 
cd rafigh

Here, I create a subfolder called templates that will hold the html files that can be accessed via the server. Now, we need to write the code to run the server. It will be in a file called rafigh.py:

import RPi.GPIO as GPIO
from flask import Flask, render_template, request
app = Flask(__name__)

GPIO.setmode(GPIO.BCM)

#I'm only using 1 pin (pin 25), if you use more, you can add more pins here. 
pins = {
     24 : {'name' : 'lamp', 'state' : GPIO.LOW}
     }

for pin in pins: 
   GPIO.setup(pin, GPIO.OUT)
   GPIO.output(pin, GPIO.LOW)

@app.route("/")
def main():
   for pin in pins:
      pins[pin]['state'] = GPIO.input(pin)
   templateData = {
      'pins' : pins
      }
   return render_template('rafigh.html', **templateData)

@app.route("/<changePin>/<action>")
def action(changePin, action):
   changePin = int(changePin)
   deviceName = pins[changePin]['name']
   if action == "on":
      GPIO.output(changePin, GPIO.HIGH)
      message = "Turned " + deviceName + " on."
   if action == "off":
      GPIO.output(changePin, GPIO.LOW)
      message = "Turned " + deviceName + " off."
   if action == "toggle":
      GPIO.output(changePin, not GPIO.input(changePin))
      message = "Toggled " + deviceName + "."
   
   for pin in pins: 
      pins[pin]['state'] = GPIO.input(pin)

   templateData = {
      'message' : message,
      'pins' : pins
   }

   return render_template('rafigh.html', **templateData)

if __name__ == "__main__":
   app.run(host='0.0.0.0', port=80, debug=True)

This code will run the server and provide dynamic data to the html page. Now, it’s time create the html page, rafigh.html, that will sit in the template folder:

<!DOCTYPE html>
<head>
  <title>Current Status</title>
</head>

<body>

<h1> Device Listing and Status </h1>

{% for pin in pins %}
<p>The {{ pins[pin].name }}
{% if pins[pin].state == true %}
   is currently on (<a href="/{{pin}}/off">turn off</a>)
{% else %}
   is currently off (<a href="/{{pin}}/on">turn on</a>)
{% endif %}
</p>
{% endfor %}

{% if message %}
<h2>{{ message }}</h2>
{% endif %}


</body>
</html>

Now, if you point your browser at the Pi’s address (either you Pi’s ip address, or if you are using Bonjour, rafigh.local), you will see a webpage that allows you to turn on and off the light.

Finally, we will to connect to the networked light from outside of the local network, which allows us to control the Pi from wherever we are, as long as we are connected to the Internet! There are several ways to do this including setting up port forwarding on your router or using a web-based forwarding service liked Weaved.  This service requires you to first create a free account on the Weaved website and then to download and install it on your Pi, using the following commands:

sudo apt-get install weavedconnectd
sudo weavedinstaller

Once setup, you can initiate SSH and HTTP services on Weaved and access your Pi by logging into your account on Weaved.

Finally, you want to let the Pi know to run the script at startup. To do this, follow these instructions.

Migration to Raspberry Pi Zero

Before putting everything together, I decided to make a Raspberry Pi Zero (sometimes referred to as #PiZero) version of the project. The Pi Zero is an ultra light, low-cost (~$5!) version of the Raspberry Pi and was released in late 2015. If you don’t want to use Raspberry Pi Zero, you can skip this section.

Screen Shot 2016-02-10 at 7.03.06 PM

Clockwise from bottom right: Raspberry Pi zero, a 2×20 Male header strip, a 3D printed case, a USB OTG Cable and a Wifi dongle

To prepare the Pi Zero, I first soldered a 2×20 Male header strip to the Pi and then 3D printed an enclosure for it so that I don’t accidentally break it! With all these in place, I  cloned the SD card that I had set up in the previous steps, using the  dd command. I placed the prepared SD card in the card reader. Then, I found the SD card disk number (disk 2) by using diskutil list. Finally, I copied the the contents of the disk into an image file on the Mac machine:

sudo dd if=/dev/disk1 of=~/Desktop/2016-2-9-rafigh.dmg 

This took a while and I checked the command’s progress using Ctrl+t. Once the image was created, I copied it to a fresh SD card. Again, I placed the new card in the reader, found out what its disk number was using diskutil list (in my case it was in disk3). Next, I unmounted it:

diskutil unmountDisk /dev/disk3

Finally, I copied the image to the SD card:

sudo dd if=~/Desktop/2016-2-9-rafigh.dmg of=/dev/disk3

Again, this might take a while and you can check the progress using Ctrl+t. Once this is done, I plugged the new SD card into the Pi Zero, attached a USB OTG Cable to one of the usb ports (this allowed me to connect a wifi dongle to the Pi). Finally, I connected the Pi Zero’s GPIO pins to the circuit (Pi Zero has the same GPIO pin layout at Raspberry Pi B+ and A+) and powered up the Pi.

Screen Shot 2016-02-10 at 7.03.16 PM

Assembled Pi Zero

Once the Pi Zero is booted up, I could SSH into it, start the server and control the light as before. Voila!

Screen Shot 2016-02-11 at 1.53.12 PM.png

Off/On

If you are using Bonjour service, it might be a good idea to change the host name by following the steps here.

A Networked Light: Putting Things Together

Now, we have all the pieces together and can replace the LED light with a Powerswitch Tail 2 that can control any small AC-powered device, like a lamp or water pump.

To do this, I connect (directly or via a breadboard) the “+in” pin of the power switch to Pin 24 of the Pi and the “-in” pin to the Ground. Next, I connect (directly or via a breadboard) the power switch to a wall plug and a lamp and test by booting up the Pi and navigating to the Pi’s local address (e.g., rafigh.local or rafighzero.local) on my browser. This allowed me to turn on and off the current from my computer.

With the weaved service setup, I was able to connect to the network remotely (over the Internet rather than the local wifi network) and control the light. Next, I will describe how to connect this setup to a small water pump and a living mushroom colony to create a networked Rafigh.

A Networked Rafigh

With all the pieces assembled above, we can now create a networked Rafigh that can be controlled remotely. Rafigh is a digital living media system that can be used to motivate children to  conduct desirable activities such as using learning and therapeutic digital applications. For more information on Rafigh, see this previous post.

20150130_133533

Rafigh

To create the networked Rafigh, we need to replace the lamp with a small water pump. I have been using the Tom Aquarium Aqua Lister Pump, which I would recommend for its low power pressure (which you need, in order not to flood the mushrooms!). Next, I connect a small water container to the input valve of the water pump and connect the output valve to the mushroom colony (I’ve been using Fungaea’s The ShroomBox) using a water tube. All the electronics and the mushroom colony are placed in the custom made Rafigh enclosure.

With the system powered up, I can access the Pi remotely via my weaved account. From here, I can either activate the water pump using the dynamic website created above.

Before ending this post, I will also briefly describe how to schedule watering times using the existing setup and Linux’s crontab. First, we need to create a simple script to turn on and off the pump from the command line. I create a file called turnPumpOn.sh:

#!/bin/bash
echo Exporting pin 24.
echo 24 > /sys/class/gpio/export
echo Setting direction to out.
echo out > /sys/class/gpio/gpio24/export
echo Turning on the pump.
echo 1 > /sys/class/gpio24/value

I also create another file called turnPumpOff.sh:

#!/bin/bash
echo Turning off the pump.
echo 0 > /sys/class/gpio24/value
echo Unexporting pin 24
echo 24 > /sys/class/gpio/unexport

I put both of these files in the same rafigh directory that I created for the project before. This helps makes things organized. I make both files executable using chmod:

chmod +x turnPumpOn.sh
chmod +x turnPumpOff.sh

Now, I can turn on and off the pump using the command:

./turnPumpOn.sh
./turnPumpOff.sh

With these two scripts in place, we can schedule specific times for the pump to be turned on and off by editing the crontab file, using the following command:

crontab -e

For example, to turn the pump on for 2 minutes everyday at 7pm, we can add the following two lines to the bottom of the file:

0 19 * * * /home/pi/rafigh/turnPumpOn.sh

2 19 * * * /home/pi/rafigh/turnPumpOff.sh

For details on how to schedule tasks in the crontab file, follow this link.

Baking Pi’s 2: Touch HAT

In the “Baking Pi’s” series of posts, I describe my adventures with the Raspberry Pi embedded computer. Each segment describes a specific setup. This series is fairly technical and is meant to be used to create digital prototypes.

Screen Shot 2016-02-10 at 7.03.48 PM

Raspberry Pi with Touch Hat and Fruit!

In this post, I will describe my experience using Raspberry Pi with a touch sensor to create an interactive sound box. This post assumes that you have a Raspberry Pi B+ setup and connected (either to a monitor or running in headless mode). See my previous post or the official Raspberry Pi website on how to setup your Pi.

Using Pi to create an interactive sound box

A really fun activity is playing music using fruit and other conductive things (even humans)! You can do this by connecting the fruit to a computer using a touch sensor that in effect treats them as a key on the keyboard, making it possible to activate sounds when they are touched.  Some examples of how to do this easily is using a Makey Makey board or a Bare Conductive touch board. In the past, we connected an MPR121 Capacitive touch sensor to a Raspberry Pi to create TalkBox, a DIY communication board for non-verbal users. One of the challenges of putting together TalkBoxes was to connect all the wires from the MPR121 breakout board to the Raspberry Pi. Recently, capacitive touch HATs designed specifically for Raspberry Pi have become available that make it much easier to create an interactive sound box with the Raspberry Pi.

Screen Shot 2016-02-10 at 7.04.05 PM

Preparing the Touch HAT

For this project, you need a Raspberry Pi (already setup with a Linux distribution system and connected to the Internet, see above) and Adafruit’s capacitative touch HAT. You have to do a bit of soldering of a 2×20 solder header (included in the kit) to the touch HAT which makes it fit perfectly on top of the Raspberry Pi B+ (for older Raspberry Pi’s you need to solder a different taller solder header, see here).

Screen Shot 2016-02-10 at 7.03.55 PM

Pi wearing its new HAT!

One you have soldered the header and placed the HAT on the Pi, you need to install software following instructions here. The one thing that is missing from the tutorial is that you also have to enable the I2C protocol so that the Raspberry Pi can talk to the HAT. To do this use sudo raspi-config and choose Advanced Options. Here, you can enable I2C support and set it to load by default. Once you reboot, the libraries should be loaded.

Following is an example of code that runs a simple version of TalkBox (with a small set of constant sounds):

# Copyright (c) 2016 Foad Hamidi
# Author: Foad Hamidi based on code originally written by Tony Dicola from Adafruit Industries
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

import sys
import time
import pygame.mixer

import Adafruit_MPR121.MPR121 as MPR121


print 'TalkBox Test'

# Create MPR121 instance.
cap = MPR121.MPR121()

# Initialize communication with MPR121 using default I2C bus of device, and 
# default I2C address (0x5A).  On BeagleBone Black will default to I2C bus 0.
if not cap.begin():
    print 'Error initializing MPR121.  Check your wiring!'
    sys.exit(1)

#Initialize the sound system, and create empty lists of channels and sounds
pygame.mixer.init(48000, -16, 1, 1024)
soundChannelList = [None] * 12
soundList = [None] * 12

#Populate your list of sounds and channels, there are only 7 channels, so you
#will have to reuse some channels. Channels are used so that sounds can be played
#simultaneously.
#I'm using some semi-random voice samples from a previous project. 
sound1 = pygame.mixer.Sound("/home/pi/Music/Feeling/happy.wav")
soundChannel1 = pygame.mixer.Channel(1)
soundList[0] = sound1
soundChannelList[0] = soundChannel1
sound2 = pygame.mixer.Sound("/home/pi/Music/Feeling/excited.wav")
soundChannel2 = pygame.mixer.Channel(2)
soundList[1] = sound2
soundChannelList[1] = soundChannel2
sound3 = pygame.mixer.Sound("/home/pi/Music/Feeling/feeling.wav")
soundChannel3 = pygame.mixer.Channel(3)
soundList[2] = sound3
soundChannelList[2] = soundChannel3
sound4 = pygame.mixer.Sound("/home/pi/Music/Feeling/proud.wav")
soundChannel4 = pygame.mixer.Channel(4)
soundList[3] = sound4
soundChannelList[3] = soundChannel4
sound5 = pygame.mixer.Sound("/home/pi/Music/Feeling/sad.wav")
soundChannel5 = pygame.mixer.Channel(5)
soundList[4] = sound5
soundChannelList[4] = soundChannel5
sound6 = pygame.mixer.Sound("/home/pi/Music/Feeling/sick.wav")
soundChannel6 = pygame.mixer.Channel(6)
soundList[5] = sound6
soundChannelList[5] = soundChannel6
sound7 = pygame.mixer.Sound("/home/pi/Music/Feeling/tired.wav")
soundChannel7 = pygame.mixer.Channel(7)
soundList[6] = sound7
soundChannelList[6] = soundChannel7
sound8 = pygame.mixer.Sound("/home/pi/Music/Feeling/good_morning_f.wav")
soundChannel8 = pygame.mixer.Channel(1)
soundList[7] = sound8
soundChannelList[7] = soundChannel8
sound9 = pygame.mixer.Sound("/home/pi/Music/Feeling/goodbye_f.wav")
soundChannel9 = pygame.mixer.Channel(2)
soundList[8] = sound9
soundChannelList[8] = soundChannel9
sound10 = pygame.mixer.Sound("/home/pi/Music/Feeling/need_break.wav")
soundChannel10 = pygame.mixer.Channel(3)
soundList[9] = sound10
soundChannelList[9] = soundChannel10
sound11 = pygame.mixer.Sound("/home/pi/Music/Feeling/thank_you_f.wav")
soundChannel11 = pygame.mixer.Channel(4)
soundList[10] = sound11
soundChannelList[10] = soundChannel11
sound12 = pygame.mixer.Sound("/home/pi/Music/Feeling/sunny.wav")
soundChannel12 = pygame.mixer.Channel(5)
soundList[11] = sound12
soundChannelList[11] = soundChannel12
print "Soundboard Ready."

# Main loop to print a message and play a sound every time a pin is touched.
print 'Press Ctrl-C to quit.'
last_touched = cap.touched()
while True:
    current_touched = cap.touched()
    # Check each pin's last and current state to see if it was pressed or released.
    for i in range(12):
        # Each pin is represented by a bit in the touched value.  A value of 1
        # means the pin is being touched, and 0 means it is not being touched.
        pin_bit = 1 << i
        # First check if transitioned from not touched to touched.
        if current_touched & pin_bit and not last_touched & pin_bit:
            print '{0} touched!'.format(i)
            soundChannel = soundChannelList[i-1] 
            sound = soundList[i-1]
            soundChannel.play(sound)
            print'Sound played'
        # Next check if transitioned from touched to not touched.
        if not current_touched & pin_bit and last_touched & pin_bit:
            print '{0} released!'.format(i)
    # Update last state and wait a short period before repeating.
    last_touched = current_touched
    time.sleep(0.1)

    # Alternatively, if you only care about checking one or a few pins you can 
    # call the is_touched method with a pin number to directly check that pin.
    # This will be a little slower than the above code for checking a lot of pins.
    #if cap.is_touched(0):
    #    print 'Pin 0 is being touched!'
    

Finally, adjust the volume of the speakers using the following command at the terminal prompt:

amixer  sset PCM,0 90%

which will adjust the volume by the indicated percentage of its total capacity (e.g., 90% in the above example).

Here’s a video of the setup used to make two pieces of fruit have a conversation:

Note: If you are getting weird static sounds out of the speaker connected to your analog audio output, it’s probably because of the power source. Try different ones and hopefully you will find one that doesn’t’ affect the audio performance too much. Another possibility is that you have not plugged in your speaker properly. Check it again before giving up on your speakers!

Finally, if you want this code to be loaded at startup, follow these instructions.