Wednesday, May 28, 2014

Global Codeathon Wrap-up



The codeathon was great.  Mindy, Heidi, Michelle and Dan did a great job setting it all up and keeping it all working.  As you've certainly read from previous posts, I brought three students and was on the intermediate level backchannel to chat with kids who needed help.

First off, I'll cover the two things that didn't go superbly.  With all of the tasks for the intermediate group posted on the GC (global codeathon) website, all the students went to re-read them as soon as Heidi was finished speaking.  Not just all in Hanoi (about 60-80 users) but also the schools who were listening to the instructions over the Google Hangout.  We DDOS'd the website I think.  With a bit of patience, everything was back on a roll and going fine.  We were all a bit surprised that we would do that, but it is hard to test 100+ requests of your site at once.  So we learned and moved on.

Intermediate and beginner were our two sessions.  This looked great in planning, but we had some kids fall into the 'no a total beginner' but 'not ready to work on my own' category.  Most of these students would have benefited from going to the beginner session and re-learning a lot of what they had been introduced to.  However, no one wanted to crush a kids aspirations and send them to the beginner session after they had considered themselves an intermediate.  This meant that a few students needed a lot of extra help, and I had to re-adjust my approach to helping them.  Once I learned where these students were in Scratch, I got off of the backchannel and helped them face-to-face.

That's it.  A surprise on website traffic and a few students who mis-estimated their abilities.  As far as being an untested event bringing many schools together online, a lot of things should have gone wrong and didn't thanks to the team's planning.  Now some of the other schools did have their own issues with joining our Google Hangout, but to those of us who were not part of the organizing team, we had no idea and didn't think much about it.  We were focused on all the schools who were able to join us.

Backchanneling is what I knew I was going to learn a lot from.  Here are my two biggest take-aways: Backchannelchat.com has a few characters which it does not print.  I did try a few 'escape' characters, combining a backslash with a greater than.  It didn't work.  After firing off a few half-blank messages, I altered how I was typing.  The annoying part is, in Scratch, you use operators that look like this:   so I naturally recreated it like this < (Y >70) > and < (touching sprite 2) >
It was my attempt to explain the graphic.  In fact, everything between <   > , the greater than/less than, was cut out.  I got around this by simply typing more of an explanation.  Typing more was fine since I had very few questions to answer.

I was not able to help those students who were accidentally in the intermediate group through backchannel.  Instead of pointing out a particular block to use (which was the only assistance some students needed) I was dealing with totally new concepts for these students.  I was able to sit down with them (Luckily they were in Hanoi, in the room, rather than another country).  I don't know what Dan Slaughter went through with the beginner backchannel, but it may have been similar.

The last observation was: I was pretty useless.... in a GREAT way!

All of the students in the Hanoi intermediate group helped each other, taught each other and did great work on their own.  So aside from a few questions, they didn't need me.  I love it when students take on learning without me, if I've been a good teacher, I'm no longer needed.  Now I didn't teach all of these kids, but obviously their teachers did a great job, or I would have been helping everyone.

Sunday, May 11, 2014

First Timelapse with the Pi

  

I need to get a proper set up for the camera.  I used some glittery pipe cleaner through the support holes.

Saturday, May 10, 2014

Raspberry Pi Cam, VNC, Wifi

It's here, the Raspberry Pi camera.  Here meaning here in my living room, it has been available for quite a while now.  Also, a lot of other things.  Here is what I'll be covering today, I learned all of it from browsing other blogs and some Python knowledge, but want to compile today's work into one post and one page for you to learn from.

First: remote access.
    I love to have the TV on, so I don't like using it as a monitor for my Pi.
ssh would not work for me and VNC allows me access from afar.
Setting up VNC:
On the Pi I plugged it into the ethernet to get VNC working.
I started here: http://pihw.wordpress.com/guides/direct-network-connection/ but never got it working.
So I looked at VNC again and started here: http://www.rasptut.co.uk/files/raspberry-pi-vnc.php

Hook up your Pi to a monitor with it's own input devices. On your Pi, in the terminal:
sudo apt-get update
sudo apt-get install vnc-server

