Zurich

Posted: June 13, 2015 in personal
Tags:

As some of you know, I recently started to work for a small Internet startup in Zurich.

Well, technically that’s not accurate, but it surely feels that way when the occasional “Joe”/” Jane” I bump into at lunch is an awesomely passionate person whom I chat equally interested about technology, latest Star War announcements, NASA space programs, literature and music.

First weekend here. Very good weather. After solving logistics (not entirely without stress – that’s yours truly🙂 ), went to Aida. My first time in the Zurich OperHaus: love the music, hate the pillars you need to consider when booking tickets. This weekend a marathon of Haydn, Beethoven, Mozart and Schubert in the Zurich Tonhalle. Apparently there are major geeks into music also. Metal and Opera.

Thankful for having friends. Next is Yuja Wang and Mustonen😀

I feel poor. Very very poor. Yes, Dusseldorf is expensive. No, it doesn’t help. I feel poor :p

First time in my life, went on a small trip in a Ferrari. No, I wasn’t allowed to drive it myself. Yes, I was scared :p

Information overload, missing my friends, too many things happening, lucky spoiled brat.

Yours truly,

 

Jobs – 2013

Posted: May 3, 2015 in media-culture
Tags:

a little late, but better late than never

Jobs – 2013 ending scene

here’s to the crazy ones, the misfits, the rebels, troublemakers …

the ones who see things differently

they are not fond of rules and have no respect for the status quo

…about the only thing you can’t do is ignore them, because they change things, they push the human race forward

…because the people who are crazy enough to think they can change the world – are the ones who do

Carmina Burana – O Fortuna

Posted: April 11, 2015 in media-culture
Tags: ,

It’s that one cool classical song they always play when something evil or scary or BADASS is going to happen! It sounds satanical, but it’s actually a religious song (pawn intended?)

Can’t actually recall when I have first heard it (most probably in an alien movie soundtrack😛 ), but I was captivated! It was AWESOME. One of the most awesome music compositions I had heard till then and still one of the most powerful, energetic and full of strength pieces of music. The composer is a German guy, Carl Off, who took a collection of (24) medieval poems and made amazing music out of them – more precisely in 1937 – first audition was nearby, in Frankfurt Opera.

My favourite is O Fortuna, the piece which starts and ends the collection. “In this piece, the author talks about to Fortuna (the goddess of luck in the Roman mythology) – praising her greatness, as well as her malevolence”. The rest of the songs cover a wide range of topics, from the fickleness of fortune and wealth, the ephemeral nature of life, the joy of the return of Spring, and the pleasures and perils of drinking, gluttony, gambling and lust.

Well, I have recently heard it in Tonhalle, and I was not disappointed. It was as amazing, even more so, live than on YouTube!

Nearly 100 musicians, 100 brains in sync for more than 1 hour, an engineering masterpiece at the very least. Every time I hear such powerful pieces of music, there is tiny devil in my head chuckling mischievously: Beethoven would have loved this!

O Fortuna vs. Final Fantasy

1. I have minions!

2. My minions are AWESOME!

3. While I am away from my minions, I wanna make sure that they are safe and happy.

Hence, I am preparing a super (duper) tiny project to alert me of movement around my minions (as I said, only I am allowed around my minions).

Parts

1. Motion detector (PIR sensor)

2. Wires (the sensor needs 3: ground, out, vcc)

3. Arduino board

4. I had Python on my mac-mac, but I also had to install pyserial, in order to communicate to the Arduino board, via the serial port. In my case, the Arduino board is reachable via /dev/cu.usbmodem1421, on other systems it’s probably different.

Picture

20150408_200557

A bit of explanation

Basically, the “plan” is to log something to Serial port from Arduino, everytime I detect movement around my Minions. If that happens, I log “Movement!” to the Serial port. Then, from Python, I monitor the serial port, and if I read “Movement!”, then I send an email to myself, using my Gmail account, alerting me that the safety of the Minions has been compromised🙂

Code

1. Arduino code

int pirPin = 7;

int spamInterval = 60; // send email max every 1 min

long lastSend = -spamInterval * 1000l; // measured in milliseconds

void setup()
{
pinMode(pirPin, INPUT);
Serial.begin(9600);
}

void loop()
{
long now = millis();
if (digitalRead(pirPin) == HIGH)
{
if (now > (lastSend + spamInterval * 1000l))
{
Serial.println(“Movement!”);
lastSend = now;
}
else
{
Serial.println(“Let’s not spam”);
}
}
delay(500);
}

2. Python code

import time

import serial

import smtplib

import io

TO = ‘cristina.vintila@gmail.com’

GMAIL_USER = ‘cristina.vintila@gmail.com’

GMAIL_PASS = ‘no, you cannot get this one😉’

SUBJECT = ‘Intrusion!!’

