Tip:
Highlight text to annotate it
X
>> WESLEY: All right! I came here a while ago with some questions about the Raspberry
Pi. No one knew anything about it, so I did stuff with it. The Raspberry Pi is great;
it’s just a small chip size card - well a PC the size of a credit card rather – Right
here, so it’s got everything… I probably broke it
[laughter]
Running Linux, it’s got cheap I/O ports it runs software, it’s got lots of hardware,
you can do high level coding, low level coding bla bla bla.
It’s a computer on a small chip.
Alright, it’s good because it’s cheap. The model B, which is the only one they produce
this far is 35$. The model A which is coming out in this winter, and is the model that
they intend to use for schools is 25$ an even lower price point because it has half the
ram and one USB port. It’s easy to setup, you flash your OS onto an SD card and that
will do – fairly simple. Its…fairly well documented, yea it is well documented. Anything
that wasn’t on Raspberry Pi, I just googled it and it showed up. And it’s only been
out for a couple months so that pretty amazing. Uhm. It’s also a standard, compared to the
way most people build Linux and have different computers; the Raspberry Pi is a standard
product for Linux, so when you want to look up how to do something, you don’t have to
lookup how to do it specifically for your hardware because your hardware is the same
as every other peoples. And again, it’s cheap. You can screw around and break it and
it’s not going to be expensive.
Ok so what people have done with them; you can host a webserver on them, you can host
a file server; any kind of server. Although Minecraft is quite taxing and might break
it. People build supercomputers with it simply by wiring it in parallel. Uhm, people have
made robots with them which is pretty awesome. You can use it to host a media center. And
in Britain they are already using it for education, which is pretty awesome. They actually use
them in... you know Lego mind-storms? They used Lego mind storm stuff and used the Raspberry
pi to program it, so that’s pretty cool. You can run old arcade cabinets on the raspberry
pi, just a matter of rewiring. People are using Raspberry Pi’s to brew beer. You can
download a RPi [Raspberry PI] distro that helps you brew beer, it controls brewery stuff.
A lot of people use the RPi to control a traffic light. All this stuff you can find online.
And people use the RPi to synthesize Music. Alright, what I have done with mine is I’m
hosting a webserver to control all the other stuff I have on it. Hosting a file server
on it – it just kind of goes with it being a web server. I’m hosting an ice cast server
and source client. So I’m continually hosting the music from the RPi, […] and yea that’s
working. I’m using it to control the LED lights that I brought with me and I setup
my first Linux developing environment on it. Although I just kind of FTP into it and use
Notepad++ on it, anyway.
Uhm… here we go.
And there was my first test of lights strobing. That Actually worked pretty well in the middle
of the night. Didn’t wake up my roommate, pretty surprising.
[laughter]
Uhm. And .
And let’s go with my demo on how it works. So, yea. Hoping it works is always a great
plan. [pause] I know right. Let’s just turn it on [Frustrated sighing]
I got my web interface here, works on cellphones as well. Uh let’s see, I want a code of
the light blue color. [camera shuffling, pause]
And then we commit it.
[pause]
And we have a light blue color
>>>AUDIENCE MEMBER1: Its strobing!
>>> WESLEY: So the way that the lights work, is they are connected to the software PWM
boards on the RPi. The RPi comes with 24 GIO (general purpose IO ports) 2 of them are 5V
power, one is only 3.3V power. There is a couple browns, the rest GPIO port are preconfigured
for certain uses. There is only one hardware PWM port which, in all my genius I have decided
NOT to use.
So what I did was I repurposed three of the GPIO ports and GPIO is just high signal low
signal just like… this stuff that happens to be pre-drawn on the board. I don’t know
who wrote that…pretty useful though. Uhm and all PWM is; is rapidly pulsing it so that
the average voltage detected by the LED strip is lowered and that attenuates the voltage.
Which is why some people get headaches when they look at it when it’s wrong because
it’s actually blinking really really fast to make it look dimmer.
Anybody else have any other questions? I’ll try and answer ‘em.
>>>AUDIENCE MEMBER2: How did you come to knowing what you learned about this?
>>> WESLEY: I got into this knowing nothing about Linux and nothing about webserver and
nothing about Python either and I wrote something on Python. Uhm, I did know a little bit of
programming though; setting up the RPi took me about 1 day to get flashing correctly.
It probably took me around 4 times to flash the SD card correctly because the utility
I was using in Windows was terrible and it wouldn’t flash it right. Then once I finally
got that working I tried to do most of the OS stuff on to the 750GB external drive that
I added onto it and that wrote most of it because I just tried to change the user folder
over there instead of copying the files over it and that broke it pretty hard. So I had
to reinstall the OS again after that and then do it right.
After I got all of that formatting set up, I then decided I wanted to control LED lights
because I’d seen someone else in my dorm room do it using an Arduino in their room.
Now, they only had 7 colors full on and full off for each channel and I thought, “I’m
going to 1up them, I’m gonna use full RGB spectrum, let’s do this!”
So I started doing some research. I determined that I would have to use PWM to do it. I read
the RPi had only 1 PWM port to do it, I wasn’t really worried about this because the person
I spoke to about this told me and I was like, “I’ll figure out some way to do it”.
I read online, there was a C library to control the GPIO ports. I tried used that first; first
I uh, setting up the webserver was pretty straight forward. I set up the webserver in
about 3 hours. Learned HTML in the 3 hours after that learn PHP in 2 hours after that
and learned JavaScript in 1 hour after that. Well, “learned”.
[laughs]
In order to get things working. And quickly used bootstrap to throw a UI and
spent uh, 4 days making a user authentication system because I want my overboard on that
and have full permission system I built using MySQL server.
And then I went about building the light Daemon, after I got the wiring right – that was
actually the hardest thing for me – the wiring. First I it had hooked up to the other
end of the LED’s and I could not, for the life of me, get it to be off or on, Because
the led strip has either Inputs or outputs on both sides. On one end is ground control
on the other end its input control, you only need to plug it in on one end. Uhm, I was
trying to use ground control and no matter what I did the moss feds would be on or off,
instead of scaling as they should. (moss feds being the transistors that I used to communicate
the logic signal to the RPi without ruining all of them)
But yea, once I got the wiring right it was actually pretty trivial to use the GPIO Python
module to set up the lights. Then I just boosted it, made it into a Daemon and use this library
that someone here at the SEE told me about, called Pyro, to use another Python script
to communicate with this one. And then that Python called from PHP because initially I
was trying to use a C wrapper to give calls directly from PHP but you need to have root
privileges to use the GPIO ports, and PHP web server doesn’t exactly help you with
that so. Yea. It took me a couple days to figure that out and get that working. Weeks
actually
[pause]
Yea, it’s actually working right now. I actually just, like minutes ago, got a script
that fades the light right, working. Instead of just flipping from color to color. You
know if they were working right now and I wasn’t having a syntax error!
[laughs]
But uh, yea. Controlling my colors from any device. Now I can leave the lights on when
I’m going to bed and go “Oh Dang I left the lights on” I can just go bam, and now
they’re off! Which is pretty much the point of it. Just took a couple weeks of work to
get it done. And in my opinion a couple weeks of work for a couple minutes of work each
day is definitely worth it. So any other questions?
>>> AUDIENCE MEMBER 3: What is by far the most amazing thing people do with the RPi.
>>> WESLEY: That I have seen people do?! Wire up 64 of them together and use it as a super
computer. And the case of the super computer being made of Legos! Because it’s just the
right size to enclose in Legos! It’s pretty awesome… yes!?
>>> AM4: For this particular use, with the LEDS and stuff, how would you say using the
RPi compares to hooking them up to an Arduino, let’s say. IS it more trouble and is it
worth it?
>>> WESLEY: My own trouble is my faulty wiring job as you can tell. I touch it and it goes
on or off.But beyond that the RPi is actually a nice interface because with the Arduino
I would be stuck coding in Arduino code and stuff, whereas with the RPi I can code in
whichever language I like, which is pretty awesome.
>>> AM5: Your wiring is so bad!
[laughs]
>>> WESLEY: But uh beyond that, I have never actually used Arduino, since it was also my
first adventure with hardware type things. So considering I was mostly a software kind
of guy this was kind of a nice middle ground for me because when I first booted up I actually
had to plug into a HDMI port and plug in to a monitor I was using and see how the Raspberry
Pi in Linux would work. And then found out, wow this is actually pretty slow compared
to the just SSHing in from a better computer so I ended up doing that. Yea I really don’t
know how it compares to an Arduino beyond the fact that this can do a lot more complicated
things; you can’t really host a web-server on an Arduino that well.
>>> AM4: Yea, I just meant for the particular Use here. Obviously ….
I just mean like interacting with LED’s
>>> WESLEY: The Arduino has the advantage that most Servos are 5V servos and the Arduino
uses 5v logic which means you can hook them up directly; you don’t have to have something
like an offset or a logic level; Whereas with the RPi there is a logic level of 3.3V which
makes it picky. There aren’t as much 3.3 V Servos or light or anything. So you always
have to have something to temper voltage between your components. I think I broke it
[laughs]
Any other question?
>>> AM5: What Linux distro do you have on there?
>>> WESLEY: It’s a version of debian called… either Raspbian or Squeeze. I can never remember
which one it is. Because they were both released around the same time I flashed it. One was
the newer and came out the day I flashed it and I don’t remember which one I used. Yes?
>>>AM6: Is availability still limited on these or are they actually…
>>>WESLEY: They actually aren’t produced enough where you can buy them. Primarily because
there are both US and British manufacturing centers in addition to the original sites
which were just in Asia because of cheapness. You could order from LA electronics which
is from California on the West Coast. That’s where I got mine from. Yea?
>>> AM4: They are all the same price, no matter where you order them
from?
>>> WESLEY: YES!
[Continued discussion]
Like I said you can get two models. In winter you can get the model A for 25$, I have the
model B. The main difference being model A has 1 USB port and half as much RAM. And this
diagram actually shows for model A. Model B has 512MB RAM
>>>AM7: Does model A still lack an Ethernet port?
>>> Wesley: Uhm, I do not know. I know model B has an Ethernet port; there is an Ethernet
port in this diagram so.
>>> AM7: That’s A?
>>> Wesley: I believe it is, last time I saw didn’t have labeled which parts were which.
[pause]
Anything else? No? No? Ok then!