PyCon 2014 – PiDoorbell Tutorial

We have had an intense 2 months (March and April) preparing for and delivering our first ever hands-on hardware and software workshop (PiDoorbell) from CodeChix Bay Area. And to top it off, it was done at a remote location all the way across the continent in Montreal, Canada.

It was a tremendous amount of hard work, planning, logistics, numerous hacking sessions to ramp up 4 awesome volunteer teaching assistants who all flew from the Bay Area to Montreal just to help out CodeChix with the tutorial.

And since it was a hardware workshop (first ever for PyCon, I think) and we were giving away hardware to each registered attendee (HUGE thanks to the PSF for helping us with the funding for these hardware kits), it was not without some upheavals and glitches. Namely, the SD cards that were ordered had a 20% fail rate and so we were scrambling at the end to burn more so we would have enough. And some students signed up at the last minute and we didn’t have enough hardware kits – we were short by 3.

We had originally scoped it for a class size of 20, but 23 attendees showed up. But, all was good – we gave them our own hardware to use in the class and made it work so everyone could have their own setup.

And the reviews are out – we got “Excellent” across the board except for one reviewer who said that they couldn’t give us a good review because they didn’t get their own hardware kit to take home since we had run out. We apologized to her for this and did our best to make it up to her.

All in all, we had a blast, the wifi gods were feeling generous towards us and everyone in the class had really positive comments about the tutorial. We worked our butts off including overcoming hurdles of work-deadlines/kids/home/pneumonia/moving-out-of-state-with-no-internet etc.

To the awesome PyCon 2014 PiDoorbell tutorial team – Hats off – you guys rock !

Photos are up on our Facebook group page.

CodeChix is now a 501c3 fiscally-sponsored non-profit !!

It is with great pleasure (and a considerable amount of relief followed by utter exhaustion) that I share with you the news that CodeChix has achieved 501c3 status through fiscal sponsorship.

I have been trying to get to this stage for the last two years and I cannot describe the quantity and type of hurdles I encountered in trying to do this. Frankly, it was really, really tough – similar to fish swimming upstream.

BUT – we’re there. Finally.

Our project name is the “CodeChix Education Fund“. We are a fiscally-sponsored project under Community Initiatives in San Francisco.

And, yes, donations are tax deductible through Network For Good -https://donatenow.networkforgood.org/communityin Make sure you specify CodeChix Education Fund in the Description so it goes to us.

I am still waiting for the IRS to bless us as an independent organization (they take two years to just look at the paperwork), but, in the meantime, we have a fiscal sponsor, Community Initiatives who has accepted my application and, so, we are now 501c3 qualified. Yaaay !!

One of the hurdles to getting to this stage was to raise a minimum of $25K in funding. We raised $5K through our Indiegogo campaign and that wasn’t enough (Thank you to all who donated ! Your perks should be coming soon.). I was going to fund the rest of it from my own pocket (the dwindling Bank of Rupa), but, I am expecting a corporate donation that has been promised and that will carry us for this year. Another Yaaay !!

We really need tech companies to sponsor us and be corporate sponsors, so we can continue to be trailblazers. We are the only tech-women-targeted non-profit to take on the challenge of the alarming dropout rate of women engineers on the technical ladder at tech companies across all industry regardless of technology. And to focus on TECHNICAL events and promoting awesome technical women who are being overlooked and unappreciated. And to be inspirations to the next generation of fresh college graduates as well as women returning to the industry who may or may not know what they are getting into and feel abandoned/isolated in these tough environments.

So, if you work at a company that has a foundation and/or matches donations, please put our name forward so we can get some financial support. If you need more info, email me directly at rupa at codechix dot org. If your company uses EasyMatch, please add us as the following organization. This way, your donation has twice the impact.

Community Initiatives / CodeChix Education Fund

Thank you for being our supporters and for volunteering with us. Stay tuned for announcements on our upcoming events !!! See you all there !

May the code be with you…

- Rupa

Star-Trek-like LED lights

[ Grace Hopper Conference India Nov. 14, 2013 - Getting your Hands Dirty with the RaspberryPi ]

Notes for replicating the project for Blinking LED’s in a sequence (like Star Trek main bridge)

Hardware