TEXT = ‘Watch the Minions! The Minions are not safe!’

ser = serial.Serial(‘/dev/cu.usbmodem1421’, 9600)

def send_email():

    print(“Sending Email”)

    smtpserver = smtplib.SMTP(“smtp.gmail.com”,587)

    smtpserver.ehlo()

    smtpserver.starttls()

    smtpserver.ehlo

    smtpserver.login(GMAIL_USER, GMAIL_PASS)

    header = ‘To:’ + TO + \n + ‘From: ‘ + GMAIL_USER

    header = header + \n + ‘Subject:’ + SUBJECT + \n

    print header

    msg = header + \n + TEXT + \n\n

    smtpserver.sendmail(GMAIL_USER, TO, msg)

    smtpserver.close()

while True:

    message = ser.readline()

print(message)

    if message[0] == ‘M’ :

        send_email()

    time.sleep(0.5)

#ser.close()

3. Output

rbh:Arduino cristina$ python safeMinions.py

Let’s not spam

Let’s not spam

Movement!

Sending Email

To:cristina.vintila@gmail.com

From: cristina.vintila@gmail.com

Subject:Intrusion!!

Let’s not spam

And I have the email🙂

Happily, I am right next to the Minions, and I know they are safe

Arduino – making pretty sounds

Posted: April 8, 2015 in technical
Tags: , ,

Cristina is girlie and she likes PINK! Unfortunately, the LED part is the only one I couldn’t make work😦😦 hence no pink display for me.

The next best thing: we make pretty sounds!

Parts

1. Piezo (I have no proper speaker): well, I use it to make the (pretty) sounds

2. Light sensor + 1K Ohm resistor

I used this only in the beginning, as I wanted to make the piezo play sounds based on the light intensity. As I am not able to control the light intensity in my room in a good-enough way to make sounds, I decided to use the distance variation to play different tones (see 3).

3. Ultrasonic sensor: well, I use it to measure the distance from the sensor to my palm and based on this variation I scale the distance from CM to Hz and play the tones within a range of musical notes:

int tones[] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440, 450};
// mid C, C#, D, D#, E, F, F#, G, G#, A, higher

How did I end up with these values?

Well, I have not. That’s just how they are. The frequency of Mid C is 261.6 Hz, and the others as above. What I tried then to ensure is that I map the distances from the Ultrasonic reader to a range of frequencies which “make sense” (between 200 and 300 Hz). As I would just flip my hand around the sensor to no longer than 100 cm, I just decided to add 200 to the distance computed by the sensor, in order to create the pitch (I am sure there are much better ways to do this).

4. Wires (the Ultrasonic sensor needs 4 – as it has 4 PINs: VCC, Trigger, Echo, Ground)

5. Yeah, and the Arduino board and breadboard, otherwise: no magic

Picture

20150408_191513

Code

v0.1 (using the Light sensor)

int speakerPin = 12;
int photocellPin = 0;

int numTones = 11;
int tones[] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440, 450};
// mid C C# D D# E F F# G G# A others

void setup()
{
for (int i = 0; i < numTones; i++)
{
tone(speakerPin, tones[i]);
delay(500);
}
noTone(speakerPin);
}

void loop()
{
int reading = analogRead(photocellPin);
int pitch = 200 + reading / 4;
if (pitch <= 261)
{
tone(speakerPin, tones[0]);
}
else if (pitch > 261 && pitch <= 277)
{
tone(speakerPin, tones[1]);
}
else if (pitch > 277 && pitch <= 294)
{
tone(speakerPin, tones[2]);
}
else if (pitch > 294 && pitch <= 311)
{
tone(speakerPin, tones[3]);
}
else if (pitch > 311 && pitch <= 330)
{
tone(speakerPin, tones[4]);
}
else if (pitch > 330 && pitch <= 349)
{
tone(speakerPin, tones[5]);
}
else if (pitch > 349 && pitch <= 370)
{
tone(speakerPin, tones[6]);
}
else if (pitch > 370 && pitch <= 392)
{
tone(speakerPin, tones[7]);
}
else if (pitch > 392 && pitch <= 415)
{
tone(speakerPin, tones[8]);
}
else if (pitch > 415 && pitch <= 440)
{
tone(speakerPin, tones[9]);
}
else
{
tone(speakerPin, tones[10]);
}
}

v0.2 (using the Ultrasonic sensor)

int speakerPin = 12;
int trigger=7;
int echo=6;
long time=0;
long dist=0;

int numTones = 11;
int tones[] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440, 450};
// mid C C# D D# E F F# G G# A others

void setup()
{
Serial.begin(9600);
pinMode(trigger, OUTPUT);
pinMode(echo, INPUT);

for (int i = 0; i < numTones; i++)
{
tone(speakerPin, tones[i]);
delay(500);
}
noTone(speakerPin);
}

