Friday, July 10, 2015

Enrolling Chromebooks with a Teensy "helper"

Managing chromebooks in a GAFE domain is a breeze - once you have them enrolled.
The enrollment process is easy -don't get me wrong - but its mind numbing when you have more than a few to enroll. 

The part that I dislike the most is typing in the email address and password for the account I was using to enroll each device. That part of the process is the most prone to fat fingering keyboard strokes - thus resulting in typing again.. and again.. and again.. chromebook after chromebook.. ugg!

Well what if I told you there is an inexpensive little device that will save you from all that - not only entering in both the email and password, but never fat fingering a single one?  Yah.. I was dubious too.. but a student I had helping me not only introduced me to this device - but bowled me over when together we enrolled 156 chromebooks in under 90 minutes doing 5 at a time. 

The secret is in a little Arduino-Compatible Microcontroller called Teensy 3.1.

This little device will set you back a whole $19.80 (price at time of this writing) and comes with a usb cord to plug into your computer/chromebook.  You can purchase from a website called PJRC where a lot of this information also comes from. 


You will need to download three programs to get this to work. First is the Teensy Loader 

Second you will want to download and install Arduino and then Teensyduino

The instructions for this part is available here: http://pjrc.com/teensy/td_download.html


Now once you have everything installed - I did this on my computer running Windows 7 Pro - you will need to change some settings in Arduino - under the Tools menu: 
1. Select your board (Teensy 3.1)
2. Change keyboard to USB Type: "Keyboard + Mouse + Joystick"
3. Make sure keyboard layout is US English.


4. Now all you need to do is enter the code that will enter in the username, tab down and enters in the password.  I'm making this available on via dropbox - contact me if there is a problem downloading. 

5. Just edit the (two) lines for username and password.  
6. Save file - rename if you'd like.
7. Under Sketch menu - select Verify/Compile.
8. Use Teensy Loader to write the code to your Teensy. (should start automatically after compile completes in last step.)
9. Test it out on a chromebook.

We would plug the teensy in when we got to the Enterprise enrollment page - waited the two seconds it took and went to the next.  You could go all in and modify your code to also hit enter - but I played it safe and chose to hit enter myself after seeing both fields filled in. 

If you'd rather cut and paste the code - here it is between dashes:

--------------------------------------------------------------------- 
/*  A few reminders
   - ever statement in C needs to end in an semicolon otherwise you will get an error
   - make sure you go into tools>USB Type> and then select keyboard+mouse+joystick otherwise you'll get the error "keyboard not recognized"
   - this https://www.pjrc.com/teensy/td_keyboard.html and this https://www.arduino.cc/en/Reference/HomePage are helpful

 */

void setup() { //this loop will run once
   //gives the computer time to reconize the device 
  delay(4000); // it times in miliseconds
}
void loop(){//this loop will keep repeating
  Keyboard.print("user@yourdomain.org"); //types username
   
   delay(100);
   
   Keyboard.set_key1(KEY_TAB); //the next for lines tell the computer to send the tab key
   Keyboard.send_now();
   Keyboard.set_key1(0);  //these next two lines tell the comuputer to stop sending the tab key
   Keyboard.send_now();
   
   delay(100);
   
   Keyboard.print("supersecretpassword"); //types password
   
   delay(15000); //time before repeat optional
}


/*Keep mouse between these dashes otherwise the teensy will type into your code





*/
---------------------------------------------------------------------------------------------

Many thanks belong to D.L for sharing the idea and the code. I made minor revisions.

Follow me on twitter:
@JimHatz

2 comments:

  1. What I did was enter in the wireless creds in the Google Admin console for the secured wireless - then when onboarding the chromebooks into this ou - I just joined them to guest to get started - they then pick up the wireless creds for the secured side as soon as the profile is picked up. Trick is you just need to have a guest ssid.

    ReplyDelete
  2. Please see http://jamesonchrome.blogspot.com/2015/08/version-44-code-with-ctrl-alt-e.html for updated script.

    ReplyDelete