Rpi Model B
Rpi power adapter
Connection to laptop so that you can ssh to the Rpi (wired or wireless)
Breadboard (medium size)
3 LEDs (see picture)
3 1K resistors
4 Female to Male Jumper wires (get some extra if you can)
4 Male to Male Jumper wires (get some extra if you can)

Step-by-Step setup

IMPORTANT: Make sure you COUNT the pins correctly. Also, make sure you are careful with where the pins go on the breadboard. It’s hard to see sometimes and you might be off by one if you’re not careful. So, it’s always good to double check.

On the Rpi, do “pip install RPi.GPIO” – you need this library to make life easier
On the breadboard, on either side, you will see 2 long, marked lines of holes that go down the entire board. One line of holes is marked with “+” and the one next to it is marked with “-”. The “+” is for power and the “-” is for ground.
Take a Black female-male jumper and connect the pointy end to the first hole on the breadboard where you see “-”. What this does is make that particular series of holes “-”, i.e., ground. So, you can tap off of any of these holes to get access to ground without having to put a whole bunch of jumpers directly on the Rpi.
Now that we have a set of holes which are grounded on the breadboard, take a male-male jumper and connect one of the grounded holes to a different hole on one of teh regular breadboard holes. Best to see the pictures below.
When connecting the LED’s, the “longer” pin on the LED goes to power. The “shorter” pin goes to ground.
For the 3 LEDs I used, I used the following pins: 7, 11 and 15. See image below for counting the pins so you can connect to the correct ones.
If things don’t work, it’s almost always the wiring. Re-check all your connections.
GPIO pin layout for Rpi Model B

Connecting the GPIO pins to the LED with resistors in series
Connections on the Rpi (right to left) – Red (Pin 7), Orange (Pin 11), Yellow (Pin 15), Black (last Pin on that side which is ground)

Black wires are ground wires.

Make sure the two legs of the resistors are on different lines

Additional notes:
1. Get the RPi board revision: GPIO.RPI_REVISION
2. Get the Rpi.GPIO version: GPIO.VERSION

Basic (rough) code to test out your Star Trek-like LED Blinking lights (sequential)

#!/bin/python

import RPi.GPIO as GPIO
import time

PIN_1 = 7
PIN_2 = 11
PIN_3 = 15

# setup GPIO pin reference model. We use the BOARD method so we can access the pins on the P1 header.
GPIO.setmode(GPIO.BOARD)

def star_trek(pin1, pin2, pin3):

# setup the GPIO pin as an Input or Output
# for the purposes of this workshop, all the pins are setup as Output
GPIO.setup(pin1,GPIO.OUT)
GPIO.setup(pin2,GPIO.OUT)
GPIO.setup(pin3,GPIO.OUT)

#write to the GPIO pins to indicate when to turn
#which pin on (high) or off (low)
GPIO.output(pin1,GPIO.HIGH)
GPIO.output(pin2,GPIO.LOW)
GPIO.output(pin3,GPIO.LOW)

time.sleep(.5)
GPIO.output(pin1,GPIO.LOW)
GPIO.output(pin2,GPIO.HIGH)
GPIO.output(pin3,GPIO.LOW)

time.sleep(.5)
GPIO.output(pin1,GPIO.LOW)
GPIO.output(pin2,GPIO.LOW)
GPIO.output(pin3,GPIO.HIGH)

time.sleep(.5)

#cleanup all channels and reset
GPIO.cleanup()

#light up the LED’s in a sequence for 50 interations
for i in range(50):
star_trek(PIN_1, PIN_2, PIN_3)

”’
GPIO.setup(PIN_1,GPIO.OUT)
GPIO.setup(PIN_2,GPIO.OUT)
GPIO.setup(PIN_3,GPIO.OUT)

for i in range (100):
if (i % 2):
GPIO.output(PIN_1, GPIO.HIGH)
GPIO.output(PIN_2, GPIO.LOW)
GPIO.output(PIN_3, GPIO.LOW)

else:
GPIO.output(PIN_1, GPIO.LOW)
GPIO.output(PIN_2, GPIO.HIGH)
GPIO.output(PIN_3, GPIO.HIGH)

time.sleep(.2)

GPIO.cleanup()
”’

Inside Project OFconnect – The Technical Challenges

The OpenFlow (OF) spec defines an OF Channel as such:

The OpenFlow channel is the interface that connects each OpenFlow switch to a controller. Through this interface, the controller configures and manages the switch, receives events from the switch, and sends packets out the switch.

The ONF competition required a communications driver to support OF. The driver was to be usable by either a Switch or a Controller and manage the OF channels to the peering SDN device.

The availability of a driver such as this eases the barrier to entry for developing new controllers or switches that support OF. By encapsulating the wire communications in a shared library, the development of controller or switch can focus primarily on the OF protocol itself.

The submission criteria included:

  1. Code for driver
  2. Code for sample controller integrated with driver
  3. Demo with integrated controller and OF switches (virtual or physical)
  4. Proven platform independence
  5. Bindings to two other programming languages
  6. Preference for code written in C

The CodeChix team put their heads together at recurrent hacking sessions with pizza and a white board. The technical challenges were many.

SUBMISSION CHALLENGES

  1. Which controller do we use for integration?
  2. Which programming language for the driver?
  3. What cloud platform to support a shared test setup and demo?

It took nearly 4 weeks of unearthing open source controllers in every language possible – Java, Python, and C/C++, compiling and setting up test environments and walking the code of each to determine the effort in integrating the driver. Floodlight, ryu, NOX, POX, Trema, and Mul. We finally concluded on Mul for these reasons:

  1. Mul was written in C. This worked for us as the core competence in the team was in C programming.
  2. The code was easy to read and therefore lent itself to modification.
  3. It was being maintained actively by KulCloud based in South Korea and
  4. The software architect of the open source repo agreed readily to support the integration by answering our design questions, doing code reviews and the likes.

So, four weeks into the project, we had our SDN controller and a vague idea of what the driver was to accomplish.

It took another 4-8 weeks before we worked out the cloud platform for a shared test setup using mininet, and wireshark along with the integrated controller. We set up Ubuntu 12.04 LTS on Amazon’s AWS, installed mininet and wireshark and were good to go. A fairly expensive solution but the best we could find.

DRIVER CHALLENGES

Shared library

The driver had to be a shared library. None of us had built a stand-alone shared library and compiled an application with it. At the end of the project, we learnt how to write Makefiles, manipulate LDFLAGS and CFLAGS for creating shared library, use GNU tools such as ldconfig to install the library and finally compile the custom library with application code.

Standard utilities

Hash tables, platform independence, unit test framework – we had no cycles to write all this necessary infra code to support the library. Frantic searching for some open source options led us to GLib-2.0, Gnome’s SDK, not to be confused with glibc, the standard C library. We installed the library, compiled a hello world and proceeded to use it. Glib-2.0 did wonders for the project in these aspects:

  1. platform independence – with very little to no code change, the library compiled on ARM and x86 alike
  2. unit test framework – with very well defined API and terrific logging with XML and HTML generated output, the unit test framework was worth its weight in gold.

On the other hand, glib-2.0 was difficult in these areas:

  1. Hash tables – the largest chunk of unit testing effort and bug fixing was in this area. Never again will we use glib-2.0 for hash tables.
  2. Event loops – the loops didn’t dynamically accept new events; all events had to be defined before starting the loop processing.

Github

We decided to use github to host our two repos – one for driver and other for integrated controller – on github private accounts. A dev branch was created for each and workflow established. Each contributor would fork a copy of the main repo, clone the fork and merge changes to upstream using pull requests. The process of pull requests allows for collaborative code reviews before merging to upstream. This aspect however is the hardest to manage as it is extremely error prone. Pull requests gave the team many a moment of ‘oh no.. what did I do’. Fortunately git is highly reversible and recoverable.

INTEGRATION CHALLENGES

An existing, working SDN controller was to be integrated with our driver. Given that the functionality in the driver would already be present in any given controller, the primary objective of this task was to break apart the controller code to separate out the functionality that the driver provided. Once this was accomplished, the next step was to call the library API and finally write a whole lot of glue code to make controller and our driver talk to each other. We had to surgically remove and replace a working part with our driver!!

Next time, we’ll share aspects of design of the shared library along with code snippets.

First Team CodeChix competition submission for open source software !!!

Over the last 3.5 months, there has been a CodeChix team of 5 women engineers working towards a submission for an international competition on networking (ONF Driver Competition). This is the first competition submission by CodeChix and it’s a team of all women professionals – not students or independent contractors. I believe this is the first all-female team with these credentials to submit to an international competition!