void loop()
{
digitalWrite(trigger, LOW);
delay(5);
digitalWrite(trigger, HIGH);
delay(10);
digitalWrite(trigger, LOW);
time = pulseIn(echo, HIGH);
dist = (time/2) / 29.1;

if ( dist >= 500 || dist <= 0)
{
Serial.println(“No measurement”);
}
else
{
Serial.println(dist);

int pitch = 200 + dist ;
if (pitch <= 261)
{
tone(speakerPin, tones[0]);
}
else if (pitch > 261 && pitch <= 277)
{
tone(speakerPin, tones[1]);
}
else if (pitch > 277 && pitch <= 294)
{
tone(speakerPin, tones[2]);
}
else if (pitch > 294 && pitch <= 311)
{
tone(speakerPin, tones[3]);
}
else if (pitch > 311 && pitch <= 330)
{
tone(speakerPin, tones[4]);
}
else if (pitch > 330 && pitch <= 349)
{
tone(speakerPin, tones[5]);
}
else if (pitch > 349 && pitch <= 370)
{
tone(speakerPin, tones[6]);
}
else if (pitch > 370 && pitch <= 392)
{
tone(speakerPin, tones[7]);
}
else if (pitch > 392 && pitch <= 415)
{
tone(speakerPin, tones[8]);
}
else if (pitch > 415 && pitch <= 440)
{
tone(speakerPin, tones[9]);
}
else
{
noTone(speakerPin);
}
} // end distance measurement
delay(1000);
}

Yes, I did use the Serial.println for debugging, printing is the best form of debug🙂🙂🙂

So it seems that I am back on “blogging”. Long time no see, my friends🙂 and thanks for all the messages I got in the meantime.

Most probably I won’t be able to keep up blogging as in the past (not enough time to do all the geeky stuff), but I will not abandon it anymore.

The past few days I’ve found out about the passing of a friend, one of the geekiest people I know, an elderly gentleman, who has spent most of his life in the search for knowledge (he was speaking 11 foreign languages), curiosities and geeky stuff (a BSD passionate and founder of the foundation behind EuroBSDCon). I was very sad to get the news from Gavin and Henning this week, posted via the OpenBSD lists.

RIP Paul!

So, given the fact that for the past few weeks I can only sleep till 2AM every night, with occasional nights when I can fall asleep somewhere close to the morning, I have decided to spend this time on something useful, rather than with thinking and worrying about purpose of life and ponies and butterflies. First thing at hand: my new Arduino kit.

First time playing with this toy, I’ve went through the Startup Guide, and made the lights blink, the buzzer go off etc. The ones I am going to use later on though are the following:

1. Distance detector

https://drive.google.com/file/d/0By4rOXj_UNlEdVZMVHBjb2tJOGs/view?usp=sharing

2. Light sensor

https://drive.google.com/file/d/0By4rOXj_UNlEVnpaaXJQRUQweVE/view?usp=sharing

3. Movement detector

https://drive.google.com/file/d/0By4rOXj_UNlETzN6aUhkcGhNZzQ/view?usp=sharing

4. Temperature sensor

https://drive.google.com/file/d/0By4rOXj_UNlEeUpaSHJiRTZOZ0k/view?usp=sharing

5. (for the future) Servo engine

https://drive.google.com/file/d/0By4rOXj_UNlET0FfMW90bkFRMUk/view?usp=sharing

Indeed, these are just playing around with the very basics, but at least now I get the logic of how this works, and the code itself looks a lot like C programming, with libraries you can include and work with (and have the Arduino board become unresponsive when the libraries folder has a different name than the .cpp file inside it).

https://drive.google.com/file/d/0By4rOXj_UNlEamhKOTluZllPVDA/view?usp=sharing

Aaah, the sweet smell of burned plastic when you placed the Temperature sensor backwards on the breadboard!!😛

TemperatureSensor

minion on bsdnow.tv

Posted: January 1, 2015 in Uncategorized

minute 37:05

thank you, Kris and Jude!🙂 It was an awesome experience.

http://www.bsdnow.tv/episodes/2014_12_24-under_the_ports_tree

PS1: yes, I was nervous. Very VERY nervous

PS2: yes, I would have expected them to cut a lot of the interview, they kept it all

PS3: yes, I messed up the German words; I could have messed up Romanian, that’s how nervous I’ve been! (see PS1)

the secret crusade

Posted: December 22, 2014 in Uncategorized

What do he and his followers want? A world in which all men are united. I do not despise his goal. I share it. But I take issue with the means. Peace is something to be learned. To be understood. To be embraced, but… he would force it. And rob us of our free will in the process.

‘We come into the world kicking and screaming. Violent and unstable. It is what we are. We cannot help ourselves.’

