Three years ago today, I created the first commit of Raspi IO! Wow, three years, that's an eternity in the world of JavaScript libraries! Raspi IO started as many open source projects do, from a random, unexpected turn of events

I started doing Raspberry Pi robotics in early 2013 when I decided I wanted my aquarium lights controlled by my Raspberry Pi. I created a project I call Aquarium Control, which is still running to this day!

Back in 2013, no one was really doing robotics on the Raspberry Pi using Node.js, and I had to roll everything myself. Turning on and off an LED meant calling out to a Python library from Node.js, because there was no Node.js library for doing this at the time. I later switched to using the fs module to do file IO directly on GPIO devices. I realize now that this work was cutting edge at the time.

Around the beginning of 2014, I was trying to get my first conference talk proposal accepted. I thought that this Raspberry Pi robotics work would be interesting, so I submitted a talk proposal to CascadiaJS on how to do robotics with Node.js on the Raspberry Pi. In this proposal, I mentioned Johnny-Five (also pretty new back then). I got some details of it wrong, which attracted the attention of Rick Waldron, the creator of Johnny-Five. After some back and forth on Twitter about it, we somehow got on the topic of the then brand-new IO Plugin interface for Johnny-Five. Prior to this interface, Johnny-Five only supported the Arduino, and that was that. Out of our conversation, I decided to create Raspi IO.

Yes, Raspi IO came out of a back and forth on Twitter about a conference talk proposal that ultimately failed. Fate has a funny way of finding us.

Raspi IO was the second IO Plugin to be created for Johnny-Five. The first was Galileo IO, written by Rick two months prior. Coincidentally, the third IO plugin was (BeagleBone IO)[], whose first commit by Julian Duque exactly one day after Raspi IO's first commit!

I never expected Raspi IO to really go anywhere, and the first version was very rudimentary. It also used Node.js' fs module to read and write to the device drivers directly, and only supported GPIO. It was also really slow, pegged the CPU at around 80% while idling, and was somewhat brittle.

When it came time to add support for PWM, I realized that the architecture of v1 was insufficient, so I rewrote Raspi IO from scratch and based peripheral support on Wiring Pi, a C++ library for working with peripherals. I also moved from a monolithic architecture to a many-small-modules architecture, and on December 6th, 2014, I released version 2 of Raspi IO, along with version 1 of Raspi.js.

Raspi.js is the name I gave to the collection of modules that make up the underpinnings of Raspi IO. It's an easy to use library for working with Raspberry Pi peripherals in Node.js. It's Raspberry Pi specific though, unlike Johnny-Five, but can also be used without Johnny-Five if you want to keep your code a little lighter.

Time went on, and I've made a number of other improvements. I've added new features, fixed lots of bugs, increased performance, and improved stability.

These days, most of Raspi IO is written in TypeScript, a statically typed dialect of JavaScript that has made maintenance a lot easier. One of these days, I'll convert raspi-io and raspi-io-core, the last two modules that don't use TypeScript yet. The architecture diagram for Raspi IO now looks like this:

Architecture Diagram

Lots of modules! I decided to go with this approach to make it easy for people to extend. This has really paid off to, as raspi-i2c was mostly written by Brian Cooke, a.k.a. @fivdi, and raspi-soft-pwm was mostly written by Tiago Alves, a.k.a. @tralves. A detailed writeup of the architecture can be found in the contributing guide.

I also spun most of the logic in Raspi IO into a new module called Raspi IO Core that should make it easier to support multiple operating systems. One of my next big goals is to support Windows 10 IoT Core on the Raspberry Pi.

Three years feels like an eternity for a project. I've worked on this project as long as I worked on my Ph.D. dissertation project, which is more than a year longer than any other project I've worked on (including for various employers). I've learned a lot about how to effectively run an open source project. I've learned that there's something of a zen to listening to users requests and following your vision for a project. I've learned about the importance of documentation and how . I'm really proud of Raspi IO's documentation these days, which is quite extensive for an open source project.

I also couldn't have done this alone, and I really want to thank everyone who has contributed! 11 people have contributed code to the project, and many more have filed issues. This project really is what it is because of you.

To celebrate this momentous occasion, I created an open source digital birthday cake for Raspi IO, written using Raspi IO of course!

Birthday Cake