These 5 women have full-time jobs as software engineers in Fortune 100 companies and two of them have little kids. They have spent almost all their weeknights/weekends and have also taken precious vacation days to work on this project on a volunteer basis! It all started when Deepa contacted me about this competition in May and said she wanted to build a CodeChix team and go for it! I was over the moon!

I am SO happy and tremendously proud to say that the CodeChix ONF Driver competition team has made their final submission @9:05pm PST yesterday (Sept. 15, 2013) !!!

Some Statistics:

Total time: 3.5 months
Lines of Code: 10,000+
Docs: Functional Spec, Block diagrams etc.
Size: 7MB+
Hours Spent (weeknights, weekends): 800 hours – probably more though

The team comprises of Deepa Dhurka (Technical Lead & Project Mgr), Ramya Bolla, Kajal Bhargava, Swapna Iyer and Rupa Dachere. We had Ben Pfaff as our advisor at the beginning of the project and that really helped us out and Dipjyoti Saikia, who was our MUL controller contact – we could not have done this without his help (he’s in S. Korea)! Shout out to Natasha Gude for her help in contacting Ben.

Deepa was the drive and technical lead on this project and she and the team pulled together through some truly difficult times:

  • Family emergencies (a team member’s husband got massively sick in India and she had to stay longer to cope with that)
  • Kids and home front – Two of the team members have little kids and everyone was juggling family/work life – not easy for a volunteer project that takes as much time and dedication as this one did
  • Getting legal blessing from 3 different companies
  • A big hurdle from one of the Fortune 500 companies that refused to give two core team members the legal OK to work on this particular open source project. We were stalled for 4 weeks because of this and had to go through a lot of hard work to get this company to pass the legal OK. And then we had to ask the ONF committee for an extension because of this delay. They gave it to us and extended the deadline for the competition by 4 weeks!
  • The “normal” team hours on weekdays were – 7p – 3am, I saw checkins at 4am/5am too. Weekends usually went till the wee hours of the morning.
  • Multi-user coordination and syncing using git and GitHub – it takes a LOT of time…

And it just goes to show – no matter what phase of life you’re in, if you have passion, drive and a CodeChix circle, you can reach for any star you want and get it! It is hard and will take a toll on you and everyone around you who depends on you – as long as you’re prepared to handle that toll, you’re golden.

I am truly inspired and humbled by this amazing team – just blown away.

We’ll be putting all the source etc. on the CodeChix github repo so everyone can take a look. And if you are interested in contributing to the source, please contact organizers at codechix dot org.

You can also support us by donating to our cause, spreading the word about the awesome and difficult work that we do and joining our membership in the Bay Area and Seattle. If you want to start a chapter and are a Sr. Engineer or Engineering Manager, ping us at organizers at codechix dot org.

PyCon 2014 CFP Deadlines coming up !

[Posted on our membership-only mailing list on Sept. 13, 2013.]

PyCon 2014 is in Montreal in April of next year. It’s a very good conference to attend – I spoke at the USA and Australia conferences this year.

PyCon 2014 CFP Site

CFP’s are open – here are some dates to keep in mind -

Sept. 15 – CFP’s for tutorials, talks, presentations
Oct. 15 – 5-minute lightning talks
Nov. 1 – Poster session

I know this won’t be in time for the upcoming CodeChix workshop on conference proposals in November, but, I would encourage everyone to try and submit a proposal (it has to be Python-related). Don’t be afraid/worried/apprehensive – it’s totally worth it.

And if your proposal gets accepted, you’ll have plenty of time to prepare :) and get lots of help/info at our November workshop.

AdaFruit supports CodeChix !!

We are delighted to announce that AdaFruit (run by the awesome Limor Fried) has agreed to sponsor CodeChix and have accepted CodeChix as a reseller! All CodeChix members who order through our channels are eligible for substantial discounts on items.