‘No. We are what we choose to be.’

Cisco WiFi offload

Mwell…my dear dear journal, today I had to learn about Mobility over SAE. As we very well know, our naughty user (User Equipment) does not just stay in one single cell, but rather moves around between different antennas. As per TS 23.401 (I have studied the June edition), there are several “cases” of mobility, or handover, as the 3GPP guys call them.

What is to know about how these “cases” are delimited:

1. whether the UE only moves from one eNodeB to another (the rest of the EPS is the same) or other components (like MME and/or SGW) are also changing => X2-handover and S1-handover

2. whether or not the eNodeBs are connected each-other (when they are connected, the interface is called X2) => this results in 2 separate cases: Direct Tunneling (we have X2) and Indirect Tunneling (we don’t have X2)

3. whether or not the MME changes (is relocated, as per the TS) => no MME relocation and MME relocation scenarios

4. whether or not the SGW changes (is relocated, as per the TS) => no SGW relocation and SGW relocation scenarios

5. in each of these cases, what happens to the user-plane traffic in terms of the path it takes; the uplink usually goes directly through the new components of handover, but the downlink data is forwarded back and forth around those elements – in the diagrams attached I have represented the user-plane in dotted lines – hope you’d like it😛

6. the user-plane flow problem appears only in the time interval that the handover is not completed, otherwise it is the usual; this is why there is only a downlink user-plane traffic described

So—let’s do this by the book.

TS 23.401, section 5.5.1.1.2 – X2-based handover with NO SGW relocation and NO MME relocation (implicit direct tunneling)

– UE moves from source eNB to target eNB, the X2 interface is present

– the downlink data flows this way: PGW -(via S5/S8)> SGW -(via S1-U)> source eNB -(via X2)> target eNB -(via LTE radio)> UE

55112

TS 23.401, section 5.5.1.1.3 – X2-based handover with SGW relocation and NO MME relocation (implicit direct tunneling)

– UE moves from source eNB to target eNB, the X2 interface is present

– the downlink data flows this way: PGW -(via S5/S8)> source SGW -(via S1-U)> target eNB -(via LTE radio)> UE

55113

* no MME relocation for X2-based handover :d

TS 23.401, section 5.5.1.2.2 – S1-based handover, NO SGW relocation and MME relocation + Direct Tunneling

– UE moves from source eNB to target eNB, the X2 interface is present

– the downlink data flows this way: PWG -(via S5/S8)> SGW -(via S1-U)> source eNB -(via X2)> target eNB -(via LTE radio)> UE

55122-dir

TS 23.401, section 5.5.1.2.2 – S1-based handover, NO SGW relocation and MME relocation + Indirect Tunneling

– UE moves from source eNB to target eNB, the X2 interface is NOT present

– the downlink data flows this way: PGW -(via S5/S8)> SGW -(via S1-U)> source eNB -(via S1-U)> SGW -(via S1-U)> target eNB -(via LTE radio)> UE

* this is the case when there are some downlink packets that have been forwarded from the SGW to the source eNB, BEFORE the handover is completed; this means that the source eNB (knowing there is a handover ongoing), resends/sends back these packets to the SGW they came from; the SGW, at this point, should be aware of the handover and buffer the packets until the handover is completed, then forward them via the appropriate S1-U to the target eNB

55122-indir

TS 23.401, section 5.5.1.2.3 – S1-based handover, SGW relocation and NO MME relocation + Indirect Tunneling

– UE moves from source eNB to target eNB, the X2 interface is NOT present

– the downlink data flows this way: PGW -(via S5/S8)> source SGW -(via S1-U)> source eNB -(via S1-U)> source SGW -(via…to check this up)> target SGW -(via S1-U)> target eNB -(via LTE radio)> UE

55123-indir-no-mme

TS 23.401, section 5.5.1.2.3 – S1-based handover, SGW relocation and MME relocation + Direct Tunneling

– UE moves from source eNB to target eNB, the X2 interface is present

– the downlink data flows this way: PGW -(via S5/S8)> source SGW -(via S1-U)> source eNB -(via X2)> target eNB -(via LTE radio)> UE

55123-dir

TS 23.401, section 5.5.1.2.3 – S1-based handover, SGW relocation and MME relocation + Indirect Tunneling

55123-indir

– UE moves from source eNB to target eNB, the X2 interface is NOT present

– the downlink data flows this way: PGW -(via S5/S8)> source SGW -(via S1-U)> source eNB -(via S1-U)> source SGW -(via…to check this up)> target SGW -(via S1-U)> target eNB -(via LTE radio)> UE

 

The signaling required for these handovers are described in TS 23.401 as a flow and in TS 29.274 at the IE level.

I will try to describe each flow (or at least the most significant ones) in future articles. Enjoy :p