To start the VNC-server on your, in your terminal type:
vncserver -geometry 1024x768

Add an 8 character password and it is your choice to add a viewer password.
Note that the first time you run this (the first time since a restart) it is producing a call for :1 (remember this for later)

Now on your laptop/desktop THIS IS FOR LINUX (download from: http://www.realvnc.com/download/viewer/ for MAC OR WINDOWS) download VNC-viewer....which doesn't exist, through apt-get and when you grab the .gz or binaries...well I couldn't get it to work.  This did:

sudo apt-get install xtightvncviewer

On your Pi type in
ifconfig
to get your ip address.  It will be under the eth0 header, we will take this ip address from wlan0 soon.

Back to your laptop, in the terminal:
xtightvncviewer

The GUI fro this is an undersized window that wants the ip address AND :1
It does not look like other shots I've seen of VNC, just this:
Type in the ip: 192.000.0.000:1      -- the ip plus the :1 (which is the port we are accessing on the Pi)

This took me a while to get.  A mix of iffy internet connections here, not reading everything thoroughly.  If you start vncserver on the Pi again you will connect with ip:2 (192.000.0.000:2) When the Pi is restarted it will be 192.000.0.000:1 again.

You will be prompted for the password that you put into your Pi earlier.

That is it, your done!

However, now that you can control your Pi with a remote GUI, you are still stuck with it wired to ethernet.

Wifi was a pain last year.
Wifi is simple now.
I read this: http://www.maketecheasier.com/setup-wifi-on-raspberry-pi/
Then I plugged in the lil wifi dongle, clicked on the Wifi icon that is on the newest release of Wheezy, selected my network and it was online.
Done.

So now you can connect to your Pi over Wifi.

It is time to get the camera running.  I did this all over the Wifi.
Guide: http://thepihut.com/pages/how-to-install-the-raspberry-pi-camera
Before you follow the guide, watch this video: https://www.youtube.com/watch?v=T8T6S5eFpqE At the 2 minute mark it shows how to pull up the tabs and insert the camera's ribbon. Not rocket science, but helpful to see.

Launch xtightvncviewer from your laptop
Start Leafpad up on the Pi
raspistill -o myfirstpipicture.jpg

A few seconds later you will have your first snap shot.
I wanted to do some time lapse and read a few sites but found it way easier to use my Python knowledge (learned http://learnpythonthehardway.org/ and codecademy.com) I wrote a script to take one picture, mostly to test my scripting:

import os #to pass the arguments into the terminal - at least that is how I understand it
os.system("raspistill -o imagesnap.jpg") #within the " " is what you would normally put into the terminal.

Time Lapse:

import os
import time

i = 0

while i <= 15:
           imageNum = str(i)  #to number your images
           os.system("raspistill -o image%s.jpg"%(imageNum))
           i += 1
          time.sleep(15)

Yes, it is fixed in the number of shots it takes and the time it sleeps.  I'll be writing a new script to take these as input arguments when the timelapse.py is started.  The ones I read were messy (in my opinion) but they work.  More importantly, it is easy to script all of this with Python and there are plenty of different ways to do it.

I had everything setup at sunset, but it was dark by the time that the timelapse script ran correctly (messed up the " " placement as I didn't understand that everything within "raspistill -o image%s.jpg" was what would be passed on to the Terminal to be run.  It seems perfectly obvious now.

The script ran and I got 15 pictures of a dark window and Janet cutting up vegetables and closing the curtains.  It works, now I've just got to capture something fun with the time lapse.

But Wait!
There's more!

Getting VNC to start on the Pi automatically so it never needs to see a monitor again.
Ugh I did a few different, long things that didn't work.  Even the parts that said: if you get the following error, try this....   I was still stuck.
Ada to the rescue: https://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc/running-vncserver-at-startup
it is easy easy easy, but took a lot of searching to find this guide. I won't retype anything from the Ada guide here because there is a lot of fun stuff over at Ada Fruit so it is worth your browsing time.

-Jeff