Here’s what AdaFruit says about our partnership:
It doesn’t matter if you’re a kid wanting to learn how to make the next popular gadget, or an educator who just wants to have a a great resource for your students to learn. Limor “Ladyada” Fried and her company Adafruit Industries (http://www.adafruit.com/) help makers of all skill levels learn basics of electronics and making things, all the way up to advanced engineering! Adafruit is thrilled to help sponsor CodeChix.org !

On International Women’s Day

I was invited to be a panelist at an event in honor of International Women’s Day. The event was organized by Google at their new Google Quad in Mt. View and, as most Google events, was sold out within 22 hours. The room seated 150 – I think there must have been 200 given the people standing in the back and the sides.

So here I was with my good friend Melody Bliss, talking about inspiration, technology and what it means to be an woman in technology. Correction, a woman developer/programmer/engineer in technology.

Laura Granka, our moderator asked us all how we got into technology and what inspired us. I had to think pretty hard about this since it’s not something I think about very much. It occurred to me that there were two main reasons (off the top of my head) that drove me towards technology/Computer Science, in particular. The first is that it seemed to me to be the only field where I could make an income that would make me financially independent. The second is that it seemed to me to be the only field where I could do my job without having to wear heels or fancy clothes. The latter was a more powerful driver than the former in my case.

The question about what inspired me was even harder to answer. All I knew was that I had this insane, inexplicable drive inside me which pushes me to do these things (like start CodeChix). I never asked myself where this drive comes from or what triggers it. And now I was being asked this very same question in front of 200 women. Pressure. And that’s when the simple truth dawned on me. I like helping myself get better, helping others get better and helping the environment get better. My deep need to help others (and, therefore, myself) and my love of nature and mountains are all tied into CodeChix. Creating the first ad-hoc, grassroots group for female developers in my living room, teaching/learning/creating/inspiring each other and going for hikes or planning to band together to contribute to something bigger than us – that is the CodeChix DNA.

I got to meet Megan Smith and wear the cool Google Glasses and take pictures with it at the event. I am still humbled by how approachable Megan was and how much energy and passion she exuded. She inspired me. And all the CodeChix members who show their support in different ways inspire me.

So, on International Women’s Day, I thank the powers that be for all the women that have been my inspiration – family, friends, acquaintances, colleagues, neighbors, teachers, students, mentors, mentees, email pals halfway across the world.

Thank you for being you and for standing up for yourself and showing us all that brains, beauty, compassion, hard work and achieving your dreams is what we are all about.

And, now I’m going to go modularize my code…

May the code be with you !
Rupa

Events for February 2013

We have two great events coming up for you this month. Register today to gain knowledge on both GIT and RaspberryPi.

GIT Workshop by GitHub – Part 2

Sunday, February 24, 2013 from 12:00 PM to 4:00 PM (PDT)
at Andreessen Horowitz in Menlo Park
Open to Women and Men. GitHub’s sponsoring lunch!

Register Now: http://codechix-git2.eventbrite.com

GitHub developers Julie Ann Horvath, Paul Betts, and Kevin Sawicki are back to hold the second part of workshop on GIT fundamentals. By the end of this workshop, you will have an in-depth knowledge of GIT including branching, merging etc.

If you have not attended “GIT Workshop – Part1″, just complete pre-requisites before coming to this workshop.

http://teach.github.com/articles/github-class-prerequisites


Tech Talk: Arduino/RaspberryPi for Engineers and Tinkerers

Wednesday, February 27, 2013 from 6:30 PM to 8:00 PM (PDT)
Location: TBD
Open to Women and Men

Register Now: http ://codechix-arduino.eventbrite.com

CodeChix founder Rupa Dachere, will be talking about her arduino project. This tech talk will provide the basics of Arduinos/Rpi’s and what they are and how they work. In particular, Rupa will go over the hardware components, all the code as well as doing a live demo. Fun Fun Fun!

Please feel free to forward this along to any interested women and men. Thanks for showing your support for our speakers and CodeChix Bay Area by signing up today!

Feel free to forward this message to anyone who may be interested in these events. Thank you!

Big Data Technology Conference in Boston Offers Discount to CodeChix Members

BZ Media’s inaugural Big Data TechCon, April 8-10 in Boston has generated lots of excitement. This transformative show will focus on the entire big data ecosystem, and attract developers, IT managers and practitioners.

Big Data TechCon is technology-agnostic and will apply to organizations using relational databases, NoSQL databases, graph databases, unstructured data, flat files and data feeds.

Receive a $100 discount off the 3-day pass by inserting the code MEDIASPONSOR when prompted. Exhibits are free. www.bigdatatechcon.com